Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Jul 2017 14:41:24 -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:  <EA49E31E-6F84-4A27-9047-878F6967EB51@dsl-only.net>
In-Reply-To: <3bda313e-aac0-4558-6346-2d95170d2dbc@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> <8E16AF37-4D8B-4099-B366-2BA95632ECA7@dsl-only.net> <3bda313e-aac0-4558-6346-2d95170d2dbc@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
[I show the specifics for how I normally build
powerpc64 with world32/lib32 involved. Ed Maste's
submittal also mentions "elf32ppc_fbsd". The
issue's context may be powerpc64 specific.]

On 2017-Jul-5, at 1:54 PM, Bryan Drewery <bdrewery@FreeBSD.org> wrote:

> On 7/5/17 1:35 PM, Mark Millard wrote:
>> On 2017-Jul-5, at 12:36 PM, Bryan Drewery <bdrewery@FreeBSD.org> =
wrote:
>>=20
>>> 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?
>>=20
>> 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.
>>=20
>> 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:
>>=20
>>=20
>> Author: emaste
>> Date: Fri Jun 30 16:34:17 2017
>> New Revision: 320502
>> URL:=20
>> https://svnweb.freebsd.org/changeset/base/320502
>>=20
>>=20
>> 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
>>=20
>>=20
>> Modified:
>>  head/share/mk/bsd.linker.mk
>>=20
>> 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;}'
>>=20
>>=20
>>=20
>> The actual error is from the piping through head
>> when head is missing, at least in my context.
>=20
> 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.

Note that Ed Maste's submittal mentions "elf32ppc_fbsd"
and the only context I've seen the issue is for
powerpc64 with world32/lib32 involved as well.

In my case this is with an external binutils because
the system binutils fail last I tried and the llvm
one do not work either. It is also the case that for
me the compiler is the system's clang in my normal use.

My normal powerpc64 build context in more detail, first
the script that in turn binds SRC_ENV_CONF and then the
bound file:

# more =
~/sys_build_scripts.amd64-host/make_powerpc64vtsc_nodebug_clang_altbinutil=
s-amd64-host.sh=20
kldload -n filemon && \
script =
~/sys_typescripts/typescript_make_powerpc64vtsc_nodebug_clang_altbinutils-=
amd64-host-$(date +%Y-%m-%d:%H:%M:%S) \
env __MAKE_CONF=3D"/root/src.configs/make.conf" SRCCONF=3D"/dev/null" =
SRC_ENV_CONF=3D"/root/src.configs/src.conf.powerpc64-clang_altbinutils-boo=
tstrap.amd64-host" \
WITH_META_MODE=3Dyes \
MAKEOBJDIRPREFIX=3D"/usr/obj/powerpc64vtsc_clang_altbinutils" \
make $*


# more =
/root/src.configs/src.conf.powerpc64-clang_altbinutils-bootstrap.amd64-hos=
t
TO_TYPE=3Dpowerpc64
TOOLS_TO_TYPE=3D${TO_TYPE}
VERSION_CONTEXT=3D12.0
#
KERNCONF=3DGENERIC64vtsc-NODBG
TARGET=3Dpowerpc
.if ${.MAKE.LEVEL} =3D=3D 0
TARGET_ARCH=3D${TO_TYPE}
.export TARGET_ARCH
.endif
#
WITH_CROSS_COMPILER=3D
WITHOUT_SYSTEM_COMPILER=3D
#
WITH_LIBCPLUSPLUS=3D
WITHOUT_BINUTILS_BOOTSTRAP=3D
WITH_ELFTOOLCHAIN_BOOTSTRAP=3D
WITH_CLANG_BOOTSTRAP=3D
WITH_CLANG=3D
WITH_CLANG_IS_CC=3D
WITH_CLANG_FULL=3D
WITH_CLANG_EXTRAS=3D
WITHOUT_LLD_BOOTSTRAP=3D
WITH_LLD=3D
WITHOUT_LLD_IS_LD=3D
WITH_LLDB=3D
#
WITH_BOOT=3D
WITH_LIB32=3D
#
WITHOUT_GCC_BOOTSTRAP=3D
WITHOUT_GCC=3D
WITHOUT_GCC_IS_CC=3D
WITHOUT_GNUCXX=3D
#
NO_WERROR=3D
MALLOC_PRODUCTION=3D
#
# Avoid converts between pointers to integer types with different sign =
[-Werror,-Wpointer-sign]
# and such from blocking the build.
WERROR=3D
#
WITH_REPRODUCIBLE_BUILD=3D
WITH_DEBUG_FILES=3D
#
#
# For TO (so-called "cross") stages . . .
# So-called-cross via ${TO_TYPE}-xtoolchain-gcc/${TO_TYPE}-gcc. . .
# TOOLS_TO_TYPE based on ${TO_TYPE}-xtoolchain-gcc related binutils. . .
#
CROSS_BINUTILS_PREFIX=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/
.if ${.MAKE.LEVEL} =3D=3D 0
#
# Note: The WITH_CROSS_COMPILER picks up the CROSS_BINUTILS_PREFIX
#       binding automatically.
#
XAS=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/as
XAR=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ar
XNM=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/nm
XOBJCOPY=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/objcopy
XOBJDUMP=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/objdump
XRANLIB=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ranlib
XSIZE=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/size
#NO-SUCH: XSTRINGS=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/strings
XSTRINGS=3D/usr/local/bin/${TOOLS_TO_TYPE}-freebsd-strings
.export XAS
.export XAR
.export XNM
.export XOBJCOPY
.export XOBJDUMP
.export XRANLIB
.export XSIZE
.export XSTRINGS
XLD=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ld
.export XLD
.endif



=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?EA49E31E-6F84-4A27-9047-878F6967EB51>