]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Compile hack.c with normal CFLAGS + -shared -nostdlib.
authorjhb <jhb@FreeBSD.org>
Sun, 26 Jan 2020 14:19:08 +0000 (14:19 +0000)
committerjhb <jhb@FreeBSD.org>
Sun, 26 Jan 2020 14:19:08 +0000 (14:19 +0000)
commitce1ef8c58eed224078d4b5b31c87a687e6025fc8
treeb0b0d590c87ab69bbefb274a15371202524ad063
parent0f2aacbaf50d8981c91205ce0e9e91a77d992ac1
Compile hack.c with normal CFLAGS + -shared -nostdlib.

Originally, hack.c was compiled into a shard object with just -shared
-nostdlib.  This assumed that ${CC} did not require any additional
flags for ABIs, cross-building, etc.

When kern.post.mk was created in r89509 by reducing duplication in
kernel Makefile.<arch> files, the -shared flag was moved into a
HACK_EXTRA_FLAGS variable so that sparc64 could override it with
-Wl,-shared.  The sparc64 hack was removed in r111650, but
HACK_EXTRA_FLAGS was left in place.  Over time, we have started
support toolchains that require flags to support alternate ABIs on
MIPS and PowerPC and started (ab)using HACK_EXTRA_FLAGS to set only
those flags.

I need to fix risc-v to pass -mno-relax to the hack.c build for lld in
llvm 10, and the patches to support cross-build from non-FreeBSD hosts
need to include -target for clang in CFLAGS for hack.c.  Rather than
adding more hacks into HACK_EXTRA_FLAGS, just use the full set of
CFLAGS with hack.c.

Reviewed by: kib, arichardson
MFC after: 1 month
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D23362
sys/conf/Makefile.mips
sys/conf/Makefile.powerpc
sys/conf/kern.post.mk