[Buildroot] [PATCH 1/1] package/gpsd: fix workaround for gcc bug 68485

Fabrice Fontaine fontaine.fabrice at gmail.com
Tue Aug 3 12:05:10 UTC 2021


Hello Thomas,

Le mar. 3 août 2021 à 11:29, Thomas Petazzoni
<thomas.petazzoni at 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 at 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


More information about the buildroot mailing list