summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-02-19 21:12:59 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-02-19 21:12:59 +0000
commiteb834d9f1b7de191b4ce4787759cf8735cac6102 (patch)
treede42c43278d035cd5be3cd01789ed1336af57f39
parent1ddda2eb2400a56995c5b7baed5e07bfe8bd21d5 (diff)
Notes
-rw-r--r--Makefile.inc13
-rw-r--r--share/mk/bsd.linker.mk8
2 files changed, 7 insertions, 4 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 4f7aaae6d654..0139ca875262 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -272,9 +272,10 @@ WANT_LINKER_TYPE=
!make(test-system-compiler)
.if ${WANT_LINKER_TYPE} == "lld"
WANT_LINKER_FREEBSD_VERSION_FILE= lib/clang/include/VCSVersion.inc
-WANT_LINKER_FREEBSD_VERSION!= \
+_WANT_LINKER_FREEBSD_VERSION!= \
awk '$$2 == "LLD_REVISION" {gsub(/"/, "", $$3); print $$3}' \
${SRCDIR}/${WANT_LINKER_FREEBSD_VERSION_FILE} || echo unknown
+WANT_LINKER_FREEBSD_VERSION=${_WANT_LINKER_FREEBSD_VERSION:C/.*-(.*)/\1/}
WANT_LINKER_VERSION_FILE= lib/clang/include/lld/Common/Version.inc
WANT_LINKER_VERSION!= \
awk '$$2 == "LLD_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \
diff --git a/share/mk/bsd.linker.mk b/share/mk/bsd.linker.mk
index edeea6089de4..465e7ef921c7 100644
--- a/share/mk/bsd.linker.mk
+++ b/share/mk/bsd.linker.mk
@@ -69,9 +69,11 @@ _v= ${_ld_version:M[1-9]*.[0-9]*:[1]}
.elif ${_ld_version:[1]} == "LLD"
${X_}LINKER_TYPE= lld
_v= ${_ld_version:[2]}
-${X_}LINKER_FREEBSD_VERSION!= \
- ${${ld}} --version | \
- awk '$$3 ~ /FreeBSD/ {print substr($$4, 1, length($$4)-1)}'
+.if ${_ld_version:[3]} == "(FreeBSD"
+${X_}LINKER_FREEBSD_VERSION:= ${_ld_version:[4]:C/.*-(.*)\)/\1/}
+.else
+${X_}LINKER_FREEBSD_VERSION= 0
+.endif
.else
.warning Unknown linker from ${ld}=${${ld}}: ${_ld_version}, defaulting to bfd
${X_}LINKER_TYPE= bfd