]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r359702, r359774: enforce -fno-common for userland/kernel src builds
authorKyle Evans <kevans@FreeBSD.org>
Mon, 27 Apr 2020 19:49:35 +0000 (19:49 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Mon, 27 Apr 2020 19:49:35 +0000 (19:49 +0000)
commit21bc65cb6a23fd1d3f68800f8b4f67b52e02333b
treead528aa7ea2c9e0f39123e0b9aaa1b34a5887acf
parent70794a3d02beedbe973c45913c84acd6a8afd889
MFC r359702, r359774: enforce -fno-common for userland/kernel src builds

r359702:
Add -fno-common to all userland/kernel src builds

-fno-common will become the default in GCC10/LLVM11. Plenty of work has been
put in to make sure our world builds are no -fno-common clean, so let's slap
the build with this until it becomes the compiler default to ensure we don't
regress.

At this time, we will not be enforcing -fno-common on ports builds. I
suspect most ports will be or quickly become -fno-common clean as they're
naturally built against compilers that default to it, so this will hopefully
become a non-issue in due time. The exception to this, which is actually the
status quo, is that kmods built from ports will continue to build with
-fno-common.

As of the time of writing, I intend to also make stable/12 -fno-common
clean. What's been done will be MFC'd to stable/11 if it's easily applicable
and/or not much work to massage it into being functional, but I anticipate
adding -fcommon to stable/11 builds to maintain its ability to be built with
newer compilers for the rest of its lifetime instead of putting in a third
branch's worth of effort.

r359774:
userland build: replace -fno-common with ${CFCOMMONFLAG}

This change allows any downstream or otherwise consumer to easily override
the new -fno-common default on a temporary basis without having to hack into
src.sys.mk, and also makes it a bit easier to search for these specific
cases where -fno-common must be overridden with -fcommon or else the build
will fail.

The gdb build, the only program requiring -fcommon on head/, is switched
over as an example usage. It will need it on all branches, so this does not
harm future mergability.
gnu/usr.bin/gdb/Makefile.inc
share/mk/src.sys.mk
sys/conf/kern.pre.mk
sys/conf/kmod.mk