* [PATCHv1] Fix building error with '-O2' in sysroot path
@ 2024-05-08 10:48 simit.ghane
2024-05-08 14:47 ` [OE-core] " Ross Burton
0 siblings, 1 reply; 3+ messages in thread
From: simit.ghane @ 2024-05-08 10:48 UTC (permalink / raw)
To: openembedded-core
Cc: rajesh.kanna, vijaya.sundaram, dp.min, krishnakumar.s,
jaeyoon.jung, martin2.jansa, simit.ghane
Characters like '-O2' or '-Ofast' will be replaced by '-O1' and '-O0'
respectively when compiling cipher and random in the filesystem
paths as well if they happen to contain '-O2' or '-Ofast
If we are cross compiling libgcrypt and sysroot contains such
characters, we would
get compile errors because the sysroot path has been modified.
Fix this by adding blank spaces and tabs before the original matching
pattern in the sed command.
Signed-off-by: simit.ghane <simit.ghane@lge.com>
---
...ilding-error-with-O2-in-sysroot-path.patch | 52 +++++++++++++------
1 file changed, 36 insertions(+), 16 deletions(-)
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
index cf9ebfb3e6..339bc9c563 100644
--- 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
@@ -1,31 +1,38 @@
-From 0f66e796a8522e1043dda03b88d5f6feae839d16 Mon Sep 17 00:00:00 2001
-From: Chen Qi <Qi.Chen@windriver.com>
-Date: Wed, 16 Aug 2017 10:44:41 +0800
-Subject: [PATCH] libgcrypt: fix building error with '-O2' in sysroot path
+From 7d9817ca935a35fe6c8e2c2c7615825fa08a3a19 Mon Sep 17 00:00:00 2001
+From: "simit.ghane" <simit.ghane@lge.com>
+Date: Tue, 7 May 2024 14:09:03 +0530
+Subject: [PATCHV2] Fix building error with '-O2' in sysroot path
-Upstream-Status: Pending
+Upstream-Status: Backport [https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=7d9817ca935a35fe6c8e2c2c7615825fa08a3a19]
+
+* cipher/Makefile.am (o_flag_munging): Tweak the sed script.
+* random/Makefile.am (o_flag_munging): Ditto.
+--
+
+Characters like '-O2' or '-Ofast' will be replaced by '-O1' and '-O0'
+respectively when compiling cipher and random in the filesystem
+paths as well if they happen to contain '-O2' or '-Ofast
-Characters like '-O2' or '-Ofast' will be replaced by '-O1' when
-compiling cipher.
If we are cross compiling libgcrypt and sysroot contains such
characters, we would
get compile errors because the sysroot path has been modified.
-Fix this by adding blank spaces before and after the original matching
-pattern in the
-sed command.
+Fix this by adding blank spaces and tabs before the original matching
+pattern in the sed command.
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+Signed-off-by: simit.ghane <simit.ghane@lge.com>
-Rebase to 1.8.0
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+ChangeLog entries added by wk
+Note that there is also the configure option --disable-O-flag-munging;
+see the README.
---
cipher/Makefile.am | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ random/Makefile.am | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cipher/Makefile.am b/cipher/Makefile.am
-index c3d642b..88c883a 100644
+index c3d642b2ac..f1c3971c40 100644
--- a/cipher/Makefile.am
+++ b/cipher/Makefile.am
@@ -153,7 +153,7 @@ gost-s-box: gost-s-box.c
@@ -33,7 +40,20 @@ index c3d642b..88c883a 100644
if ENABLE_O_FLAG_MUNGING
-o_flag_munging = sed -e 's/-O\([2-9sgz][2-9sgz]*\)/-O1/' -e 's/-Ofast/-O1/g'
-+o_flag_munging = sed -e 's/ -O\([2-9sgz][2-9sgz]*\) / -O1 /' -e 's/ -Ofast / -O1 /g'
++o_flag_munging = sed -e 's/[[:blank:]]-O\([2-9sgz][2-9sgz]*\)/ -O1 /' -e 's/[[:blank:]]-Ofast/ -O1 /g'
+ else
+ o_flag_munging = cat
+ endif
+diff --git a/random/Makefile.am b/random/Makefile.am
+index 0c935a0595..340df38a79 100644
+--- a/random/Makefile.am
++++ b/random/Makefile.am
+@@ -56,7 +56,7 @@ jitterentropy-base.c jitterentropy.h jitterentropy-base-user.h
+
+ # The rndjent module needs to be compiled without optimization. */
+ if ENABLE_O_FLAG_MUNGING
+-o_flag_munging = sed -e 's/-O\([1-9sgz][1-9sgz]*\)/-O0/g' -e 's/-Ofast/-O0/g'
++o_flag_munging = sed -e 's/[[:blank:]]-O\([2-9sgz][2-9sgz]*\)/ -O0 /' -e 's/[[:blank:]]-Ofast/ -O0 /g'
else
o_flag_munging = cat
endif
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCHv1] Fix building error with '-O2' in sysroot path
2024-05-08 10:48 [PATCHv1] Fix building error with '-O2' in sysroot path simit.ghane
@ 2024-05-08 14:47 ` Ross Burton
2024-05-15 10:58 ` simit.ghane
0 siblings, 1 reply; 3+ messages in thread
From: Ross Burton @ 2024-05-08 14:47 UTC (permalink / raw)
To: simit.ghane@lge.com
Cc: openembedded-core@lists.openembedded.org, rajesh.kanna@lge.com,
vijaya.sundaram@lge.com, dp.min@lge.com, krishnakumar.s@lge.com,
jaeyoon.jung@lge.com, martin2.jansa@lgepartner.com
Feels like we should both backport that _and_ pass —disable-O-flag-munging, as we control the compiler flags.
Ross
> On 8 May 2024, at 11:48, simit.ghane via lists.openembedded.org <simit.ghane=lge.com@lists.openembedded.org> wrote:
>
> Characters like '-O2' or '-Ofast' will be replaced by '-O1' and '-O0'
> respectively when compiling cipher and random in the filesystem
> paths as well if they happen to contain '-O2' or '-Ofast
>
> If we are cross compiling libgcrypt and sysroot contains such
> characters, we would
> get compile errors because the sysroot path has been modified.
>
> Fix this by adding blank spaces and tabs before the original matching
> pattern in the sed command.
>
> Signed-off-by: simit.ghane <simit.ghane@lge.com>
> ---
> ...ilding-error-with-O2-in-sysroot-path.patch | 52 +++++++++++++------
> 1 file changed, 36 insertions(+), 16 deletions(-)
>
> 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
> index cf9ebfb3e6..339bc9c563 100644
> --- 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
> @@ -1,31 +1,38 @@
> -From 0f66e796a8522e1043dda03b88d5f6feae839d16 Mon Sep 17 00:00:00 2001
> -From: Chen Qi <Qi.Chen@windriver.com>
> -Date: Wed, 16 Aug 2017 10:44:41 +0800
> -Subject: [PATCH] libgcrypt: fix building error with '-O2' in sysroot path
> +From 7d9817ca935a35fe6c8e2c2c7615825fa08a3a19 Mon Sep 17 00:00:00 2001
> +From: "simit.ghane" <simit.ghane@lge.com>
> +Date: Tue, 7 May 2024 14:09:03 +0530
> +Subject: [PATCHV2] Fix building error with '-O2' in sysroot path
>
> -Upstream-Status: Pending
> +Upstream-Status: Backport [https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=7d9817ca935a35fe6c8e2c2c7615825fa08a3a19]
> +
> +* cipher/Makefile.am (o_flag_munging): Tweak the sed script.
> +* random/Makefile.am (o_flag_munging): Ditto.
> +--
> +
> +Characters like '-O2' or '-Ofast' will be replaced by '-O1' and '-O0'
> +respectively when compiling cipher and random in the filesystem
> +paths as well if they happen to contain '-O2' or '-Ofast
>
> -Characters like '-O2' or '-Ofast' will be replaced by '-O1' when
> -compiling cipher.
> If we are cross compiling libgcrypt and sysroot contains such
> characters, we would
> get compile errors because the sysroot path has been modified.
>
> -Fix this by adding blank spaces before and after the original matching
> -pattern in the
> -sed command.
> +Fix this by adding blank spaces and tabs before the original matching
> +pattern in the sed command.
>
> -Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> +Signed-off-by: simit.ghane <simit.ghane@lge.com>
>
> -Rebase to 1.8.0
> -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> +ChangeLog entries added by wk
>
> +Note that there is also the configure option --disable-O-flag-munging;
> +see the README.
> ---
> cipher/Makefile.am | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> + random/Makefile.am | 2 +-
> + 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/cipher/Makefile.am b/cipher/Makefile.am
> -index c3d642b..88c883a 100644
> +index c3d642b2ac..f1c3971c40 100644
> --- a/cipher/Makefile.am
> +++ b/cipher/Makefile.am
> @@ -153,7 +153,7 @@ gost-s-box: gost-s-box.c
> @@ -33,7 +40,20 @@ index c3d642b..88c883a 100644
>
> if ENABLE_O_FLAG_MUNGING
> -o_flag_munging = sed -e 's/-O\([2-9sgz][2-9sgz]*\)/-O1/' -e 's/-Ofast/-O1/g'
> -+o_flag_munging = sed -e 's/ -O\([2-9sgz][2-9sgz]*\) / -O1 /' -e 's/ -Ofast / -O1 /g'
> ++o_flag_munging = sed -e 's/[[:blank:]]-O\([2-9sgz][2-9sgz]*\)/ -O1 /' -e 's/[[:blank:]]-Ofast/ -O1 /g'
> + else
> + o_flag_munging = cat
> + endif
> +diff --git a/random/Makefile.am b/random/Makefile.am
> +index 0c935a0595..340df38a79 100644
> +--- a/random/Makefile.am
> ++++ b/random/Makefile.am
> +@@ -56,7 +56,7 @@ jitterentropy-base.c jitterentropy.h jitterentropy-base-user.h
> +
> + # The rndjent module needs to be compiled without optimization. */
> + if ENABLE_O_FLAG_MUNGING
> +-o_flag_munging = sed -e 's/-O\([1-9sgz][1-9sgz]*\)/-O0/g' -e 's/-Ofast/-O0/g'
> ++o_flag_munging = sed -e 's/[[:blank:]]-O\([2-9sgz][2-9sgz]*\)/ -O0 /' -e 's/[[:blank:]]-Ofast/ -O0 /g'
> else
> o_flag_munging = cat
> endif
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#199114): https://lists.openembedded.org/g/openembedded-core/message/199114
> Mute This Topic: https://lists.openembedded.org/mt/105978437/6875888
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ross.burton@arm.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCHv1] Fix building error with '-O2' in sysroot path
2024-05-08 14:47 ` [OE-core] " Ross Burton
@ 2024-05-15 10:58 ` simit.ghane
0 siblings, 0 replies; 3+ messages in thread
From: simit.ghane @ 2024-05-15 10:58 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 179 bytes --]
Sorry for late reply.
It is difficult to control -O1 for cipher and -O0 for random at the same time in OE environment along with patch file.
so keeping same change as it is.
[-- Attachment #2: Type: text/html, Size: 191 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-15 10:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-08 10:48 [PATCHv1] Fix building error with '-O2' in sysroot path simit.ghane
2024-05-08 14:47 ` [OE-core] " Ross Burton
2024-05-15 10:58 ` simit.ghane
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.