Skip to content
Snippets Groups Projects
Commit b9ff1684 authored by akwizgran's avatar akwizgran
Browse files

Raise min Android API level to 18 to enable hardening.

-D_FORTIFY_SOURCE=2 has no effect with the API 16 compiler,
which resulted in our 32-bit binaries not having those
protections.
parent 3c52e0dc
Branches
No related tags found
1 merge request!37Enable FORTIFY_SOURCE for 32-bit Android binaries
...@@ -64,28 +64,24 @@ def build_android(versions): ...@@ -64,28 +64,24 @@ def build_android(versions):
app_abi = 'armeabi-v7a' app_abi = 'armeabi-v7a'
env = os.environ.copy() env = os.environ.copy()
env['APP_ABI'] = app_abi env['APP_ABI'] = app_abi
env['NDK_PLATFORM_LEVEL'] = "16" # first level supporting PIE
build_android_arch(app_abi, env, versions) build_android_arch(app_abi, env, versions)
# build arm64 pie # build arm64 pie
app_abi = 'arm64-v8a' app_abi = 'arm64-v8a'
env = os.environ.copy() env = os.environ.copy()
env['APP_ABI'] = app_abi env['APP_ABI'] = app_abi
env['NDK_PLATFORM_LEVEL'] = "21" # first level supporting 64-bit
build_android_arch(app_abi, env, versions) build_android_arch(app_abi, env, versions)
# build x86 pie # build x86 pie
app_abi = 'x86' app_abi = 'x86'
env = os.environ.copy() env = os.environ.copy()
env['APP_ABI'] = app_abi env['APP_ABI'] = app_abi
env['NDK_PLATFORM_LEVEL'] = "16" # first level supporting PIE
build_android_arch(app_abi, env, versions) build_android_arch(app_abi, env, versions)
# build x86_64 pie # build x86_64 pie
app_abi = 'x86_64' app_abi = 'x86_64'
env = os.environ.copy() env = os.environ.copy()
env['APP_ABI'] = app_abi env['APP_ABI'] = app_abi
env['NDK_PLATFORM_LEVEL'] = "21" # first level supporting 64-bit
build_android_arch(app_abi, env, versions) build_android_arch(app_abi, env, versions)
......
...@@ -49,7 +49,7 @@ ifneq ($(filter armeabi-v7a, $(APP_ABI)),) ...@@ -49,7 +49,7 @@ ifneq ($(filter armeabi-v7a, $(APP_ABI)),)
GREP_CHECK := EABI5 GREP_CHECK := EABI5
NDK_ABI := arm NDK_ABI := arm
NDK_BIT := 32 NDK_BIT := 32
NDK_PLATFORM_LEVEL := 16 NDK_PLATFORM_LEVEL := 18
NDK_TOOLCHAIN := $(HOST)-$(NDK_TOOLCHAIN_VERSION) NDK_TOOLCHAIN := $(HOST)-$(NDK_TOOLCHAIN_VERSION)
endif endif
ifneq ($(filter x86, $(APP_ABI)),) ifneq ($(filter x86, $(APP_ABI)),)
...@@ -58,7 +58,7 @@ ifneq ($(filter x86, $(APP_ABI)),) ...@@ -58,7 +58,7 @@ ifneq ($(filter x86, $(APP_ABI)),)
GREP_CHECK := 80386 GREP_CHECK := 80386
NDK_ABI := x86 NDK_ABI := x86
NDK_BIT := 32 NDK_BIT := 32
NDK_PLATFORM_LEVEL := 16 NDK_PLATFORM_LEVEL := 18
NDK_TOOLCHAIN := $(NDK_ABI)-$(NDK_TOOLCHAIN_VERSION) NDK_TOOLCHAIN := $(NDK_ABI)-$(NDK_TOOLCHAIN_VERSION)
endif endif
ifneq ($(filter x86_64, $(APP_ABI)),) ifneq ($(filter x86_64, $(APP_ABI)),)
...@@ -221,6 +221,7 @@ tor/Makefile: tor/configure.ac tor/Makefile.am ...@@ -221,6 +221,7 @@ tor/Makefile: tor/configure.ac tor/Makefile.am
cd tor && \ cd tor && \
./configure \ ./configure \
--host=$(ALTHOST) \ --host=$(ALTHOST) \
--enable-android \
--enable-lzma \ --enable-lzma \
--enable-pic \ --enable-pic \
--enable-static-libevent --with-libevent-dir=$(EXTERNAL_ROOT) \ --enable-static-libevent --with-libevent-dir=$(EXTERNAL_ROOT) \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment