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

Details

Provenance
jrtc27Authored on Nov 11 2021, 6:28 PM
dimCommitted on Nov 13 2021, 8:52 PM
Parents
rG397a8ba05313: Apply fix for LLVM PR51957 (Miscompilation in Botan's SHA3)
Branches
Unknown
Tags
Unknown