On 5/18/23 11:22, Peter Maydell wrote:
On Wed, 17 May 2023 at 21:32, Richard Henderson
<richard.hender...@linaro.org> wrote:
Failures:
https://gitlab.com/qemu-project/qemu/-/jobs/4304958508#L2551
/usr/lib/gcc/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/lib/../lib/libc.a(init-first.o):
in function `__libc_init_first':
(.text+0x10): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against
symbol
`__environ' defined in .bss section in
/usr/lib/gcc/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/lib/../lib/libc.a(environ.o)
/usr/bin/ld: (.text+0x10): warning: too many GOT entries for -fpic, please
recompile with
-fPIC
This is really a bug in the host libc (more specifically, how
the libc.a was compiled), isn't it? We've only previously seen
it when trying to build the system emulation binaries statically,
but it looks like it's finally reared its head for the usermode
binaries here. IIRC it basically boils down to how big the final
executable is and whether you get unlucky with what gets linked
in and what order such that a reloc in libc ends up wanting to
access a GOT table entry that gets assigned too high an index.
The patches should introduce no code changes AFAICT, but I noticed that
they added a '-no-pie' flag that was not there previously in the static
compilation case. Maybe that's the source of the breakage (if so it's
arguably a GCC driver bug, but compiler command lines are hard).
Side note: why are we linking against -lstdc++ ???
A remnant of libvixl that was never deleted:
emulator = executable(exe_name, exe['sources'], ...
link_language: link_language, ...)
Paolo