Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Dec 2021 16:33:27 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d08adc0e1cb3 - stable/13 - mips: Fix build of kernel.tramp.bin after upstream merge
Message-ID:  <202112061633.1B6GXR3q087713@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=d08adc0e1cb3a66a4351222066de3d5d319606ea

commit d08adc0e1cb3a66a4351222066de3d5d319606ea
Author:     Jessica Clarke <jrtc27@jrtc27.com>
AuthorDate: 2021-11-11 18:28:24 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-12-06 16:30:10 +0000

    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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/conf/Makefile.mips b/sys/conf/Makefile.mips
index add27c1752a1..e8dd61d10a1d 100644
--- a/sys/conf/Makefile.mips
+++ b/sys/conf/Makefile.mips
@@ -57,6 +57,8 @@ TRAMP_ARCH_FLAGS?=$(ARCH_FLAGS)
 TRAMP_EXTRA_FLAGS=${EXTRA_FLAGS} ${TRAMP_ARCH_FLAGS}
 # Kernel code is always compiled with soft-float on MIPS
 TRAMP_EXTRA_FLAGS+=-msoft-float
+# No standard library available
+TRAMP_EXTRA_FLAGS+=-ffreestanding
 .if ${MACHINE_ARCH:Mmips64*} != ""
 TRAMP_ELFSIZE=64
 .else



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202112061633.1B6GXR3q087713>