Date: Wed, 5 Jul 2017 13:35:40 -0700 From: Mark Millard <markmi@dsl-only.net> To: Bryan Drewery <bdrewery@FreeBSD.org> Cc: Ed Maste <emaste@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org> Subject: Re: head -r320458 (e.g.) amd64 -> powerpc64 cross build's install32 during installworld: /usr/src/share/mk/bsd.linker.mk tried to use "head" when PATH provided no access (head is missing) Message-ID: <8E16AF37-4D8B-4099-B366-2BA95632ECA7@dsl-only.net> In-Reply-To: <d6971b8c-06a3-afdc-a6b0-788dbe0890f2@FreeBSD.org> References: <0E42D991-D350-4DC1-A683-CEA506167520@dsl-only.net> <AF2592BC-2409-4B73-A8A8-50C999957231@dsl-only.net> <d6971b8c-06a3-afdc-a6b0-788dbe0890f2@FreeBSD.org>
index | next in thread | previous in thread | raw e-mail
On 2017-Jul-5, at 12:36 PM, Bryan Drewery <bdrewery@FreeBSD.org> wrote:
> On 6/29/17 6:21 PM, Mark Millard wrote:
>> [I found where the tools are listed that are copied,
>> the list that is missing head.]
>>
>> . . .
>> In /usr/src/Makefile.inc1 :
>>
>> ITOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \
>> date echo egrep find grep id install ${_install-info} \
>> ln make mkdir mtree mv pwd_mkdb \
>> rm sed services_mkdb sh strip sysctl test true uname wc ${_zoneinfo} \
>> ${LOCAL_ITOOLS}
>>
>> does not list "head" as a tool.
>>
>> But I can externally add it via LOCAL_ITOOLS use.
>>
>
> This change should not be needed. We don't want to be running 'ld'
> during installworld. The changes I made around this time should already
> cover the problem. Is it still occurring on a more recent
> buildworld+installworld, without the ITOOLS change?
ld was still in use last I checked. I've been using LOCAL_ITOOLS
to avoid the problem for powerpc64's world32 activity where the
problem was happening for me.
See Ed Maste's -r320502 check in which I expect is a alternate
workaround for the lack of "head" in that I get the same message
that is being avoided unless I cause "head" to be in the ITOOLS:
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;}'
The actual error is from the piping through head
when head is missing, at least in my context.
===
Mark Millard
markmi at dsl-only.net
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8E16AF37-4D8B-4099-B366-2BA95632ECA7>
