On 5/18/23 02: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.
Still, given the prevalence of libc that's been compiled -fpic
rather than -fPIC, we probably need to deal with it somehow.
Yes, this looks like the same --static-pie issue we saw before.
I thought we'd been working around this in CI by testing --static --disable-pie. Given
Paolo moves --static handling to meson in this patch set, I assume that's the culprit.
Side note: why are we linking against -lstdc++ ???
Missed c++ purging?
r~