On Sat, Jun 8, 2024 at 12:46 AM Martin Jansa via
lists.openembedded.org <[email protected]>
wrote:
>
> > > +-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'
>
> I guess the 1-9 should have stayed in this one (now it no longer
> replaces -O1 with -O0) and also the "/g" got missing, so it replaced
> the first -O* on command line, but not the 2nd one which stayed -O2.
>
> To be safe you should add /g to the first sed call as well.
>
> It should be fixed upstream as well as the issue is already in the
> merged version:
> https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=blobdiff;f=random/Makefile.am;h=340df38a798997b975d81a445cbc84cb23f5ea7a;hp=0c935a05952b5f1d91ef5992ec090912a77b03d2;hb=7d9817ca935a35fe6c8e2c2c7615825fa08a3a19;hpb=75e9bcccb69a9dea67d90840bd295bbd1749cea3
>

The 1-9 part was already fixed upstream:
https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=blobdiff;f=random/Makefile.am;h=c7100ef8b896f321c9f85249184a8e4a2ca38a1e;hp=340df38a798997b975d81a445cbc84cb23f5ea7a;hb=5afadba008918d651afefb842ae123cc18454c74;hpb=3f5989014a1b7c01aced88897d878ce5105d15df

> Regards,
>
> On Sat, Jun 8, 2024 at 12:35 AM Alexandre Belloni via
> lists.openembedded.org
> <[email protected]> wrote:
> >
> > This seems to fail:
> >
> > | libtool: compile:  arm-poky-linux-gnueabi-gcc -mfpu=neon -mfloat-abi=hard 
> > -mcpu=cortex-a8 -fstack-protector-strong -O0 -D_FORTIFY_SOURCE=2 -Wformat 
> > -Wformat-security -Werror=format-security -D_TIME_BITS=64 
> > -D_FILE_OFFSET_BITS=64 
> > --sysroot=/home/pokybuild/yocto-worker/beaglebone-alt/build/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/libgcrypt/1.10.3/recipe-sysroot
> >  -DHAVE_CONFIG_H -I. -I../../libgcrypt-1.10.3/random -I.. -I../src 
> > -I../../libgcrypt-1.10.3/src -O2 -pipe -g -feliminate-unused-debug-types 
> > -fcanon-prefix-map 
> > -fmacro-prefix-map=/home/pokybuild/yocto-worker/beaglebone-alt/build/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/libgcrypt/1.10.3/libgcrypt-1.10.3=/usr/src/debug/libgcrypt/1.10.3
> >  
> > -fdebug-prefix-map=/home/pokybuild/yocto-worker/beaglebone-alt/build/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/libgcrypt/1.10.3/libgcrypt-1.10.3=/usr/src/debug/libgcrypt/1.10.3
> >  
> > -fmacro-prefix-map=/home/pokybuild/yocto-worker/beaglebone-alt/build/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/libgcrypt/1.10.3/build=/usr/src/debug/libgcrypt/1.10.3
> >  
> > -fdebug-prefix-map=/home/pokybuild/yocto-worker/beaglebone-alt/build/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/libgcrypt/1.10.3/build=/usr/src/debug/libgcrypt/1.10.3
> >  
> > -fdebug-prefix-map=/home/pokybuild/yocto-worker/beaglebone-alt/build/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/libgcrypt/1.10.3/recipe-sysroot=
> >  
> > -fmacro-prefix-map=/home/pokybuild/yocto-worker/beaglebone-alt/build/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/libgcrypt/1.10.3/recipe-sysroot=
> >  
> > -fdebug-prefix-map=/home/pokybuild/yocto-worker/beaglebone-alt/build/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/libgcrypt/1.10.3/recipe-sysroot-native=
> >  -fvisibility=hidden -fno-delete-null-pointer-checks -Wall -c 
> > ../../libgcrypt-1.10.3/random/rndjent.c  -fPIC -DPIC -o .libs/rndjent.o
> > | In file included from ../../libgcrypt-1.10.3/random/rndjent.c:99:
> > | ../../libgcrypt-1.10.3/random/jitterentropy-base.c:58:3: error: #error 
> > "The CPU Jitter random number generator must not be compiled with 
> > optimizations. See documentation. Use the compiler switch -O0 for compiling 
> > jitterentropy.c."
> > |    58 |  #error "The CPU Jitter random number generator must not be 
> > compiled with optimizations. See documentation. Use the compiler switch -O0 
> > for compiling jitterentropy.c."
> > |       |   ^~~~~
> > | make[2]: *** [Makefile:775: rndjent.lo] Error 1
> > | make[2]: Leaving directory 
> > '/home/pokybuild/yocto-worker/beaglebone-alt/build/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/libgcrypt/1.10.3/build/random'
> > | make[1]: *** [Makefile:500: all-recursive] Error 1
> > | make[1]: Leaving directory 
> > '/home/pokybuild/yocto-worker/beaglebone-alt/build/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/libgcrypt/1.10.3/build'
> > | make: *** [Makefile:432: all] Error 2
> > | ERROR: oe_runmake failed
> > | WARNING: exit code 1 from a shell command.
> > NOTE: recipe libgcrypt-1.10.3-r0: task do_compile: Failed
> >
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/106/builds/8078/steps/11/logs/stdio
> >
> >
> >
> > On 06/06/2024 16:26:41+0530, simit.ghane 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.
> > >
> > > 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.
> > >
> > > Signed-off-by: simit.ghane <[email protected]>
> > > ---
> > > v3: No change
> > >
> > >  ...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 <[email protected]>
> > > -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" <[email protected]>
> > > +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 <[email protected]>
> > > +Signed-off-by: simit.ghane <[email protected]>
> > >
> > > -Rebase to 1.8.0
> > > -Signed-off-by: Hongxu Jia <[email protected]>
> > > +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
> >
> > >
> > >
> > >
> >
> >
> > --
> > Alexandre Belloni, co-owner and COO, Bootlin
> > Embedded Linux and Kernel engineering
> > https://bootlin.com
> >
> >
> >
>
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200449): 
https://lists.openembedded.org/g/openembedded-core/message/200449
Mute This Topic: https://lists.openembedded.org/mt/106520599/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to