Skip to contentSkip to conversation

package/zchunk: fix unsafe header/library path

PATCH Applied James Hilliard 2 participants 2 messages May 2, 2022 – May 3, 2022 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/zchunk: fix unsafe header/library path

Backport a patch from upstream to fix:
unsafe header/library path used in cross-compilation: '-I/usr/include'

Fixes:
- http://autobuild.buildroot.net/results/825/82517abd49dcf82c17fabaf9680353d5a6cc4279

---
 ...rgp-standalone-wrap-and-find_library.patch | 106 ++++++++++++++++++
 1 file changed, 106 insertions(+)
 create mode 100644 package/zchunk/0001-meson-fix-argp-standalone-wrap-and-find_library.patch
package/zchunk/0001-meson-fix-argp-standalone-wrap-and-find_library.patch new file +106 -0
new file mode 100644
index 0000000000..6c9cdba3ad
@@ -0,0 +1,106 @@
+From 473c97cda44b95f5cea08a0cdd566e602df564db Mon Sep 17 00:00:00 2001
+From: James Hilliard <[email protected]>
+Date: Thu, 21 Apr 2022 14:24:01 -0600
+Subject: [PATCH] meson: fix argp-standalone wrap and find_library
+
+Signed-off-by: James Hilliard <[email protected]>
+[[email protected]: backport from upstream commit
+473c97cda44b95f5cea08a0cdd566e602df564db]
+---
+ .github/workflows/main.yml       | 27 ---------------------------
+ meson.build                      |  6 +++---
+ subprojects/argp-standalone.wrap |  7 +++++++
+ 3 files changed, 10 insertions(+), 30 deletions(-)
+ create mode 100644 subprojects/argp-standalone.wrap
+
+diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
+index c49806f..35667af 100644
+--- a/.github/workflows/main.yml
++++ b/.github/workflows/main.yml
+@@ -35,25 +35,11 @@ jobs:
+     steps:
+       - uses: actions/checkout@v2
+ 
+-      - uses: actions/checkout@v2
+-        with:
+-          repository: wolfv/argp-standalone
+-          path: argp-standalone
+-
+       - name: Install mamba
+         uses: mamba-org/provision-with-micromamba@main
+         with:
+           environment-file: .github/environment.yml
+ 
+-      - name: Compile argp-standalone
+-        shell: cmd /C CALL {0}
+-        run: |
+-          CALL micromamba activate zchunk_test_env
+-          cd argp-standalone
+-          meson setup builddir
+-          meson compile -C builddir --prefix=%CONDA_PREFIX%\Library
+-          meson install -C builddir
+-
+       - name: Compile zchunk
+         shell: cmd /C CALL {0}
+         run: |
+@@ -75,11 +61,6 @@ jobs:
+     steps:
+       - uses: actions/checkout@v2
+ 
+-      - uses: actions/checkout@v2
+-        with:
+-          repository: wolfv/argp-standalone
+-          path: argp-standalone
+-
+       - uses: actions/setup-python@v1
+         with:
+           python-version: '3.x'
+@@ -87,14 +68,6 @@ jobs:
+       - name: Install meson and ninja
+         run: pip install meson ninja
+ 
+-      - name: Compile argp-standalone
+-        shell: cmd /C CALL {0}
+-        run: |
+-          cd argp-standalone
+-          meson setup builddir
+-          meson compile -C builddir
+-          meson install -C builddir
+-
+       - name: Compile zchunk
+         shell: cmd /C CALL {0}
+         run: |
+diff --git a/meson.build b/meson.build
+index 1c6b32d..aa7dd25 100644
+--- a/meson.build
++++ b/meson.build
+@@ -58,10 +58,10 @@ endif
+ 
+ # argp-standalone dependency (if required)
+ if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
+-    if fs.is_dir(join_paths([get_option('prefix'), 'include']))
+-        inc += include_directories(join_paths([get_option('prefix'), 'include']))
++    argplib = cc.find_library('argp', has_headers : ['argp.h'], required: false)
++    if not argplib.found()
++        argplib = dependency('argp-standalone')
+     endif
+-    argplib = cc.find_library('argp', dirs : join_paths([get_option('prefix'), 'lib']))
+ else
+     argplib = dependency('', required : false)
+ endif
+diff --git a/subprojects/argp-standalone.wrap b/subprojects/argp-standalone.wrap
+new file mode 100644
+index 0000000..14c0b63
+--- /dev/null
++++ b/subprojects/argp-standalone.wrap
+@@ -0,0 +1,7 @@
++[wrap-git]
++directory = argp-standalone-1.4.1
++url = https://github.com/argp-standalone/argp-standalone.git
++revision = 21855f34ec9997c37e1a08cd69497336513a5800
++
++[provide]
++dependency_names = argp-standalone
+-- 
+2.25.1
+
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 7 lines · James Hilliard

Backport a patch from upstream to fix:
unsafe header/library path used in cross-compilation: '-I/usr/include'

Fixes:
- http://autobuild.buildroot.net/results/825/82517abd49dcf82c17fabaf9680353d5a6cc4279

Applied to master, thanks.

Regards,
Arnout

Quoted 107 lines
---
  ...rgp-standalone-wrap-and-find_library.patch | 106 ++++++++++++++++++
  1 file changed, 106 insertions(+)

create mode 100644 package/zchunk/0001-meson-fix-argp-standalone-wrap-and-find_library.patch

package/zchunk/0001-meson-fix-argp-standalone-wrap-and-find_library.patch new file +96 -0
new file mode 100644
index 0000000000..6c9cdba3ad
@@ -0,0 +1,106 @@
+From 473c97cda44b95f5cea08a0cdd566e602df564db Mon Sep 17 00:00:00 2001
+From: James Hilliard <[email protected]>
+Date: Thu, 21 Apr 2022 14:24:01 -0600
+Subject: [PATCH] meson: fix argp-standalone wrap and find_library
+
+Signed-off-by: James Hilliard <[email protected]>
+[[email protected]: backport from upstream commit
+473c97cda44b95f5cea08a0cdd566e602df564db]
+---
+ .github/workflows/main.yml       | 27 ---------------------------
+ meson.build                      |  6 +++---
+ subprojects/argp-standalone.wrap |  7 +++++++
+ 3 files changed, 10 insertions(+), 30 deletions(-)
+ create mode 100644 subprojects/argp-standalone.wrap
+
+diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
+index c49806f..35667af 100644
+--- a/.github/workflows/main.yml
++++ b/.github/workflows/main.yml
+@@ -35,25 +35,11 @@ jobs:
+     steps:
+       - uses: actions/checkout@v2
+
+-      - uses: actions/checkout@v2
+-        with:
+-          repository: wolfv/argp-standalone
+-          path: argp-standalone
+-
+       - name: Install mamba
+         uses: mamba-org/provision-with-micromamba@main
+         with:
+           environment-file: .github/environment.yml
+
+-      - name: Compile argp-standalone
+-        shell: cmd /C CALL {0}
+-        run: |
+-          CALL micromamba activate zchunk_test_env
+-          cd argp-standalone
+-          meson setup builddir
+-          meson compile -C builddir --prefix=%CONDA_PREFIX%\Library
+-          meson install -C builddir
+-
+       - name: Compile zchunk
+         shell: cmd /C CALL {0}
+         run: |
+@@ -75,11 +61,6 @@ jobs:
+     steps:
+       - uses: actions/checkout@v2
+
+-      - uses: actions/checkout@v2
+-        with:
+-          repository: wolfv/argp-standalone
+-          path: argp-standalone
+-
+       - uses: actions/setup-python@v1
+         with:
+           python-version: '3.x'
+@@ -87,14 +68,6 @@ jobs:
+       - name: Install meson and ninja
+         run: pip install meson ninja
+
+-      - name: Compile argp-standalone
+-        shell: cmd /C CALL {0}
+-        run: |
+-          cd argp-standalone
+-          meson setup builddir
+-          meson compile -C builddir
+-          meson install -C builddir
+-
+       - name: Compile zchunk
+         shell: cmd /C CALL {0}
+         run: |
+diff --git a/meson.build b/meson.build
+index 1c6b32d..aa7dd25 100644
+--- a/meson.build
++++ b/meson.build
+@@ -58,10 +58,10 @@ endif
+
+ # argp-standalone dependency (if required)
+ if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
+-    if fs.is_dir(join_paths([get_option('prefix'), 'include']))
+-        inc += include_directories(join_paths([get_option('prefix'), 'include']))
++    argplib = cc.find_library('argp', has_headers : ['argp.h'], required: false)
++    if not argplib.found()
++        argplib = dependency('argp-standalone')
+     endif
+-    argplib = cc.find_library('argp', dirs : join_paths([get_option('prefix'), 'lib']))
+ else
+     argplib = dependency('', required : false)
+ endif
+diff --git a/subprojects/argp-standalone.wrap b/subprojects/argp-standalone.wrap
+new file mode 100644
+index 0000000..14c0b63
+--- /dev/null
++++ b/subprojects/argp-standalone.wrap
+@@ -0,0 +1,7 @@

package/zchunk/0001-meson-fix-argp-standalone-wrap-and-find_library.patch line 106

Quoted 10 lines
package/zchunk/0001-meson-fix-argp-standalone-wrap-and-find_library.patch new file +10 -0
++[wrap-git]
++directory = argp-standalone-1.4.1
++url = https://github.com/argp-standalone/argp-standalone.git
++revision = 21855f34ec9997c37e1a08cd69497336513a5800
++
++[provide]
++dependency_names = argp-standalone
+--
+2.25.1
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot