NEW BUILD SYSTEM: Cannot build rtems-libbsd

Sebastian Huber sebastian.huber at
Wed Jul 8 06:13:55 UTC 2020

On 08/07/2020 08:10, Niteesh G. S. wrote:

> On Tue, Jul 7, 2020 at 10:42 AM Sebastian Huber 
> <sebastian.huber at 
> <mailto:sebastian.huber at>> wrote:
>     Hello,
>     the problem is that the new build system doesn't export optimization
>     flags such as -Wl,--gc-sections. The libbsd build should enable this
>     linker option unconditionally.
> Thank you. I got it fixed (temporarily) by modifying
> conf.env.CFLAGS    = cflags['cflags'] + ['-ffunction-sections'] + 
> ['-fdata-sections']
This instructs the compiler to add data elements and functions into 
separate sections. This is necessary so that the linker can carry out 
the garbage collection.
> As per Christian suggestions, I tried exporting CFLAGS with these GCC
> flags and then calling ./waf configure but they didn't work.
You have to add -Wl,--gc-sections to the linker flags.

More information about the devel mailing list