Skip to content
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

Why do 'x86' and 'armeabi-v7a' abis set NDK platform level to 19 when other archs set it to 21 #140

Closed
bitmold opened this issue May 4, 2024 · 1 comment

Comments

@bitmold
Copy link
Contributor

bitmold commented May 4, 2024

Whereas x86_64 and arm64-v8a set the NDK level to 21.

I assume that this is a mistake/bug. Starting in NDK 26 the min SDK is 21 anyway, and NDK 25 was end of life'd already: android/ndk#1751

Orbot I think targets 21+ too fwiw.

ifneq ($(filter arm64-v8a, $(APP_ABI)),)
 HOST := aarch64-linux-android
 ALTHOST := $(HOST)
 GREP_CHECK := aarch64
 NDK_ABI := arm64
 NDK_BIT := 64
 NDK_PLATFORM_LEVEL := 21
 NDK_TOOLCHAIN := $(HOST)-$(NDK_TOOLCHAIN_VERSION)
endif
ifneq ($(filter armeabi-v7a, $(APP_ABI)),)
 HOST := armv7a-linux-androideabi
 ALTHOST := arm-linux-androideabi
 GREP_CHECK := EABI5
 NDK_ABI := arm
 NDK_BIT := 32
 NDK_PLATFORM_LEVEL := 19
 NDK_TOOLCHAIN := $(HOST)-$(NDK_TOOLCHAIN_VERSION)
endif
ifneq ($(filter x86, $(APP_ABI)),)
 HOST := i686-linux-android
 ALTHOST := $(HOST)
 GREP_CHECK := 80386
 NDK_ABI := x86
 NDK_BIT := 32
 NDK_PLATFORM_LEVEL := 19
 NDK_TOOLCHAIN := $(NDK_ABI)-$(NDK_TOOLCHAIN_VERSION)
endif
ifneq ($(filter x86_64, $(APP_ABI)),)
 HOST := x86_64-linux-android
 ALTHOST := $(HOST)
 GREP_CHECK := x86-64
 NDK_ABI := x86_64
 NDK_BIT := 64
 NDK_PLATFORM_LEVEL := 21
 NDK_TOOLCHAIN := $(NDK_ABI)-$(NDK_TOOLCHAIN_VERSION)
endif

Dropping Support for <= 20 decreases library size too.

cc @eighthave @n8fr8

@syphyr
Copy link
Contributor

syphyr commented May 4, 2024

I have been trying to get NDK 26 to work, but it has issues with including the jni parts of the code added to tor from the following commit:
guardianproject/tor@63d4d99

tor-anroid will appear to build sucessfully with NDK 26, but these jni additions from the commit above will be stripped out of libtor.so and orbot will then segfault on startup.

@bitmold bitmold changed the title Why does do 'x86' and 'armeabi-v7a' abis set NDK platform level to 19 May 6, 2024
@bitmold bitmold closed this as completed May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants