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)
Bryan Drewery
bdrewery at FreeBSD.org
Wed Jul 5 20:54:28 UTC 2017
On 7/5/17 1:35 PM, Mark Millard wrote:
> On 2017-Jul-5, at 12:36 PM, Bryan Drewery <bdrewery at 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.
Right, neither that commit nor adding head to [LOCAL_]ITOOLS should be
needed. I wasn't able to recreate any of the problems when I tried
last. I will look again.
--
Regards,
Bryan Drewery
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-toolchain/attachments/20170705/5e9f9ee2/attachment.sig>
More information about the freebsd-toolchain
mailing list