Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jul 2021 15:10:41 GMT
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f8147dad44f1 - main - bsd.linker.mk: Detect LLD when built with PACKAGE_VENDOR
Message-ID:  <202107201510.16KFAfG6070254@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by arichardson:

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

commit f8147dad44f1036160a413bb00b4e8b41f7a4a84
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2021-07-20 15:04:56 +0000
Commit:     Alex Richardson <arichardson@FreeBSD.org>
CommitDate: 2021-07-20 15:10:22 +0000

    bsd.linker.mk: Detect LLD when built with PACKAGE_VENDOR
    
    Recent versions of homebrew's LLD are built with PACKAGE_VENDOR (since
    https://github.com/Homebrew/homebrew-core/commit/e7c972b6062af753e564104e58d1fa20c0d1ad7a).
    This means that the -v output is now
    `Homebrew LLD 12.0.1 (compatible with GNU linkers)` and bsd.linker.mk no
    longer detects it as LLD since it only checks whether the first word is
    LLD. This change allow me to build on macOS again and should unbreak the
    GitHub actions CI.
    
    Reviewed By:    imp, uqs
    MFC after:      3 days
    Differential Revision: https://reviews.freebsd.org/D31224
---
 share/mk/bsd.linker.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/share/mk/bsd.linker.mk b/share/mk/bsd.linker.mk
index 344a5b937380..7209d7f173ae 100644
--- a/share/mk/bsd.linker.mk
+++ b/share/mk/bsd.linker.mk
@@ -69,7 +69,9 @@ _ld_version!=	(${${ld}} -v 2>&1 || echo none) | sed -n 1p
 ${X_}LINKER_TYPE=	bfd
 ${X_}LINKER_FREEBSD_VERSION=	0
 _v=	${_ld_version:M[1-9]*.[0-9]*:[1]}
-.elif ${_ld_version:[1]} == "LLD"
+.elif ${_ld_version:MLLD}
+# Strip any leading PACKAGE_VENDOR string (e.g. "Homebrew")
+_ld_version:=${_ld_version:[*]:C/^.* LLD /LLD /:[@]}
 ${X_}LINKER_TYPE=	lld
 _v=	${_ld_version:[2]}
 .if ${_ld_version:[3]} == "(FreeBSD"



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