From owner-svn-src-head@freebsd.org Tue Sep 29 22:30:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB2B43F28B0; Tue, 29 Sep 2020 22:30:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Dbq5wXbz4M61; Tue, 29 Sep 2020 22:30:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE7A515E64; Tue, 29 Sep 2020 22:30:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TMUFcx053592; Tue, 29 Sep 2020 22:30:15 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TMUFq5053591; Tue, 29 Sep 2020 22:30:15 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202009292230.08TMUFq5053591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 29 Sep 2020 22:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366270 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 366270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 22:30:16 -0000 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.