]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC 357145: Compile hack.c with normal CFLAGS + -shared -nostdlib.
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 7 May 2020 18:47:54 +0000 (18:47 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 7 May 2020 18:47:54 +0000 (18:47 +0000)
commit8a0ca1b0f444cb1ae31db04f19fa6d8acda74e38
treeb2392dc0c2ecbe08fbceb9ccdec46119b04563ed
parent3c80ee8acde45b4424a89524011d0ce853ad5919
MFC 357145: 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.
sys/conf/Makefile.mips
sys/conf/kern.post.mk