In Ubuntu, GCC has been modified to define _FORTIFY_SOURCE in the preprocessor driver, resulting in failures to build glibc, with the following error (with --disable-werror): syslog.c: In function ‘__vsyslog_internal’: syslog.c:95:30: error: inlining failed in call to ‘always_inline’ ‘syslog’: function not inlinable 95 | ldbl_strong_alias (__syslog, syslog) We're shipping a patch to adress this in 2.39, I still need to rebase it and clean it up: https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/glibc/tree/debian/patches/ubuntu/fix-fortify-source.patch
You could add a flag _DISTRO_EVADE_FORTIFY_SOURCE, similar to bug 31624. Then no glibc patching will be required.
Or we could *not* use -Wp,-U_FORTIFY_SOURCE ? I couldn't find any rationale for it in the first place.
(In reply to Simon Chopin from comment #2) > Or we could *not* use -Wp,-U_FORTIFY_SOURCE ? I couldn't find any rationale > for it in the first place. It's needed to avoid duplicate function bodies. See: [PATCH 00/11] Build getdomainname, gethostname, syslog with fortification <https://inbox.sourceware.org/libc-alpha/cover.1707491940.git.fweimer@redhat.com/>
(In reply to Florian Weimer from comment #3) > (In reply to Simon Chopin from comment #2) > > Or we could *not* use -Wp,-U_FORTIFY_SOURCE ? I couldn't find any rationale > > for it in the first place. > > It's needed to avoid duplicate function bodies. See: > > [PATCH 00/11] Build getdomainname, gethostname, syslog with fortification > <https://inbox.sourceware.org/libc-alpha/cover.1707491940.git.fweimer@redhat. > com/> Why do we need to use -Wp instead of just -U? It seems that -Wp does not play nice if compiler defaults to define _FORTIFY_SOURCE.
If -U works, we can switch to that. The use of -Wp goes back to CFLAGS settings which needed to be compatible with GCJ, where -D had a different meaning. Hence, -Wp,-D_FORTIFY_SOURCE=2 came into being, and it has been carried forward ever since.