From 8c31370534a7c76aea243fb2ef4935f418f079cf Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 12 Jan 2020 12:07:55 +0100 Subject: [PATCH] android/build.py: drop --sysroot, -isystem, -L, ... These appear to be no longer necessary (tested with NDK r20b). Closes https://github.com/android/ndk/issues/951 --- android/build.py | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/android/build.py b/android/build.py index cfa3c461b..bea1dd051 100755 --- a/android/build.py +++ b/android/build.py @@ -75,20 +75,14 @@ class AndroidNdkToolchain: ndk_arch = abi_info['ndk_arch'] android_api_level = '21' - ndk_platform = 'android-' + android_api_level # select the NDK compiler gcc_version = '4.9' - ndk_platform_path = os.path.join(ndk_path, 'platforms', ndk_platform) - sysroot = os.path.join(ndk_path, 'sysroot') - target_root = os.path.join(ndk_platform_path, 'arch-' + ndk_arch) - install_prefix = os.path.join(arch_path, 'root') self.arch = arch self.install_prefix = install_prefix - self.sysroot = sysroot toolchain_path = os.path.join(ndk_path, 'toolchains', abi_info['toolchain_arch'] + '-' + gcc_version, 'prebuilt', build_arch) llvm_path = os.path.join(ndk_path, 'toolchains', 'llvm', 'prebuilt', build_arch) @@ -113,14 +107,10 @@ class AndroidNdkToolchain: self.cflags = common_flags self.cxxflags = common_flags - self.cppflags = '--sysroot=' + sysroot + \ - ' -isystem ' + os.path.join(install_prefix, 'include') + \ - ' -isystem ' + os.path.join(sysroot, 'usr', 'include', arch) - self.ldflags = '--sysroot=' + sysroot + \ - ' -L' + os.path.join(install_prefix, 'lib') + \ - ' -L' + os.path.join(target_root, 'usr', 'lib') + \ - ' -B' + os.path.join(target_root, 'usr', 'lib') + \ + self.cppflags = ' -isystem ' + os.path.join(install_prefix, 'include') + self.ldflags = ' -L' + os.path.join(install_prefix, 'lib') + \ ' ' + common_flags + self.ldflags = common_flags self.libs = '' self.is_arm = ndk_arch == 'arm' @@ -128,13 +118,10 @@ class AndroidNdkToolchain: self.is_aarch64 = ndk_arch == 'arm64' self.is_windows = False - libcxx_path = os.path.join(ndk_path, 'sources/cxx-stl/llvm-libc++') - libcxx_libs_path = os.path.join(libcxx_path, 'libs', android_abi) - libstdcxx_flags = '' - libstdcxx_cxxflags = libstdcxx_flags + ' -isystem ' + os.path.join(libcxx_path, 'include') + ' -isystem ' + os.path.join(ndk_path, 'sources/android/support/include') - libstdcxx_ldflags = libstdcxx_flags + ' -L' + libcxx_libs_path - libstdcxx_libs = '-lc++_static -lc++abi' + libstdcxx_cxxflags = '' + libstdcxx_ldflags = '' + libstdcxx_libs = '-static-libstdc++' if self.is_armv7: # On 32 bit ARM, clang generates no ".eh_frame" section;