ring
ring copied to clipboard
Building on AArch64 Linux with Clang complaining about not having fPIC
Basically, I got a same error as https://github.com/monero-project/monero/issues/1304.
Maybe -fPIC
flag is needed
https://github.com/briansmith/ring/blob/08fcf4a5b9bfa7e06863e586cef8e4f137604439/build.rs#L518
readelf -r ring-c322d96f1cad079c/out/*.o | grep GFp_armcap_P
000000000004 000f00000114 R_AARCH64_ADR_PRE 0000000000000000 GFp_armcap_P + 0
000000000010 000f0000011d R_AARCH64_LDST32_ 0000000000000000 GFp_armcap_P + 0
000000000000 000e00000113 R_AARCH64_ADR_PRE 0000000000000000 GFp_armcap_P + 0
000000000004 000e0000011d R_AARCH64_LDST32_ 0000000000000000 GFp_armcap_P + 0
readelf -r ring-e283409aa5b73913.ring.1h5en42m-cgu.1.rcgu.o | grep GFp_armcap_P
T 0000000000000000 GFp_armcap_P + 0
000000000020 05bd00000138 R_AARCH64_LD64_GO 0000000000000000 GFp_armcap_P + 0
0000000000c8 05bd00000137 R_AARCH64_ADR_GOT 0000000000000000 GFp_armcap_P + 0
0000000000cc 05bd00000138 R_AARCH64_LD64_GO 0000000000000000 GFp_armcap_P + 0
not sure what happened but this fix works for me:
https://chromium.googlesource.com/chromium/src.git/+/1ff8654cb2647b511cb32dae4ffea9f7929b1ed9
This flag is not clearly documented.
Could somebody please test this with ring 0.17.3 and report whether it is still an issue?
Closing due to inactivity, because in ring 0.17.x we've delegated the handle PIC-related compiler flag handling to cc-rs, and due to inactivity.