Date: Tue, 29 Sep 2020 22:30:15 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366270 - head/share/mk Message-ID: <202009292230.08TMUFq5053591@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brooks Date: Tue Sep 29 22:30:15 2020 New Revision: 366270 URL: https://svnweb.freebsd.org/changeset/base/366270 Log: Prefer --ld-path=/path/to/ld on clang >= 12 Clang 12 warns about passing a path to -fuse-ld and -Werror makes that an error preventing building world without this change. Reviewed by: arichardson, emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26591 Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Sep 29 21:51:32 2020 (r366269) +++ head/share/mk/bsd.sys.mk Tue Sep 29 22:30:15 2020 (r366270) @@ -296,10 +296,13 @@ CFLAGS+= ERROR-tried-to-rebuild-during-make-install # Please keep this if in sync with kern.mk .if ${LD} != "ld" && (${CC:[1]:H} != ${LD:[1]:H} || ${LD:[1]:T} != "ld") # Add -fuse-ld=${LD} if $LD is in a different directory or not called "ld". -# Note: Clang 12+ will prefer --ld-path= over -fuse-ld=. .if ${COMPILER_TYPE} == "clang" +.if ${COMPILER_VERSION} >= 120000 +LDFLAGS+= --ld-path=${LD:[1]:S/^ld.//1W} +.else # Note: Clang does not like relative paths in -fuse-ld so we map ld.lld -> lld. LDFLAGS+= -fuse-ld=${LD:[1]:S/^ld.//1W} +.endif .else # GCC does not support an absolute path for -fuse-ld so we just print this # warning instead and let the user add the required symlinks.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009292230.08TMUFq5053591>