On 2017-Apr-30, at 3:47 PM, tech-lists <tech-lists at zyxst.net> wrote:

> hi toolchain@,
> 
> I'm trying to buildworld on a raspberrypi3 HardenedBSD-12 context.
> 
> FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on
> LLVM 4.0.0)
> Target: aarch64-unknown-freebsd12.0
> Thread model: posix
> InstalledDir: /usr/bin
> 
> LLVM (http://llvm.org/):
> LLVM version 4.0.0
> Optimized build.
> Default target: aarch64-unknown-freebsd12.0
> Host CPU: (unknown)
> 
> It's failing in sys/boot/efi/boot1 with this sort of error:
> 
> /ldscript.arm64 -Wl,-Bsymbolic -shared -nostdlib -Wl,-z,relro -Wl,-z,now
> -o boot1.sym.full boot1.o self_reloc.o start.o ufs_module.o  -lstand
> /usr/bin/ld: error: /hd0/src/lib/libstand/printf.c:(.rodata+0x0): can't
> create dynamic relocation R_AARCH64_ABS64 against local symbol in
> readonly segment defined in /usr/lib/libstand.a(printf.o)
> /usr/bin/ld: error: /hd0/src/lib/libstand/printf.c:(.rodata+0x8): can't
> create dynamic relocation R_AARCH64_ABS64 against local symbol in
> readonly segment defined in /usr/lib/libstand.a(printf.o)
> 
> I've refreshed to very latest sources but get the same error. Full
> output is here:
> 
> http://www.zyxst.net/~bofh/rpi3/2017-04-29.buildworldfail.hbsd12-aarch64.txt

Your toolchain configuration is using: -Wl,-z,relro
(Its use is shown in
2017-04-29.buildworldfail.hbsd12-aarch64.txt .)

See later below for more notes about that.

But I'll also note that

2017-04-29.buildworldfail.hbsd12-aarch64.txt

shows:

cc: error: unable to execute command: Segmentation fault (core dumped)
cc: error: linker command failed due to signal (use -v to see invocation)
*** Error code 254

not just what you report above.

> I note that a very similar error involving a different efi directory was
> reported back in January:
> 
> http://freebsd.1045724.x6.nabble.com/clang-lld-4-0-0-arm64-link-failure-in-sys-boot-efi-loader-td6161866.html

This old issue was caused (at least in part) by use
of a toolchain configured to use: -Wl,-z,relro .
relro puts more stuff in read-only areas, such as
.rodata . Being in such areas limits what can be
done and overall the tool chain may not be set up
fully for respecting/handling that.

> ...but no resolution/fix. Is there anything I can do?

Use of -Wl,-z,relro is experimental at this point
as I understand, in part because of such potential
issues.

Avoiding -Wl,-z,relro likely is necessary but
may not be sufficient for your builds to complete.


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

_______________________________________________
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"

Reply via email to