JDK14 cross-compile to arm64 fails with linking error
Andrew Haley
aph at redhat.com
Tue Oct 20 09:26:39 UTC 2020
Hi,
On 19/10/2020 03:53, Choe, Jiwon wrote:
> I'm trying to cross-compile JDK 14 to target aarch64-linux-gnu, from a
> 64-bit x86 Linux (Ubuntu 18.04).
>
> I followed the steps described in the documentation (
> https://hg.openjdk.java.net/jdk/jdk14/raw-file/tip/doc/building.html#creating-and-using-sysroots-with-qemu-deboostrap),
> but when I try to make the target image, I get the following error:
>
> /usr/lib/gcc-cross/aarch64-linux-gnu/7/../../../../aarch64-linux-gnu/bin/ld:
> /opt/sysroot/usr/lib/aarch64-linux-gnu/libm.a(e_pow.o): relocation
> R_AARCH64_ADR_PREL_PG_HI21 against symbol `__stack_chk_guard@@GLIBC_2.17'
> which may bind externally can not be used when making a shared object;
> recompile with -fPIC
> /usr/lib/gcc-cross/aarch64-linux-gnu/7/../../../../aarch64-linux-gnu/bin/ld:
> /opt/sysroot/usr/lib/aarch64-linux-gnu/libm.a(e_pow.o)(.text+0xdc):
^ This looks wrong. You should be linking with /usr/whatever/libm.so, not
/usr/whatever/libm.a. Is libm.so missing from that directory?
--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the build-dev
mailing list