svn commit: r364807 - in head: share/mk sys/conf

Alex Richardson arichardson at FreeBSD.org
Wed Aug 26 09:19:45 UTC 2020


Author: arichardson
Date: Wed Aug 26 09:19:44 2020
New Revision: 364807
URL: https://svnweb.freebsd.org/changeset/base/364807

Log:
  Fix builds that set LD=ld.lld after r364761
  
  When using relative paths for the linker we have to transform the name
  since clang does not like -fuse-ld=ld.lld and instead requires -fuse-ld=lld
  (the same also applies for ld.bfd).

Modified:
  head/share/mk/bsd.sys.mk
  head/sys/conf/kern.mk

Modified: head/share/mk/bsd.sys.mk
==============================================================================
--- head/share/mk/bsd.sys.mk	Wed Aug 26 07:29:17 2020	(r364806)
+++ head/share/mk/bsd.sys.mk	Wed Aug 26 09:19:44 2020	(r364807)
@@ -289,7 +289,8 @@ CFLAGS+=	ERROR-tried-to-rebuild-during-make-install
 # 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"
-LDFLAGS+=	-fuse-ld=${LD:[1]}
+# Note: Clang does not like relative paths in -fuse-ld so we map ld.lld -> lld.
+LDFLAGS+=	-fuse-ld=${LD:[1]:S/^ld.//1W}
 .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.

Modified: head/sys/conf/kern.mk
==============================================================================
--- head/sys/conf/kern.mk	Wed Aug 26 07:29:17 2020	(r364806)
+++ head/sys/conf/kern.mk	Wed Aug 26 09:19:44 2020	(r364807)
@@ -278,7 +278,8 @@ CFLAGS+=        -std=${CSTD}
 # Note: unlike bsd.sys.mk we can't use LDFLAGS here since that is used for the
 # flags required when linking the kernel. We don't need those flags when
 # building the vdsos. However, we do need -fuse-ld, so use ${CCLDFLAGS} instead.
-CCLDFLAGS+=	-fuse-ld=${LD:[1]}
+# Note: Clang does not like relative paths in -fuse-ld so we map ld.lld -> lld.
+CCLDFLAGS+=	-fuse-ld=${LD:[1]:S/^ld.//1W}
 .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.


More information about the svn-src-head mailing list