]> git.ipfire.org Git - thirdparty/glibc.git/commit
stdlib: tests: don't double-define _FORTIFY_SOURCE
authorSam James <sam@gentoo.org>
Fri, 3 Feb 2023 04:00:31 +0000 (23:00 -0500)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Fri, 3 Feb 2023 04:00:58 +0000 (23:00 -0500)
commit35bcb08eaa953c9b8bef6ab2486dc4361e1f26c0
tree50ccb688a2a737d63c354a9c42c842aa0fe58755
parent83d49a53aab1c8e191c007bc986c4d696bc95570
stdlib: tests: don't double-define _FORTIFY_SOURCE

If using -D_FORITFY_SOURCE=3 (in my case, I've patched GCC to add
=3 instead of =2 (we've done =2 for years in Gentoo)), building
glibc tests will fail on testmb like:
```
<command-line>: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>: note: this is the location of the previous definition
cc1: all warnings being treated as errors
make[2]: *** [../o-iterator.mk:9: /var/tmp/portage/sys-libs/glibc-2.36/work/build-x86-x86_64-pc-linux-gnu-nptl/stdlib/testmb.o] Error 1
make[2]: *** Waiting for unfinished jobs....
```

It's just because we're always setting -D_FORTIFY_SOURCE=2
rather than unsetting it first. If F_S is already 2, it's harmless,
but if it's another value (say, 1, or 3), the compiler will bawk.

(I'm not aware of a reason this couldn't be tested with =3,
but the toolchain support is limited for that (too new), and we want
to run the tests everywhere possible.)

Signed-off-by: Sam James <sam@gentoo.org>
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
stdlib/Makefile