All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/gpsd: fix workaround for gcc bug 68485
@ 2021-08-03  9:19 Fabrice Fontaine
  2021-08-03  9:29 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Fontaine @ 2021-08-03  9:19 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, Fabrice Fontaine

Workaround for gcc bug 68485 doesn't work anymore since bump to version
3.21 in commit 5b3e72139952e0c953c8649cca55571cec5f3836 because -O0 is
moved before -Os (probably by some obscure scons function):

/tmp/instance-7/output-1/host/bin/microblazeel-linux-gcc -o rtcm2_json.os -c --sysroot=/tmp/instance-7/output-1/host/microblazeel-buildroot-linux-uclibc/sysroot -pthread -Wall -Wcast-align -Wextra -Wimplicit-fallthrough -Wmissing-declarations -Wmissing-prototypes -Wno-missing-field-initializers -Wno-uninitialized -Wpointer-arith -Wreturn-type -Wstrict-prototypes -Wvla -O0 -Os -g0 -pthread -fPIC -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/tmp/instance-7/output-1/host/microblazeel-buildroot-linux-uclibc/sysroot/usr/include/dbus-1.0 -I/tmp/instance-7/output-1/host/microblazeel-buildroot-linux-uclibc/sysroot/usr/lib/dbus-1.0/include rtcm2_json.c
during RTL pass: reload
rtcm2_json.c: In function ‘json_rtcm2_read’:
rtcm2_json.c:267:1: internal compiler error: in gen_reg_rtx, at emit-rtl.c:1155
  267 | }
      | ^

Fixes:
 - http://autobuild.buildroot.org/results/fab33f25b08fa218af91640fdbd8c0dcf1d07228

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/gpsd/gpsd.mk | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
index 0fbb5dfa1d..df1f273ce5 100644
--- a/package/gpsd/gpsd.mk
+++ b/package/gpsd/gpsd.mk
@@ -15,9 +15,6 @@ GPSD_INSTALL_STAGING = YES
 GPSD_DEPENDENCIES = host-python3 host-scons host-pkgconf
 
 GPSD_LDFLAGS = $(TARGET_LDFLAGS)
-GPSD_CFLAGS = $(TARGET_CFLAGS)
-
-GPSD_SCONS_ENV = $(TARGET_CONFIGURE_OPTS)
 
 GPSD_SCONS_OPTS = \
 	arch=$(ARCH) \
@@ -45,7 +42,13 @@ GPSD_SCONS_OPTS += libgpsmm=no
 endif
 
 ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+# Filter out any optimisation flags to be sure that -O0 will be used
+GPSD_SCONS_ENV += $(filter-out -O%,$(TARGET_CONFIGURE_OPTS))
+GPSD_CFLAGS += $(filter-out -O%,$(TARGET_CFLAGS))
 GPSD_CFLAGS += -O0
+else
+GPSD_SCONS_ENV += $(TARGET_CONFIGURE_OPTS)
+GPSD_CFLAGS += $(TARGET_CFLAGS)
 endif
 
 # If libusb is available build it before so the package can use it
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/gpsd: fix workaround for gcc bug 68485
  2021-08-03  9:19 [Buildroot] [PATCH 1/1] package/gpsd: fix workaround for gcc bug 68485 Fabrice Fontaine
@ 2021-08-03  9:29 ` Thomas Petazzoni
  2021-08-03 12:05   ` Fabrice Fontaine
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2021-08-03  9:29 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Bernd Kuhls, Giulio Benetti, buildroot

Hello Fabrice,

Thanks for looking into this. Adding Giulio in Cc.

On Tue,  3 Aug 2021 11:19:18 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

>  GPSD_LDFLAGS = $(TARGET_LDFLAGS)
> -GPSD_CFLAGS = $(TARGET_CFLAGS)
> -
> -GPSD_SCONS_ENV = $(TARGET_CONFIGURE_OPTS)
>  
>  GPSD_SCONS_OPTS = \
>  	arch=$(ARCH) \
> @@ -45,7 +42,13 @@ GPSD_SCONS_OPTS += libgpsmm=no
>  endif
>  
>  ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
> +# Filter out any optimisation flags to be sure that -O0 will be used
> +GPSD_SCONS_ENV += $(filter-out -O%,$(TARGET_CONFIGURE_OPTS))
> +GPSD_CFLAGS += $(filter-out -O%,$(TARGET_CFLAGS))

Are you sure both are needed?

Indeed, we're doing this:

GPSD_SCONS_ENV = $(TARGET_CONFIGURE_OPTS)

GPSD_CFLAGS = ...

GPSD_SCONS_ENV += CFLAGS=$(GPSD_CFLAGS) CCFLAGS=$(GPSD_CFLAGS)

So the CFLAGS=$(GPSD_CFLAGS) should win over the CFLAGS that are
originally in $(TARGET_CONFIGURE_OPTS).

In other words, can you try to see if the simpler:

-GPSD_CFLAGS = $(TARGET_CFLAGS)

ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
GPSD_CFLAGS = $(filter-out -O%,$(TARGET_CFLAGS)) -O0
else
GPSD_CFLAGS += $(TARGET_CFLAGS)
endif

doesn't work ?

Thanks,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/gpsd: fix workaround for gcc bug 68485
  2021-08-03  9:29 ` Thomas Petazzoni
@ 2021-08-03 12:05   ` Fabrice Fontaine
  0 siblings, 0 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2021-08-03 12:05 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Bernd Kuhls, Giulio Benetti, Buildroot Mailing List

Hello Thomas,

Le mar. 3 août 2021 à 11:29, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> a écrit :
>
> Hello Fabrice,
>
> Thanks for looking into this. Adding Giulio in Cc.
>
> On Tue,  3 Aug 2021 11:19:18 +0200
> Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
>
> >  GPSD_LDFLAGS = $(TARGET_LDFLAGS)
> > -GPSD_CFLAGS = $(TARGET_CFLAGS)
> > -
> > -GPSD_SCONS_ENV = $(TARGET_CONFIGURE_OPTS)
> >
> >  GPSD_SCONS_OPTS = \
> >       arch=$(ARCH) \
> > @@ -45,7 +42,13 @@ GPSD_SCONS_OPTS += libgpsmm=no
> >  endif
> >
> >  ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
> > +# Filter out any optimisation flags to be sure that -O0 will be used
> > +GPSD_SCONS_ENV += $(filter-out -O%,$(TARGET_CONFIGURE_OPTS))
> > +GPSD_CFLAGS += $(filter-out -O%,$(TARGET_CFLAGS))
>
> Are you sure both are needed?
Yes, I'm sure, it doesn't work if I don't also filter out CFLAGS
provided by TARGET_CONFIGURE_OPTS.
But after digging a bit more into this, I found a better solution, -O0
must also be passed in CXXFLAGS.
>
> Indeed, we're doing this:
>
> GPSD_SCONS_ENV = $(TARGET_CONFIGURE_OPTS)
>
> GPSD_CFLAGS = ...
>
> GPSD_SCONS_ENV += CFLAGS=$(GPSD_CFLAGS) CCFLAGS=$(GPSD_CFLAGS)
>
> So the CFLAGS=$(GPSD_CFLAGS) should win over the CFLAGS that are
> originally in $(TARGET_CONFIGURE_OPTS).
>
> In other words, can you try to see if the simpler:
>
> -GPSD_CFLAGS = $(TARGET_CFLAGS)
>
> ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
> GPSD_CFLAGS = $(filter-out -O%,$(TARGET_CFLAGS)) -O0
> else
> GPSD_CFLAGS += $(TARGET_CFLAGS)
> endif
>
> doesn't work ?
>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Best Regards,

Fabrice
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-03 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03  9:19 [Buildroot] [PATCH 1/1] package/gpsd: fix workaround for gcc bug 68485 Fabrice Fontaine
2021-08-03  9:29 ` Thomas Petazzoni
2021-08-03 12:05   ` Fabrice Fontaine

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.