From 12401698f63fd79026ce88e072d460fd5b5917ed Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 11 Dec 2018 06:45:53 +0000 Subject: [PATCH] For arm and armv6, only enable LLVM target support for arm by default, to shrink libllvm.a. This is a workaround for "relocation truncated to fit" errors with BFD ld 2.17.50 on arm and armv6, when linking executables against it. The required range extensions are not yet supported by this very old version of BFD ld. When arm and armv6 userland can be successfully linked by lld, this workaround can be removed. --- share/mk/src.opts.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index d95e2fdda7c..f5c27cf141e 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -269,6 +269,10 @@ __LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/ # Default the given TARGET's LLVM_TARGET support to the value of MK_CLANG. .if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt} __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/CLANG +# Disable other targets for arm and armv6, to work around "relocation truncated +# to fit" errors with BFD ld, since libllvm.a will get too large to link. +.elif ${__T} == "arm" || ${__T} == "armv6" +__DEFAULT_NO_OPTIONS+=LLVM_TARGET_${__llt:tu} # aarch64 needs arm for -m32 support. .elif ${__TT} == "arm64" && ${__llt} == "arm" __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_ARM/LLVM_TARGET_AARCH64 -- 2.45.0