summaryrefslogtreecommitdiff
path: root/test/lit.common.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit.common.cfg')
-rw-r--r--test/lit.common.cfg40
1 files changed, 36 insertions, 4 deletions
diff --git a/test/lit.common.cfg b/test/lit.common.cfg
index cdcba5fc9..f06658ff2 100644
--- a/test/lit.common.cfg
+++ b/test/lit.common.cfg
@@ -55,10 +55,11 @@ config.available_features.add(compiler_id)
if config.asan_shadow_scale != '':
config.target_cflags += " -mllvm -asan-mapping-scale=" + config.asan_shadow_scale
-# BFD linker in 64-bit android toolchains fails to find libm.so, which is a
-# transitive shared library dependency (via asan runtime).
+# BFD linker in 64-bit android toolchains fails to find libc++_shared.so, which
+# is a transitive shared library dependency (via asan runtime).
if config.android:
- config.target_cflags += " -pie -fuse-ld=gold -Wl,--enable-new-dtags"
+ # Prepend the flag so that it can be overridden.
+ config.target_cflags = "-pie -fuse-ld=gold " + config.target_cflags
config.cxx_mode_flags.append('-stdlib=libstdc++')
# Clear some environment variables that might affect Clang.
@@ -275,9 +276,14 @@ else:
config.substitutions.append( ("%darwin_min_target_with_full_runtime_arc_support", "") )
if config.android:
+ env = os.environ.copy()
+ if config.android_serial:
+ env['ANDROID_SERIAL'] = config.android_serial
+ config.environment['ANDROID_SERIAL'] = config.android_serial
+
adb = os.environ.get('ADB', 'adb')
try:
- android_api_level_str = subprocess.check_output([adb, "shell", "getprop", "ro.build.version.sdk"]).rstrip()
+ android_api_level_str = subprocess.check_output([adb, "shell", "getprop", "ro.build.version.sdk"], env=env).rstrip()
except (subprocess.CalledProcessError, OSError):
lit_config.fatal("Failed to read ro.build.version.sdk (using '%s' as adb)" % adb)
try:
@@ -286,6 +292,29 @@ if config.android:
lit_config.fatal("Failed to read ro.build.version.sdk (using '%s' as adb): got '%s'" % (adb, android_api_level_str))
if android_api_level >= 26:
config.available_features.add('android-26')
+ if android_api_level >= 28:
+ config.available_features.add('android-28')
+
+ # Prepare the device.
+ android_tmpdir = '/data/local/tmp/Output'
+ subprocess.check_call([adb, "shell", "mkdir", "-p", android_tmpdir], env=env)
+ for file in config.android_files_to_push:
+ subprocess.check_call([adb, "push", file, android_tmpdir], env=env)
+
+if config.host_os == 'Linux':
+ # detect whether we are using glibc, and which version
+ # NB: 'ldd' is just one of the tools commonly installed as part of glibc
+ ldd_ver_cmd = subprocess.Popen(['ldd', '--version'],
+ stdout=subprocess.PIPE,
+ env={'LANG': 'C'})
+ sout, _ = ldd_ver_cmd.communicate()
+ ver_line = sout.splitlines()[0]
+ if ver_line.startswith(b"ldd "):
+ from distutils.version import LooseVersion
+ ver = LooseVersion(ver_line.split()[-1].decode())
+ # 2.27 introduced some incompatibilities
+ if ver >= LooseVersion("2.27"):
+ config.available_features.add("glibc-2.27")
sancovcc_path = os.path.join(config.llvm_tools_dir, "sancov")
if os.path.exists(sancovcc_path):
@@ -342,6 +371,9 @@ if config.lto_supported:
if config.use_newpm:
config.lto_flags += ["-fexperimental-new-pass-manager"]
+if config.have_rpc_xdr_h:
+ config.available_features.add('sunrpc')
+
# Ask llvm-config about assertion mode.
try:
llvm_config_cmd = subprocess.Popen(