2016-04-16 15:03:45 +08:00
|
|
|
@LIT_SITE_CFG_IN_HEADER@
|
2012-08-07 16:59:15 +08:00
|
|
|
|
2014-04-01 21:16:30 +08:00
|
|
|
import os
|
Add support for FreeBSD's LD_32_LIBRARY_PATH
Summary:
Because the dynamic linker for 32-bit executables on 64-bit FreeBSD uses
the environment variable `LD_32_LIBRARY_PATH` instead of
`LD_LIBRARY_PATH` to find needed dynamic libraries, running the 32-bit
parts of the dynamic ASan tests will fail with errors similar to:
```
ld-elf32.so.1: Shared object "libclang_rt.asan-i386.so" not found, required by "Asan-i386-inline-Dynamic-Test"
```
This adds support for setting up `LD_32_LIBRARY_PATH` for the unit and
regression tests. It will likely also require a minor change to the
`TestingConfig` class in `llvm/utils/lit/lit`.
Reviewers: emaste, kcc, rnk, arichardson
Reviewed By: arichardson
Subscribers: kubamracek, krytarowski, fedor.sergeev, delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D65772
llvm-svn: 368516
2019-08-11 03:07:38 +08:00
|
|
|
import platform
|
2014-04-01 21:16:30 +08:00
|
|
|
|
2013-06-06 20:48:20 +08:00
|
|
|
# Load common config for all compiler-rt unit tests.
|
2014-02-14 19:00:07 +08:00
|
|
|
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
|
2012-08-07 16:59:15 +08:00
|
|
|
|
2014-04-01 21:16:30 +08:00
|
|
|
def push_ld_library_path(config, new_path):
|
|
|
|
new_ld_library_path = os.path.pathsep.join(
|
2015-01-14 10:23:27 +08:00
|
|
|
(new_path, config.environment.get('LD_LIBRARY_PATH', '')))
|
2014-04-01 21:16:30 +08:00
|
|
|
config.environment['LD_LIBRARY_PATH'] = new_ld_library_path
|
|
|
|
|
Add support for FreeBSD's LD_32_LIBRARY_PATH
Summary:
Because the dynamic linker for 32-bit executables on 64-bit FreeBSD uses
the environment variable `LD_32_LIBRARY_PATH` instead of
`LD_LIBRARY_PATH` to find needed dynamic libraries, running the 32-bit
parts of the dynamic ASan tests will fail with errors similar to:
```
ld-elf32.so.1: Shared object "libclang_rt.asan-i386.so" not found, required by "Asan-i386-inline-Dynamic-Test"
```
This adds support for setting up `LD_32_LIBRARY_PATH` for the unit and
regression tests. It will likely also require a minor change to the
`TestingConfig` class in `llvm/utils/lit/lit`.
Reviewers: emaste, kcc, rnk, arichardson
Reviewed By: arichardson
Subscribers: kubamracek, krytarowski, fedor.sergeev, delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D65772
llvm-svn: 368516
2019-08-11 03:07:38 +08:00
|
|
|
if platform.system() == 'FreeBSD':
|
|
|
|
new_ld_32_library_path = os.path.pathsep.join(
|
|
|
|
(new_path, config.environment.get('LD_32_LIBRARY_PATH', '')))
|
|
|
|
config.environment['LD_32_LIBRARY_PATH'] = new_ld_32_library_path
|
|
|
|
|
2013-06-06 21:48:20 +08:00
|
|
|
# Setup config name.
|
|
|
|
config.name = 'AddressSanitizer-Unit'
|
2013-01-30 20:18:49 +08:00
|
|
|
|
2013-06-06 21:48:20 +08:00
|
|
|
# Setup test source and exec root. For unit tests, we define
|
|
|
|
# it as build directory with ASan unit tests.
|
2014-02-14 22:06:10 +08:00
|
|
|
# FIXME: De-hardcode this path.
|
2014-12-18 07:14:01 +08:00
|
|
|
if @ASAN_TEST_DYNAMIC@:
|
|
|
|
test_dir = "dynamic"
|
|
|
|
else:
|
|
|
|
test_dir = "default"
|
|
|
|
config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@",
|
|
|
|
"lib", "asan", "tests", test_dir)
|
|
|
|
|
2013-06-06 21:48:20 +08:00
|
|
|
config.test_source_root = config.test_exec_root
|
2013-09-08 21:23:29 +08:00
|
|
|
|
2014-04-01 21:16:30 +08:00
|
|
|
# Set LD_LIBRARY_PATH to pick dynamic runtime up properly.
|
|
|
|
push_ld_library_path(config, config.compiler_rt_libdir)
|
2017-01-20 08:25:01 +08:00
|
|
|
|
|
|
|
if config.host_os == 'Darwin':
|
|
|
|
config.parallelism_group = config.darwin_sanitizer_parallelism_group_func
|