summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/lit.common.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test/lit.common.cfg')
-rw-r--r--compiler-rt/test/lit.common.cfg15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler-rt/test/lit.common.cfg b/compiler-rt/test/lit.common.cfg
index 975ae29e812..cbd9082805c 100644
--- a/compiler-rt/test/lit.common.cfg
+++ b/compiler-rt/test/lit.common.cfg
@@ -289,6 +289,21 @@ if config.android:
if android_api_level >= 28:
config.available_features.add('android-28')
+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):
config.available_features.add("has_sancovcc")
OpenPOWER on IntegriCloud