summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2017-11-02 09:47:57 -0700
committerDan Albert <danalbert@google.com>2017-11-02 11:37:02 -0700
commit188282cda76d3ff756efb32ae1728cffd1ee50bf (patch)
treea3a3408ffac288a43129924e0480982b957383a6
parentc02af0dbf54d90b323c43ab477ce06ae1412dafa (diff)
downloadexternal_libcxx-188282cda76d3ff756efb32ae1728cffd1ee50bf.tar.gz
external_libcxx-188282cda76d3ff756efb32ae1728cffd1ee50bf.tar.bz2
external_libcxx-188282cda76d3ff756efb32ae1728cffd1ee50bf.zip
Add missing arm7 flags to libc++ test runner.
The new compiler fails a test if we don't pass the softfp and vfpv3-d16 flags. These flags should be passed for Android anyway. Test: ndk/run_tests.py --rebuild Bug: None Change-Id: I003dde7a734ba4ef78ae803a63b91f9bd033dc14
-rw-r--r--utils/libcxx/ndk/test/config.py37
1 files changed, 22 insertions, 15 deletions
diff --git a/utils/libcxx/ndk/test/config.py b/utils/libcxx/ndk/test/config.py
index b468ebfc5..3717eb853 100644
--- a/utils/libcxx/ndk/test/config.py
+++ b/utils/libcxx/ndk/test/config.py
@@ -55,27 +55,27 @@ class Configuration(libcxx.test.config.Configuration):
def configure_compile_flags(self):
super(Configuration, self).configure_compile_flags()
- unified_headers = self.get_lit_bool('unified_headers')
arch = self.get_lit_conf('arch')
api = self.get_lit_conf('api')
- sysroot_path = 'platforms/android-{}/arch-{}'.format(api, arch)
- platform_sysroot = os.path.join(os.environ['NDK'], sysroot_path)
- if unified_headers:
- sysroot = os.path.join(os.environ['NDK'], 'sysroot')
- self.cxx.compile_flags.extend(['--sysroot', sysroot])
+ sysroot = os.path.join(os.environ['NDK'], 'sysroot')
+ self.cxx.compile_flags.extend(['--sysroot', sysroot])
- triple = self.get_lit_conf('target_triple')
- header_triple = triple.rstrip('0123456789')
- header_triple = header_triple.replace('armv7', 'arm')
- arch_includes = os.path.join(sysroot, 'usr/include', header_triple)
- self.cxx.compile_flags.extend(['-isystem', arch_includes])
+ triple = self.get_lit_conf('target_triple')
+ header_triple = triple.rstrip('0123456789')
+ header_triple = header_triple.replace('armv7', 'arm')
+ arch_includes = os.path.join(sysroot, 'usr/include', header_triple)
+ self.cxx.compile_flags.extend(['-isystem', arch_includes])
- self.cxx.compile_flags.append('-D__ANDROID_API__={}'.format(api))
+ self.cxx.compile_flags.append('-D__ANDROID_API__={}'.format(api))
- self.cxx.link_flags.extend(['--sysroot', platform_sysroot])
- else:
- self.cxx.flags.extend(['--sysroot', platform_sysroot])
+ if arch == 'arm':
+ self.cxx.flags.extend([
+ '-march=armv7-a',
+ '-mfloat-abi=softfp',
+ '-mfpu=vfpv3-d16',
+ '-mthumb',
+ ])
android_support_headers = os.path.join(
os.environ['NDK'], 'sources/android/support/include')
@@ -84,6 +84,13 @@ class Configuration(libcxx.test.config.Configuration):
def configure_link_flags(self):
self.cxx.link_flags.append('-nodefaultlibs')
+ arch = self.get_lit_conf('arch')
+ api = self.get_lit_conf('api')
+
+ sysroot_path = 'platforms/android-{}/arch-{}'.format(api, arch)
+ platform_sysroot = os.path.join(os.environ['NDK'], sysroot_path)
+ self.cxx.link_flags.extend(['--sysroot', platform_sysroot])
+
# Configure libc++ library paths.
self.cxx.link_flags.append('-L' + self.cxx_library_root)