diff options
| author | Robert Yang <liezhi.yang@windriver.com> | 2024-11-26 00:37:23 -0800 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-12-06 05:50:25 -0800 |
| commit | 4509002b442b1acb771996081947a899e519e7ce (patch) | |
| tree | b097d5311065aaa9d0d72e9ddcec26529df41916 /meta | |
| parent | 6741c78d3fc51ca0a28c3313e6c7705d2c028d36 (diff) | |
| download | poky-4509002b442b1acb771996081947a899e519e7ce.tar.gz | |
libgcrypt: Fix building error with '-O2' in sysroot path
* Backport a patch to fix:
$ . oe-init-build-env build-O2
$ bitbake libgcrypt
random/rndjent.c:40:10: fatal error: stdio.h: No such file or directory
* Remove 0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch which
is fixed by the backported patch.
Note, master branch's libgcrypt_1.11.0.bb has already fixed this problem.
(From OE-Core rev: c091ae2c6d45a95f0707b649bbe556275420e5e9)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
3 files changed, 65 insertions, 40 deletions
diff --git a/meta/recipes-support/libgcrypt/files/0001-Fix-building-error-with-O2-in-sysroot-path.patch b/meta/recipes-support/libgcrypt/files/0001-Fix-building-error-with-O2-in-sysroot-path.patch new file mode 100644 index 0000000000..dee4969f35 --- /dev/null +++ b/meta/recipes-support/libgcrypt/files/0001-Fix-building-error-with-O2-in-sysroot-path.patch | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | From b99952adc6ee611641709610d2e4dc90ba9acf37 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "simit.ghane" <simit.ghane@lge.com> | ||
| 3 | Date: Tue, 7 May 2024 14:09:03 +0530 | ||
| 4 | Subject: [PATCH] Fix building error with '-O2' in sysroot path | ||
| 5 | |||
| 6 | * cipher/Makefile.am (o_flag_munging): Tweak the sed script. | ||
| 7 | * random/Makefile.am (o_flag_munging): Ditto. | ||
| 8 | -- | ||
| 9 | |||
| 10 | Characters like '-O2' or '-Ofast' will be replaced by '-O1' and '-O0' | ||
| 11 | respectively when compiling cipher and random in the filesystem | ||
| 12 | paths as well if they happen to contain '-O2' or '-Ofast | ||
| 13 | |||
| 14 | If we are cross compiling libgcrypt and sysroot contains such | ||
| 15 | characters, we would | ||
| 16 | get compile errors because the sysroot path has been modified. | ||
| 17 | |||
| 18 | Fix this by adding blank spaces and tabs before the original matching | ||
| 19 | pattern in the sed command. | ||
| 20 | |||
| 21 | Signed-off-by: simit.ghane <simit.ghane@lge.com> | ||
| 22 | |||
| 23 | ChangeLog entries added by wk | ||
| 24 | |||
| 25 | Note that there is also the configure option --disable-O-flag-munging; | ||
| 26 | see the README. | ||
| 27 | |||
| 28 | Upstream-Status: Backport [https://dev.gnupg.org/rCb99952adc6ee611641709610d2e4dc90ba9acf37 https://dev.gnupg.org/rC5afadba008918d651afefb842ae123cc18454c74] | ||
| 29 | |||
| 30 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
| 31 | --- | ||
| 32 | cipher/Makefile.am | 2 +- | ||
| 33 | random/Makefile.am | 2 +- | ||
| 34 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
| 35 | |||
| 36 | diff --git a/cipher/Makefile.am b/cipher/Makefile.am | ||
| 37 | index 2c39586e..a914ed2b 100644 | ||
| 38 | --- a/cipher/Makefile.am | ||
| 39 | +++ b/cipher/Makefile.am | ||
| 40 | @@ -168,7 +168,7 @@ gost-s-box$(EXEEXT_FOR_BUILD): gost-s-box.c | ||
| 41 | |||
| 42 | |||
| 43 | if ENABLE_O_FLAG_MUNGING | ||
| 44 | -o_flag_munging = sed -e 's/-O\([2-9sgz][2-9sgz]*\)/-O1/' -e 's/-Ofast/-O1/g' | ||
| 45 | +o_flag_munging = sed -e 's/[[:blank:]]-O\([2-9sgz][2-9sgz]*\)/ -O1 /g' -e 's/[[:blank:]]-Ofast/ -O1 /g' | ||
| 46 | else | ||
| 47 | o_flag_munging = cat | ||
| 48 | endif | ||
| 49 | diff --git a/random/Makefile.am b/random/Makefile.am | ||
| 50 | index 0c935a05..340df38a 100644 | ||
| 51 | --- a/random/Makefile.am | ||
| 52 | +++ b/random/Makefile.am | ||
| 53 | @@ -56,7 +56,7 @@ jitterentropy-base.c jitterentropy.h jitterentropy-base-user.h | ||
| 54 | |||
| 55 | # The rndjent module needs to be compiled without optimization. */ | ||
| 56 | if ENABLE_O_FLAG_MUNGING | ||
| 57 | -o_flag_munging = sed -e 's/-O\([1-9sgz][1-9sgz]*\)/-O0/g' -e 's/-Ofast/-O0/g' | ||
| 58 | +o_flag_munging = sed -e 's/[[:blank:]]-O\([1-9sgz][1-9sgz]*\)/ -O0 /g' -e 's/[[:blank:]]-Ofast/ -O0 /g' | ||
| 59 | else | ||
| 60 | o_flag_munging = cat | ||
| 61 | endif | ||
| 62 | -- | ||
| 63 | 2.44.1 | ||
| 64 | |||
diff --git a/meta/recipes-support/libgcrypt/files/0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch b/meta/recipes-support/libgcrypt/files/0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch deleted file mode 100644 index cf9ebfb3e6..0000000000 --- a/meta/recipes-support/libgcrypt/files/0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch +++ /dev/null | |||
| @@ -1,39 +0,0 @@ | |||
| 1 | From 0f66e796a8522e1043dda03b88d5f6feae839d16 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Chen Qi <Qi.Chen@windriver.com> | ||
| 3 | Date: Wed, 16 Aug 2017 10:44:41 +0800 | ||
| 4 | Subject: [PATCH] libgcrypt: fix building error with '-O2' in sysroot path | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | |||
| 8 | Characters like '-O2' or '-Ofast' will be replaced by '-O1' when | ||
| 9 | compiling cipher. | ||
| 10 | If we are cross compiling libgcrypt and sysroot contains such | ||
| 11 | characters, we would | ||
| 12 | get compile errors because the sysroot path has been modified. | ||
| 13 | |||
| 14 | Fix this by adding blank spaces before and after the original matching | ||
| 15 | pattern in the | ||
| 16 | sed command. | ||
| 17 | |||
| 18 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
| 19 | |||
| 20 | Rebase to 1.8.0 | ||
| 21 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 22 | |||
| 23 | --- | ||
| 24 | cipher/Makefile.am | 2 +- | ||
| 25 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 26 | |||
| 27 | diff --git a/cipher/Makefile.am b/cipher/Makefile.am | ||
| 28 | index c3d642b..88c883a 100644 | ||
| 29 | --- a/cipher/Makefile.am | ||
| 30 | +++ b/cipher/Makefile.am | ||
| 31 | @@ -153,7 +153,7 @@ gost-s-box: gost-s-box.c | ||
| 32 | |||
| 33 | |||
| 34 | if ENABLE_O_FLAG_MUNGING | ||
| 35 | -o_flag_munging = sed -e 's/-O\([2-9sgz][2-9sgz]*\)/-O1/' -e 's/-Ofast/-O1/g' | ||
| 36 | +o_flag_munging = sed -e 's/ -O\([2-9sgz][2-9sgz]*\) / -O1 /' -e 's/ -Ofast / -O1 /g' | ||
| 37 | else | ||
| 38 | o_flag_munging = cat | ||
| 39 | endif | ||
diff --git a/meta/recipes-support/libgcrypt/libgcrypt_1.10.3.bb b/meta/recipes-support/libgcrypt/libgcrypt_1.10.3.bb index 5a76201ab5..3d49d586bb 100644 --- a/meta/recipes-support/libgcrypt/libgcrypt_1.10.3.bb +++ b/meta/recipes-support/libgcrypt/libgcrypt_1.10.3.bb | |||
| @@ -21,11 +21,11 @@ DEPENDS = "libgpg-error" | |||
| 21 | UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html" | 21 | UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html" |
| 22 | SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \ | 22 | SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \ |
| 23 | file://0001-libgcrypt-fix-m4-file-for-oe-core.patch \ | 23 | file://0001-libgcrypt-fix-m4-file-for-oe-core.patch \ |
| 24 | file://0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \ | ||
| 25 | file://0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch \ | 24 | file://0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch \ |
| 26 | file://no-native-gpg-error.patch \ | 25 | file://no-native-gpg-error.patch \ |
| 27 | file://no-bench-slope.patch \ | 26 | file://no-bench-slope.patch \ |
| 28 | file://run-ptest \ | 27 | file://run-ptest \ |
| 28 | file://0001-Fix-building-error-with-O2-in-sysroot-path.patch \ | ||
| 29 | " | 29 | " |
| 30 | SRC_URI[sha256sum] = "8b0870897ac5ac67ded568dcfadf45969cfa8a6beb0fd60af2a9eadc2a3272aa" | 30 | SRC_URI[sha256sum] = "8b0870897ac5ac67ded568dcfadf45969cfa8a6beb0fd60af2a9eadc2a3272aa" |
| 31 | 31 | ||
