You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if my build environment is not correctly set up or they are legitimately issues, but there is 2 related issues I encountered while trying to build Superuser.
README file lists API 19 and NDK 9b as requirements, but su binary doesn't compile correctly while using them.
$ ls $ANDROID_HOME/platforms/android-19
data/ skins/ templates/ android.jar build.prop framework.aidl sdk.properties source.properties uiautomator.jar
$ ls `which ndk-build`
/opt/android/ndk-r9b/ndk-build
$ cat /opt/android/ndk-r9b/RELEASE.TXT
r9b
$ ndk-build
[x86] Compile : selinux <= fgetfilecon.c
jni/libselinux/src/fgetfilecon.c:6:23: fatal error: sys/xattr.h: No such file or directory
compilation terminated.
make: *** [obj/local/x86/objs/selinux/src/fgetfilecon.o] Error 1
It looks like sys/attr.h was added later in SDK 21.
but no libs/*/placeholder exits as the README says?
$ ls libs/*/
libs/armeabi/:
su*
libs/mips/:
su*
libs/x86/:
su*
And the resulting binary doesn't work
$ adb push libs/x86/su /system/xbin/su
3255 KB/s (602704 bytes in 0.180s)
$ adb shell
# ls -lZ /system/xbin/su*
-rwxrwxrwx root root u:object_r:system_file:s0 su
-rwsr-sr-x root root u:object_r:su_exec:s0 su.original
# su
CANNOT LINK EXECUTABLE: cannot locate symbol "signal" referenced by "su"...
I know selinux contexts don't match but linking problem is seperate and it is a known issue
I transcripted this on a x86 4.4 emulator but the error was same a 4.4 armv7 phone last night.
I also tried changing include lines to linux/attr.h as they were on older SDK versions, but they seem to be different headers than sys/attr.h so there were compile errors. I didn't dig it further.
The text was updated successfully, but these errors were encountered:
Sorry I forgot about this. Linking issue seems to be resolved (even though I couldn't get it working due to not being able to install properly). README still points to the NDK r9b, though. It doesn't work and it should point to NDK r10 instead.
I'm not sure if my build environment is not correctly set up or they are legitimately issues, but there is 2 related issues I encountered while trying to build Superuser.
README file lists API 19 and NDK 9b as requirements, but su binary doesn't compile correctly while using them.
It looks like sys/attr.h was added later in SDK 21.
If I switch to NDK 10, it compiles correctly but the resulting binary won't work in Android 4.4
but no libs/*/placeholder exits as the README says?
And the resulting binary doesn't work
I know selinux contexts don't match but linking problem is seperate and it is a known issue
I transcripted this on a x86 4.4 emulator but the error was same a 4.4 armv7 phone last night.
I also tried changing include lines to
linux/attr.h
as they were on older SDK versions, but they seem to be different headers thansys/attr.h
so there were compile errors. I didn't dig it further.The text was updated successfully, but these errors were encountered: