Re: [bsd.linker.mk] line 42: Unable to determine linker type from LD=ld

From: Bryan Drewery <bdrewery_at_FreeBSD.org>
Date: Fri, 23 Jun 2017 09:33:51 -0700
On 6/23/2017 9:31 AM, Bryan Drewery wrote:
> On 6/23/2017 8:45 AM, Bryan Drewery wrote:
>> On 6/23/2017 7:19 AM, Boris Samorodov wrote:
>>> Hi All, Bryan!
>>>
>>> Since bsd.linker.mk introduction I can't manage to create
>>> FreeBSD base packages. The process stops at the very beginning:
>>> -----
>>> --- packages ---
>>> --- packages ---
>>> make -C /usr/src PKG_VERSION=12.0.s20170623140202 real-packages
>>> --- real-packages ---
>>> --- stage-packages ---
>>> mkdir -p /tmp/install.DQDhLPed
>>> progs=$(for prog in [ awk cap_mkdb cat chflags chmod chown cmp cp  date
>>> echo egrep find grep id install   ln make mkdir mtree mv pwd_mkdb  rm
>>> sed services_mkdb sh strip sysctl test true uname wc zic tzsetup
>>> makewhatis; do  if progpath=
>>> `which $prog`; then  echo $progpath;  else  echo "Required tool $prog
>>> not found in PATH." >&2;  exit 1;  fi;  done);  libs=$(ldd -f "%o %p\n"
>>> -f "%o %p\n" $progs 2>/dev/null | sort -u |  while read line; do  $line;
>>>  if [ "$2 $3" != "not
>>> found" ]; then  echo $2;  else  echo "Required library $1 not found."
>>>> &2;  exit 1;  fi;  done);  cp $libs $progs /tmp/install.DQDhLPed
>>> cp -R ${PATH_LOCALE:-"/usr/share/locale"} /tmp/install.DQDhLPed/locale
>>> mkdir -p /usr/obj/usr/src/amd64.amd64/worldstage/
>>> echo "#mtree 2.0" > /usr/obj/usr/src/amd64.amd64/worldstage//METALOG
>>> cd /usr/src; COMPILER_VERSION=40000  COMPILER_FEATURES=c++11
>>> COMPILER_TYPE=clang  COMPILER_FREEBSD_VERSION=1200006
>>> MAKEOBJDIRPREFIX=/usr/obj  MACHINE_ARCH=amd64  MACHINE=amd64  CPUTYPE=
>>> CC="cc -target x86_64-unknown-freebsd12.0 --sysroo
>>> t=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin" CXX="c++  -target
>>> x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tmp
>>> -B/usr/obj/usr/src/tmp/usr/bin"  CPP="cpp -target
>>> x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tm
>>> p -B/usr/obj/usr/src/tmp/usr/bin"  AS="as" AR="ar" LD="ld" LLVM_LINK=""
>>> NM=nm OBJCOPY="objcopy"  RANLIB=ranlib STRINGS=  SIZE="size"
>>> PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/lega
>>> cy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/tmp/install.DQDhLPed
>>>  LD_LIBRARY_PATH=/tmp/install.DQDhLPed
>>> PATH_LOCALE=/tmp/install.DQDhLPed/locale make -f Makefile.inc1
>>> INSTALL="install -U -M /usr/obj/usr/src/amd64
>>> .amd64/worldstage//METALOG -D /usr/obj/usr/src/amd64.amd64/worldstage"
>>> MTREE_CMD="mtree -W" __MAKE_SHELL=/tmp/install.DQDhLPed/sh -DNO_ROOT
>>> METALOG=/usr/obj/usr/src/amd64.amd64/worldstage//METALOG restage;
>>> COMPILER_VERSION=40000  COMPIL
>>> ER_FEATURES=c++11  COMPILER_TYPE=clang  COMPILER_FREEBSD_VERSION=1200006
>>> MAKEOBJDIRPREFIX=/usr/obj  MACHINE_ARCH=amd64  MACHINE=amd64  CPUTYPE=
>>> CC="cc -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tmp
>>> -B/usr/obj/usr/src/t
>>> mp/usr/bin" CXX="c++  -target x86_64-unknown-freebsd12.0
>>> --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin"  CPP="cpp
>>> -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tmp
>>> -B/usr/obj/usr/src/tmp/usr/bin"  AS="as"
>>> AR="ar" LD="ld" LLVM_LINK=""  NM=nm OBJCOPY="objcopy"  RANLIB=ranlib
>>> STRINGS=  SIZE="size"
>>> PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/o
>>> bj/usr/src/tmp/usr/bin:/tmp/install.DQDhLPed
>>> LD_LIBRARY_PATH=/tmp/install.DQDhLPed
>>> PATH_LOCALE=/tmp/install.DQDhLPed/locale rm -rf /tmp/install.DQDhLPed
>>> sh: head: not found
>>> make[6]: "/usr/src/share/mk/bsd.linker.mk" line 42: Unable to determine
>>> linker type from LD=ld
>>> *** Error code 1
>>>
>>> Stop.
>>> -----
>>>
>>
>> This should be fixd by r320249.  Can you try again?
>>
> 
> Sorry no that did not fix 'make packages'.
> 
> Interestingly this seems to be broken for CC already if SYSTEM_COMPILER
> is disabled.
> 
>> ccache: error: Could not find compiler "cc" in PATH
>> bmake[6]: "/root/git/freebsd/share/mk/bsd.compiler.mk" line 145: Unable to determine compiler type for CC=/usr/local/bin/ccache cc -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/root/git/freebsd/tmp -B/usr/obj/root/git/freebsd/tmp/usr/bin.  Consider setting COMPILER_TYPE.
>> *** Error code 1
>>
>> Stop.
> 
> I'll fix both.
> 
> 
> 

I spoke too soon, the above CC error is a contrived example.  You would
have to 'buildworld' on 1 system and 'packages' on a separate one to hit
it, and have SYSTEM_COMPILER logic kickin on the 'buildworld' system.
Like PR 212877.

-- 
Regards,
Bryan Drewery


Received on Fri Jun 23 2017 - 14:34:02 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:12 UTC