From owner-svn-src-head@freebsd.org Fri Jun 30 16:34:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E34AD958E9; Fri, 30 Jun 2017 16:34:18 +0000 (UTC) (envelope-from emaste@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 mx1.freebsd.org (Postfix) with ESMTPS id 3D081749F9; Fri, 30 Jun 2017 16:34:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5UGYH8O004259; Fri, 30 Jun 2017 16:34:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5UGYHgF004258; Fri, 30 Jun 2017 16:34:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706301634.v5UGYHgF004258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 30 Jun 2017 16:34:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320502 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 320502 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.23 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: Fri, 30 Jun 2017 16:34:18 -0000 Author: emaste Date: Fri Jun 30 16:34:17 2017 New Revision: 320502 URL: https://svnweb.freebsd.org/changeset/base/320502 Log: bsd.linker.mk: add band-aid for linker invocation failure In some cases bsd.linker.mk reports an error like: make[4]: ".../share/mk/bsd.linker.mk" line 56: Unknown linker from LD=ld -m elf32ppc_fbsd:" For now change this to a .warning, and then assume GNU ld 2.17.50. At present the linker type detection is used only for enabling build-id, and we can carry on without it when type detection fails. Also, show errors from ${LD} --version to aid in failure diagnosis. Successful invocations of ${LD} --version produce no output on stderr so this will not create any spam in non-failing builds. Tested by: swills Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11424 Modified: head/share/mk/bsd.linker.mk Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Fri Jun 30 16:16:21 2017 (r320501) +++ head/share/mk/bsd.linker.mk Fri Jun 30 16:34:17 2017 (r320502) @@ -47,9 +47,9 @@ ${var}= ${${var}.${${X_}_ld_hash}} .if ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD}) .if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION) -_ld_version!= ${${ld}} --version 2>/dev/null | head -n 1 || echo none +_ld_version!= (${${ld}} --version || echo none) | head -n 1 .if ${_ld_version} == "none" -.error Unable to determine linker type from ${ld}=${${ld}} +.warning Unable to determine linker type from ${ld}=${${ld}} .endif .if ${_ld_version:[1..2]} == "GNU ld" ${X_}LINKER_TYPE= bfd @@ -58,7 +58,9 @@ _v= ${_ld_version:M[1-9].[0-9]*:[1]} ${X_}LINKER_TYPE= lld _v= ${_ld_version:[2]} .else -.error Unknown linker from ${ld}=${${ld}}: ${_ld_version} +.warning Unknown linker from ${ld}=${${ld}}: ${_ld_version}, defaulting to bfd +${X_}LINKER_TYPE= bfd +_v= 2.17.50 .endif ${X_}LINKER_VERSION!= echo "${_v:M[1-9].[0-9]*}" | \ awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}'