git: 06c24143c4af - stable/12 - Default to using lld for arm.arm, but disable fatal linker warnings

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Wed, 22 Dec 2021 10:06:44 UTC
The branch stable/12 has been updated by dim:

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

commit 06c24143c4af8a10a65abd9f310feeb05a0d14e3
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-12-22 09:51:44 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-12-22 10:01:34 +0000

    Default to using lld for arm.arm, but disable fatal linker warnings
    
    Since BFD ld 2.17.50 cannot cope with the output of clang 11 and higher,
    due to some object files getting more than 65k sections, we need to use
    lld 11 and higher instead.
    
    However, this results in warnings from lld: "lld uses blx instruction,
    no object with architecture supporting feature detected". At the moment
    we think it is safe to ignore this warning, so add a check to bsd.lib.mk
    to make them non-fatal by default for arm.arm.
---
 share/mk/bsd.lib.mk  | 3 ++-
 share/mk/src.opts.mk | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index d99360f0e2bf..69b64200e47f 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -280,7 +280,8 @@ CLEANFILES+=	${SOBJS}
 _LIBS+=		${SHLIB_NAME}
 
 SOLINKOPTS+=	-shared -Wl,-x
-.if defined(LD_FATAL_WARNINGS) && ${LD_FATAL_WARNINGS} == "no"
+.if (defined(LD_FATAL_WARNINGS) && ${LD_FATAL_WARNINGS} == "no") || \
+    (!defined(LD_FATAL_WARNINGS) && ${MACHINE_ARCH} == "arm")
 SOLINKOPTS+=	-Wl,--no-fatal-warnings
 .else
 SOLINKOPTS+=	-Wl,--fatal-warnings
diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index 4fd16579f863..2531f0d43264 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -329,8 +329,8 @@ __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND
 .else
 __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND
 .endif
-.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv6" || \
-    ${__T} == "armv7" || ${__T} == "i386" || ${__TT} == "riscv"
+.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__TT} == "arm" || \
+    ${__T} == "i386" || ${__TT} == "riscv"
 __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
 .else
 __DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD