base/gcc (from ports/head -r424540) lookups do not match base/binutils 's /usr/powerpc64-freebsd/bin/ld or /usr/bin/ld (ld example)

Mark Millard markmi at dsl-only.net
Wed Nov 9 12:19:40 UTC 2016


The gcc (and cc) from base/gcc 's freebsd-gcc-5.4.0.txz for powerpc64 (via cross builds) by default can not find ld from either the system ( /usr/bin/ld ) or from base/binutils 's FreeBSD-binutils-2.25.1_3,1.txz expanded content :

> # cc main.c
> collect2: fatal error: cannot find 'ld'
> compilation terminated.

Before showing truss output that reports for where ld is searched for: here is were it actually is (along with some other files that match the pattern that I used):

> # find / -name "*ld" -print | grep "[/-]ld$"
> /usr/src/contrib/netbsd-tests/usr.bin/ld
> /usr/src/contrib/binutils/ld
> /usr/src/gnu/usr.bin/binutils/ld
> /usr/bin/ld
> /usr/ports/devel/bcc/files/patch-ld
> /usr/powerpc64-freebsd/bin/ld

(The "env ABI=FreeBSD:12:powerpc64 pkg-static add FreeBSD-binutils-2.25.1_3,1.txz" generated that last line's file.)

The "truss -f output cc main.c" output shows none of those paths being involved. It does show a stat for:

> /usr/bin/powerpc64-portbld-freebsd12.0-powerpc64-freebsd-ld

and another for:

> /bin/powerpc64-portbld-freebsd12.0-powerpc64-freebsd-ld

among others. (ld is not the only thing with such a naming convention for what is before the tool's base name.) None of the paths end in "/ld" : all end in "-ld". None of the lookups are directly in /usr either: if /usr is involved in the path then so is at least one subdirectory.

The truss "ld" lookup reports are included in the output below, they are all not-found failures:

> # truss -f cc main.c 2>&1 | grep '[/-]ld"' 
>  2873: stat("/usr/libexec/gcc/powerpc64-portbld-freebsd12.0/5.4.0/real-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/libexec/gcc/powerpc64-portbld-freebsd12.0/5.4.0/real-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/libexec/gcc/powerpc64-portbld-freebsd12.0/real-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/lib/gcc/powerpc64-portbld-freebsd12.0/5.4.0/real-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/lib/gcc/powerpc64-portbld-freebsd12.0/real-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/libexec/gcc/powerpc64-portbld-freebsd12.0/5.4.0/collect-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/libexec/gcc/powerpc64-portbld-freebsd12.0/5.4.0/collect-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/libexec/gcc/powerpc64-portbld-freebsd12.0/collect-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/lib/gcc/powerpc64-portbld-freebsd12.0/5.4.0/collect-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/lib/gcc/powerpc64-portbld-freebsd12.0/collect-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/libexec/gcc/powerpc64-portbld-freebsd12.0/5.4.0/powerpc64-freebsd-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/libexec/gcc/powerpc64-portbld-freebsd12.0/5.4.0/powerpc64-freebsd-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/libexec/gcc/powerpc64-portbld-freebsd12.0/powerpc64-freebsd-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/lib/gcc/powerpc64-portbld-freebsd12.0/5.4.0/powerpc64-freebsd-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/lib/gcc/powerpc64-portbld-freebsd12.0/powerpc64-freebsd-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/sbin/powerpc64-portbld-freebsd12.0-powerpc64-freebsd-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/bin/powerpc64-portbld-freebsd12.0-powerpc64-freebsd-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/sbin/powerpc64-portbld-freebsd12.0-powerpc64-freebsd-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/bin/powerpc64-portbld-freebsd12.0-powerpc64-freebsd-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/local/sbin/powerpc64-portbld-freebsd12.0-powerpc64-freebsd-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/usr/local/bin/powerpc64-portbld-freebsd12.0-powerpc64-freebsd-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'
>  2873: stat("/home/markmi/bin/powerpc64-portbld-freebsd12.0-powerpc64-freebsd-ld",0xffffffffffffd2f8) ERR#2 'No such file or directory'



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



More information about the freebsd-toolchain mailing list