[PATCH] ltmain.sh: allow more flags at link-time

Andreas Schwab schwab@suse.de
Thu Sep 26 10:48:31 GMT 2024


On Aug 14 2024, Sam James wrote:

> In particular, this now allows some harmless diagnostic flags (especially
> useful for things like -Werror=odr), more optimization flags, and some
> Clang-specific options.

This now passes -Werror down to the linker, which breaks the binutils
build with LTO because this warning is turned into an error:

In function 'memset',
    inlined from 'ecoff_link_hash_newfunc' at ../../bfd/ecoff.c:3282:3:
/usr/include/bits/string_fortified.h:59:10: error: '__builtin_memset' writing 32 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   59 |   return __builtin___memset_chk (__dest, __ch, __len,
      |          ^
In function 'ecoff_link_hash_newfunc':
lto1: note: destination object is likely at address zero
lto1: all warnings being treated as errors
make[5]: *** [/tmp/ccqDR7oz.mk:48: /tmp/cc9vfAF0.ltrans23.ltrans.o] Error 1

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


More information about the Gdb-patches mailing list