150
|
1 @LIT_SITE_CFG_IN_HEADER@
|
|
2
|
|
3 # Set attribute value if it is unset.
|
|
4 def set_default(attr, value):
|
|
5 if not getattr(config, attr, None):
|
|
6 setattr(config, attr, value)
|
|
7
|
|
8 # Generic config options for all compiler-rt lit tests.
|
|
9 set_default("target_triple", "@COMPILER_RT_DEFAULT_TARGET_TRIPLE@")
|
|
10 set_default("target_cflags", "@COMPILER_RT_TEST_COMPILER_CFLAGS@")
|
|
11 set_default("host_arch", "@HOST_ARCH@")
|
|
12 set_default("target_arch", "@COMPILER_RT_DEFAULT_TARGET_ARCH@")
|
|
13 set_default("host_os", "@HOST_OS@")
|
|
14 set_default("llvm_build_mode", "@LLVM_BUILD_MODE@")
|
|
15 set_default("llvm_src_root", "@LLVM_MAIN_SRC_DIR@")
|
|
16 set_default("llvm_obj_root", "@LLVM_BINARY_DIR@")
|
|
17 set_default("compiler_rt_src_root", "@COMPILER_RT_SOURCE_DIR@")
|
|
18 set_default("compiler_rt_obj_root", "@COMPILER_RT_BINARY_DIR@")
|
|
19 set_default("enable_per_target_runtime_dir", @LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_PYBOOL@)
|
|
20 set_default("llvm_tools_dir", "@LLVM_TOOLS_DIR@")
|
|
21 set_default("llvm_shlib_dir", "@LLVM_LIBRARY_OUTPUT_INTDIR@")
|
221
|
22 set_default("gnu_ld_executable", "@GNU_LD_EXECUTABLE@")
|
150
|
23 set_default("gold_executable", "@GOLD_EXECUTABLE@")
|
|
24 set_default("clang", "@COMPILER_RT_RESOLVED_TEST_COMPILER@")
|
|
25 set_default("compiler_id", "@COMPILER_RT_TEST_COMPILER_ID@")
|
173
|
26 set_default("python_executable", "@Python3_EXECUTABLE@")
|
150
|
27 set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@)
|
|
28 set_default("compiler_rt_intercept_libdispatch", @COMPILER_RT_INTERCEPT_LIBDISPATCH_PYBOOL@)
|
|
29 set_default("compiler_rt_libdir", "@COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR@")
|
|
30 set_default("emulator", "@COMPILER_RT_EMULATOR@")
|
|
31 set_default("asan_shadow_scale", "@COMPILER_RT_ASAN_SHADOW_SCALE@")
|
221
|
32 set_default("memprof_shadow_scale", "@COMPILER_RT_MEMPROF_SHADOW_SCALE@")
|
150
|
33 set_default("apple_platform", "osx")
|
173
|
34 set_default("apple_platform_min_deployment_target_flag", "-mmacosx-version-min")
|
150
|
35 set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@)
|
|
36 set_default("has_lld", @COMPILER_RT_HAS_LLD_PYBOOL@)
|
|
37 set_default("can_symbolize", @CAN_SYMBOLIZE@)
|
221
|
38 set_default("use_lld", @COMPILER_RT_TEST_USE_LLD_PYBOOL@)
|
150
|
39 set_default("use_thinlto", False)
|
|
40 set_default("use_lto", config.use_thinlto)
|
|
41 set_default("use_newpm", False)
|
|
42 set_default("android", @ANDROID_PYBOOL@)
|
221
|
43 set_default("android_api_level", "@ANDROID_API_LEVEL@")
|
150
|
44 set_default("android_serial", "@ANDROID_SERIAL_FOR_TESTING@")
|
|
45 set_default("android_files_to_push", [])
|
|
46 set_default("have_rpc_xdr_h", @HAVE_RPC_XDR_H@)
|
|
47 set_default("gwp_asan", @COMPILER_RT_HAS_GWP_ASAN_PYBOOL@)
|
|
48 set_default("expensive_checks", @LLVM_ENABLE_EXPENSIVE_CHECKS_PYBOOL@)
|
221
|
49 set_default("test_standalone_build_libs", @COMPILER_RT_TEST_STANDALONE_BUILD_LIBS_PYBOOL@)
|
|
50 # True iff the test suite supports ignoring the test compiler's runtime library path
|
|
51 # and using `config.compiler_rt_libdir` instead. This only matters when the runtime
|
|
52 # library paths differ.
|
|
53 set_default("test_suite_supports_overriding_runtime_lib_path", False)
|
150
|
54 config.available_features.add('target-is-%s' % config.target_arch)
|
|
55
|
|
56 if config.enable_per_target_runtime_dir:
|
|
57 set_default("target_suffix", "")
|
221
|
58 elif config.android:
|
|
59 if config.target_arch == "i386":
|
|
60 set_default("target_suffix", "-i686-android")
|
|
61 else:
|
|
62 set_default("target_suffix", "-%s-android" % config.target_arch)
|
150
|
63 else:
|
|
64 set_default("target_suffix", "-%s" % config.target_arch)
|
|
65
|
221
|
66 set_default("have_zlib", "@LLVM_ENABLE_ZLIB@")
|
150
|
67 set_default("libcxx_used", "@LLVM_LIBCXX_USED@")
|
|
68
|
|
69 # LLVM tools dir can be passed in lit parameters, so try to
|
|
70 # apply substitution.
|
|
71 try:
|
|
72 config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
|
|
73 config.clang = config.clang % lit_config.params
|
|
74 config.compiler_rt_libdir = config.compiler_rt_libdir % lit_config.params
|
|
75 except KeyError as e:
|
|
76 key, = e.args
|
|
77 lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
|
|
78
|
|
79 if not os.path.exists(config.clang):
|
|
80 lit_config.fatal("Can't find compiler on path %r" % config.clang)
|
|
81
|
|
82 # Setup attributes common for all compiler-rt projects.
|
|
83 lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/test/lit.common.cfg.py")
|