Closed Alexander-- closed 8 years ago
Apparently, prevents current x86 builds from working on android-N:
CANNOT LINK EXECUTABLE "/data/aria2_PIC": /data/aria2_PIC: has text relocations
Aborted
There are two possible workarounds:
Given that aria2 is a security sensitive network-enabled software, I would rather have ASLR working. Which leaves option 2.
Using eu-findtextrel
as explained in this Fedora Wiki article indicates, that the only affected code is an assembly implementation of ftruncate64
in ftruncate64.S.
After a lot of messing with build options the real cause of issue appears to be two-fold:
strip
without arguments or with --strip-unneeded
appears to somehow add in text relocations (or, perhaps, remove some information, crucible for proper work of PIC code).The former has been solved by shuffling around build flags in OpenSSL build script and disabling CAST symmetric cipher (seemingly unused by aria2 or any of major SSL ciphers).
The later has been solved by stripping debugging symbols only (strip -g
).
Seems like those issues are either not reproducible in upstream builds or haven't been a problem for anyone, so no need to report them there.
Android does not support non-PIC code since Lollipop. Despite building aria2 native binaries with (seemingly) correct flags Lollipop linker still whines about presence of text section relocations on executable startup. The warning seems to be harmless, but may have unwanted consequences.