Skip site navigation (1)Skip section navigation (2)
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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.]
>>=20
>> . . .
>> In /usr/src/Makefile.inc1 :
>>=20
>> ITOOLS=3D [ 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}
>>=20
>> does not list "head" as a tool.
>>=20
>> But I can externally add it via LOCAL_ITOOLS use.
>>=20
>=20
> 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:=20
https://svnweb.freebsd.org/changeset/base/320502


Log:
  bsd.linker.mk: add band-aid for linker invocation failure
 =20
  In some cases bsd.linker.mk reports an error like:
 =20
    make[4]: ".../share/mk/bsd.linker.mk" line 56:
    Unknown linker from LD=3Dld -m elf32ppc_fbsd:"
 =20
  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.
 =20
  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.
 =20
  Tested by:	swills
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:=09
https://reviews.freebsd.org/D11424


Modified:
  head/share/mk/bsd.linker.mk

Modified: head/share/mk/bsd.linker.mk
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- 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}=3D	${${var}.${${X_}_ld_hash}}
=20
 .if ${ld} =3D=3D "LD" || (${ld} =3D=3D "XLD" && ${XLD} !=3D ${LD})
 .if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION)
-_ld_version!=3D	${${ld}} --version 2>/dev/null | head -n 1 || =
echo none
+_ld_version!=3D	(${${ld}} --version || echo none) | head -n 1
 .if ${_ld_version} =3D=3D "none"
-.error Unable to determine linker type from ${ld}=3D${${ld}}
+.warning Unable to determine linker type from ${ld}=3D${${ld}}
 .endif
 .if ${_ld_version:[1..2]} =3D=3D "GNU ld"
 ${X_}LINKER_TYPE=3D	bfd
@@ -58,7 +58,9 @@ _v=3D	${_ld_version:M[1-9].[0-9]*:[1]}
 ${X_}LINKER_TYPE=3D	lld
 _v=3D	${_ld_version:[2]}
 .else
-.error Unknown linker from ${ld}=3D${${ld}}: ${_ld_version}
+.warning Unknown linker from ${ld}=3D${${ld}}: ${_ld_version}, =
defaulting to bfd
+${X_}LINKER_TYPE=3D	bfd
+_v=3D	2.17.50
 .endif
 ${X_}LINKER_VERSION!=3D	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.

=3D=3D=3D
Mark Millard
markmi at dsl-only.net





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8E16AF37-4D8B-4099-B366-2BA95632ECA7>