Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jul 2019 19:58:56 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>
Subject:   system-clang system-lld used to amd64->powerpc (32-bit) cross-build: lld with "-m" "elf32ppc_fbsd" is not enough to allow --secure-plt
Message-ID:  <9A108BFE-323D-4CC8-9065-9C167AF3FAD8@yahoo.com>

next in thread | raw e-mail | index | archive | help
Sometime at or before head -r349444 my historical src.conf variant
that I use to attempt amd64->powerpc cross-build to using system-ld
(lld) started reporting:

--- buildworld ---
make[1]: "/usr/src/Makefile.inc1" line 347: SYSTEM_COMPILER: Determined =
that CC=3Dcc matches the source tree.  Not bootstrapping a =
cross-compiler.
make[1]: "/usr/src/Makefile.inc1" line 352: SYSTEM_LINKER: Determined =
that LD=3Dld matches the source tree.  Not bootstrapping a cross-linker.
. . .
--- libc.so.7.full ---
ld: error: unknown argument: --secure-plt
cc: error: linker command failed with exit code 1 (use -v to see =
invocation)
*** [libc.so.7.full] Error code 1

The libc.so.7.full.meta file reports the CMD as (ignoring the part for =
the
huge *.pico file list):

cc -target powerpc-unknown-freebsd13.0 =
--sysroot=3D/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/powerpc.pow=
erpc/tmp =
-B/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/powerpc.powerpc/tmp/u=
sr/bin  -Wl,--secure-plt -nodefaultlibs -Wl,--version-script=3DVersion.map=
 -Wl,--no-threads   -shared -Wl,-x -Wl,--fatal-warnings =
-Wl,--warn-shared-textrel  -o libc.so.7.full -Wl,-soname,libc.so.7

Adding -### and executing that reports ( on -r349794 ):
(lines split for readability)

FreeBSD clang version 8.0.1 (branches/release_80 364487) (based on LLVM =
8.0.1)
Target: powerpc-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
 "/usr/bin/ld" \
=
"--sysroot=3D/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/powerpc.po=
werpc/tmp" \
"--eh-frame-hdr" "-Bshareable" "--enable-new-dtags" \
"-m" "elf32ppc_fbsd" \
"-o" "libc.so.7.full" \
=
"/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/powerpc.powerpc/tmp/us=
r/lib/crti.o" \
=
"/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/powerpc.powerpc/tmp/us=
r/lib/crtbeginS.o" \
=
"-L/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/powerpc.powerpc/tmp/=
usr/lib" \
"--secure-plt" \
"--version-script=3DVersion.map" "--no-threads" "-x" "--fatal-warnings" =
"--warn-shared-textrel" \
"-soname" "libc.so.7" \
=
"/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/powerpc.powerpc/tmp/us=
r/lib/crtendS.o" \
=
"/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/powerpc.powerpc/tmp/us=
r/lib/crtn.o"


Executing the full reported "/usr/bin/ld" produces:

ld: error: unknown argument: --secure-plt

So "-m" "elf32ppc_fbsd" was insufficient to enable allowing --secure-plt =
(a powerpc
32-bit specific option).


=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9A108BFE-323D-4CC8-9065-9C167AF3FAD8>