-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[i686] OpenJDK has text relocations #7215
Comments
Probably related to this part: https://github.com/termux/openjdk-mobile-termux/blob/1b8989d1093511649da820fd108794dd424279d9/make/hotspot/lib/JvmOverrideFiles.gmk#L68 When building for x86, some codes are not built with |
Applying the above-mentioned fix does remove TEXTREL from libjvm.so, but now it reports TEXTREL in libandroid-spawn.so |
When adding this, we go from compiling with /home/builder/.termux-build/_cache/android-r21d-api-24-v4/bin/clang++ [...] -mrelocation-model pic -pic-level 2 -pic-is-pie [...] to /home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/clang++ [...] -mrelocation-model pic -pic-level 2 [...] Before, we got a warning when compiling libandroid-spawn: /home/builder/.termux-build/_cache/android-r21d-api-24-v4/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: warning: shared library text segment is not shareable and trying to use a program linked against libandroid-spawn gave an error, see #7215 (comment) the Without this, libraries might end up with text relocations. For some reason it does not seem to be an issue on the other arches.
When adding this, we go from compiling with /home/builder/.termux-build/_cache/android-r21d-api-24-v4/bin/clang++ [...] -mrelocation-model pic -pic-level 2 -pic-is-pie [...] to /home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/clang++ [...] -mrelocation-model pic -pic-level 2 [...] Before, we got a warning when compiling libandroid-spawn: /home/builder/.termux-build/_cache/android-r21d-api-24-v4/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: warning: shared library text segment is not shareable and trying to use a program linked against libandroid-spawn gave an error, see #7215 (comment) the Without this, libraries might end up with text relocations. For some reason it does not seem to be an issue on the other arches. %ci:no-build
When adding this, we go from compiling with /home/builder/.termux-build/_cache/android-r21d-api-24-v4/bin/clang++ [...] -mrelocation-model pic -pic-level 2 -pic-is-pie [...] to /home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/clang++ [...] -mrelocation-model pic -pic-level 2 [...] Before, we got a warning when compiling libandroid-spawn: /home/builder/.termux-build/_cache/android-r21d-api-24-v4/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: warning: shared library text segment is not shareable and trying to use a program linked against libandroid-spawn gave an error, see #7215 (comment) the Without this, libraries might end up with text relocations. For some reason it does not seem to be an issue on the other arches. %ci:no-build
When adding this, we go from compiling with /home/builder/.termux-build/_cache/android-r21d-api-24-v4/bin/clang++ [...] -mrelocation-model pic -pic-level 2 -pic-is-pie [...] to /home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/clang++ [...] -mrelocation-model pic -pic-level 2 [...] Before, we got a warning when compiling libandroid-spawn: /home/builder/.termux-build/_cache/android-r21d-api-24-v4/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: warning: shared library text segment is not shareable and trying to use a program linked against libandroid-spawn gave an error, see #7215 (comment) the Without this, libraries might end up with text relocations. For some reason it does not seem to be an issue on the other arches. %ci:no-build
When adding this, we go from compiling with /home/builder/.termux-build/_cache/android-r21d-api-24-v4/bin/clang++ [...] -mrelocation-model pic -pic-level 2 -pic-is-pie [...] to /home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/clang++ [...] -mrelocation-model pic -pic-level 2 [...] Before, we got a warning when compiling libandroid-spawn: /home/builder/.termux-build/_cache/android-r21d-api-24-v4/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: warning: shared library text segment is not shareable and trying to use a program linked against libandroid-spawn gave an error, see termux#7215 (comment) the Without this, libraries might end up with text relocations. For some reason it does not seem to be an issue on the other arches. %ci:no-build
As we have seen [1], i686 seem to explicitly need -fPIC. Pass CPPFLAGS in more places when building aapt, to avoid an error like: ld: error: relocation R_386_PC32 cannot be used against symbol config_free; recompile with -fPIC >>> defined in /tmp/config_utils-70060d.o >>> referenced by config_utils.c >>> /tmp/config_utils-70060d.o:(config_free) [1] #7215 (comment)
As we have seen [1], i686 seem to explicitly need -fPIC. Pass CPPFLAGS in more places when building aapt, to avoid an error like: ld: error: relocation R_386_PC32 cannot be used against symbol config_free; recompile with -fPIC >>> defined in /tmp/config_utils-70060d.o >>> referenced by config_utils.c >>> /tmp/config_utils-70060d.o:(config_free) [1] #7215 (comment)
As we have seen [1], i686 seem to explicitly need -fPIC. Pass CPPFLAGS in more places when building aapt, to avoid an error like: ld: error: relocation R_386_PC32 cannot be used against symbol config_free; recompile with -fPIC >>> defined in /tmp/config_utils-70060d.o >>> referenced by config_utils.c >>> /tmp/config_utils-70060d.o:(config_free) [1] #7215 (comment)
As we have seen [1], i686 seem to explicitly need -fPIC. Pass CPPFLAGS in more places when building aapt, to avoid an error like: ld: error: relocation R_386_PC32 cannot be used against symbol config_free; recompile with -fPIC >>> defined in /tmp/config_utils-70060d.o >>> referenced by config_utils.c >>> /tmp/config_utils-70060d.o:(config_free) [1] termux#7215 (comment)
Problem description
Dynamic linker detects text relocations in one or more binaries. As result, it isn't possible to run utilities like
java
,jshell
, etc.Same issue affects https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch/tree/buildjre16 on which the current build is based.
Additional information
As I don't have real i686 device, test was executed in Termux environment packaged as Docker image. Assume it is equivalent to Android 9 since it uses libc and dynamic linker from its GSI image.
The text was updated successfully, but these errors were encountered: