Lines Matching refs:config
18 def get_required_attr(config, attr_name): argument
19 attr_value = getattr(config, attr_name, None)
27 def push_dynamic_library_lookup_path(config, new_path): argument
36 (new_path, config.environment.get(dynamic_library_lookup_var, '')))
37 config.environment[dynamic_library_lookup_var] = new_ld_library_path
42 (new_path, config.environment.get(dynamic_library_lookup_var, '')))
43 config.environment[dynamic_library_lookup_var] = new_ld_32_library_path
48 (new_path, config.environment.get(dynamic_library_lookup_var, '')))
49 config.environment[dynamic_library_lookup_var] = new_ld_library_path_32
53 (new_path, config.environment.get(dynamic_library_lookup_var, '')))
54 config.environment[dynamic_library_lookup_var] = new_ld_library_path_64
57 config.name = 'AddressSanitizer' + config.name_suffix
60 default_asan_opts = list(config.default_sanitizer_opts)
64 if config.host_os == 'Darwin' and config.target_arch == 'x86_64':
69 config.environment['ASAN_OPTIONS'] = default_asan_opts_str
71 config.substitutions.append(('%env_asan_opts=',
75 config.test_source_root = os.path.dirname(__file__)
77 if config.host_os not in ['FreeBSD', 'NetBSD']:
84 if config.compiler_id == 'GNU':
91 target_cflags = [get_required_attr(config, "target_cflags")] + extra_link_flags
92 target_cxxflags = config.cxx_mode_flags + target_cflags
97 config.debug_info_flags + target_cflags)
98 if config.target_arch == 's390x':
100 clang_asan_static_cxxflags = config.cxx_mode_flags + clang_asan_static_cflags
103 if config.asan_dynamic:
111 config.available_features.add("asan-dynamic-runtime")
113 config.available_features.add("asan-static-runtime")
120 if config.asan_dynamic:
124 config.available_features.add(win_runtime_feature)
127 return " " + " ".join([config.clang] + compile_flags) + " "
129 config.substitutions.append( ("%clang ", build_invocation(target_cflags)) )
130 config.substitutions.append( ("%clangxx ", build_invocation(target_cxxflags)) )
131 config.substitutions.append( ("%clang_asan ", build_invocation(clang_asan_cflags)) )
132 config.substitutions.append( ("%clangxx_asan ", build_invocation(clang_asan_cxxflags)) )
133 if config.asan_dynamic:
134 if config.host_os in ['Linux', 'FreeBSD', 'NetBSD', 'SunOS']:
135 …shared_libasan_path = os.path.join(config.compiler_rt_libdir, "libclang_rt.asan{}.so".format(confi…
136 elif config.host_os == 'Darwin':
137 …shared_libasan_path = os.path.join(config.compiler_rt_libdir, 'libclang_rt.asan_{}_dynamic.dylib'.…
143 config.substitutions.append( ("%shared_libasan", shared_libasan_path) )
144 config.substitutions.append( ("%clang_asan_static ", build_invocation(clang_asan_static_cflags)) )
145 …config.substitutions.append( ("%clangxx_asan_static ", build_invocation(clang_asan_static_cxxflags…
154 if config.asan_dynamic:
159 config.substitutions.append( ("%clang_cl ", clang_cl_invocation) )
163 config.substitutions.append( ("%clang_cl_asan ", clang_cl_asan_invocation) )
165 …base_lib = os.path.join(config.compiler_rt_libdir, "clang_rt.asan%%s%s.lib" % config.target_suffix)
166 config.substitutions.append( ("%asan_lib", base_lib % "") )
167 config.substitutions.append( ("%asan_cxx_lib", base_lib % "_cxx") )
168 config.substitutions.append( ("%asan_dll_thunk", base_lib % "_dll_thunk") )
173 config.substitutions.append(("%stdcxx11 ", ""))
176 config.substitutions.append(("%stdcxx11 ", "-std=c++11 "))
180 get_required_attr(config, "compiler_rt_src_root"), "lib", "asan")
181 python_exec = sh_quote(get_required_attr(config, "python_executable"))
186 config.substitutions.append( ("%asan_symbolize", python_exec + " " + asan_symbolize + " ") )
189 get_required_attr(config, "compiler_rt_src_root"), "lib", "sanitizer_common")
193 config.substitutions.append( ("%sancov ", python_exec + " " + sancov + " ") )
196 if config.host_arch.find('64') != -1 and not config.android:
201 config.substitutions.append( ('CHECK-%kernel_bits', ("CHECK-kernel-" + kernel_bits + "-bits")))
203 config.substitutions.append( ("%libdl", libdl_flag) )
205 config.available_features.add("asan-" + config.bits + "-bits")
208 if not config.arm_thumb:
209 config.available_features.add('fast-unwinder-works')
212 leak_detection_android = config.android and 'android-thread-properties-api' in config.available_fea…
213 leak_detection_linux = (config.host_os == 'Linux') and (not config.android) and (config.target_arch…
214 leak_detection_mac = (config.host_os == 'Darwin') and (config.target_arch == 'x86_64')
215 leak_detection_netbsd = (config.host_os == 'NetBSD') and (config.target_arch in ['x86_64', 'i386'])
217 config.available_features.add('leak-detection')
220 push_dynamic_library_lookup_path(config, config.compiler_rt_libdir)
223 if config.compiler_id == 'GNU':
224 gcc_dir = os.path.dirname(config.clang)
225 libasan_dir = os.path.join(gcc_dir, "..", "lib" + config.bits)
226 push_dynamic_library_lookup_path(config, libasan_dir)
230 if config.host_os == 'Windows' and config.asan_dynamic:
231 os.environ['PATH'] = os.path.pathsep.join([config.compiler_rt_libdir,
235 config.suffixes = ['.c', '.cpp']
237 if config.host_os == 'Darwin':
238 config.suffixes.append('.mm')
240 if config.host_os == 'Windows':
241 config.substitutions.append(('%fPIC', ''))
242 config.substitutions.append(('%fPIE', ''))
243 config.substitutions.append(('%pie', ''))
245 config.substitutions.append(('%fPIC', '-fPIC'))
246 config.substitutions.append(('%fPIE', '-fPIE'))
247 config.substitutions.append(('%pie', '-pie'))
250 if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'SunOS', 'Windows', 'NetBSD']:
251 config.unsupported = True
253 if not config.parallelism_group:
254 config.parallelism_group = 'shadow-memory'
256 if config.host_os == 'NetBSD':
257 config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix))