HomeFreeBSD

mips: Fix build of kernel.tramp.bin after upstream merge

Description

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)

Details

Provenance
jrtc27Authored on Nov 11 2021, 6:28 PM
dimCommitted on Dec 6 2021, 4:30 PM
Parents
rG1aaf10a91c8f: Apply fix for LLVM PR51957 (Miscompilation in Botan's SHA3)
Branches
Unknown
Tags
Unknown