]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
mips: Fix build of kernel.tramp.bin after upstream merge
authorJessica Clarke <jrtc27@jrtc27.com>
Thu, 11 Nov 2021 18:28:24 +0000 (19:28 +0100)
committerDimitry Andric <dim@FreeBSD.org>
Mon, 6 Dec 2021 16:30:10 +0000 (17:30 +0100)
commitd08adc0e1cb3a66a4351222066de3d5d319606ea
tree345962d4daf2aa42e5d7b339094813ccab04a3fe
parent1aaf10a91c8f8e225c71c32d5b7d507fb1f4bf9d
mips: Fix build of kernel.tramp.bin after upstream merge

Since the upstream merge we end up with the compiler generating calls to
memcpy (and it appears upstream LLVM does too, so this will probably
also be a problem upstream when the LLVM 13 import is finished). Like
the kernel we should just compile this file with -ffreestanding to avoid
such surprises.

Note that elf_trampoline.c does actually provide a memcpy, but it's
static. That's a bit weird, and means by the time the memcpy calls are
generated by the compiler the explicit ones have already been inlined
and the function itself GC'ed, but since using -ffreestanding is the
right thing to do for this kind of code anyway, that doesn't actually
matter.

Obtained from: https://github.com/CTSRD-CHERI/cheribsd/commit/219ddb6293c

(cherry picked from commit a2fa290024e73107a214e37c257ce93a3f131a41)
sys/conf/Makefile.mips