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

Thomas Petazzoni thomas.petazzoni at bootlin.com
Tue Aug 3 09:29:11 UTC 2021


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?

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


More information about the buildroot mailing list