Lines Matching refs:config

8 def get_required_attr(config, attr_name):
9 attr_value = getattr(config, attr_name, None)
17 def push_dynamic_library_lookup_path(config, new_path):
26 (new_path, config.environment.get(dynamic_library_lookup_var, '')))
27 config.environment[dynamic_library_lookup_var] = new_ld_library_path
29 # Setup config name.
30 config.name = 'AddressSanitizer' + config.name_suffix
34 if config.host_os == 'Darwin':
41 config.environment['ASAN_OPTIONS'] = default_asan_opts
43 config.substitutions.append(('%env_asan_opts=',
47 config.test_source_root = os.path.dirname(__file__)
50 if config.host_os != 'FreeBSD':
57 if config.compiler_id == 'GNU':
64 if config.android:
69 target_cflags = [get_required_attr(config, "target_cflags")] + extra_linkflags
70 target_cxxflags = config.cxx_mode_flags + target_cflags
75 config.debug_info_flags + target_cflags)
76 clang_asan_static_cxxflags = config.cxx_mode_flags + clang_asan_static_cflags
78 if config.asan_dynamic:
81 config.available_features.add("asan-dynamic-runtime")
85 config.available_features.add("asan-static-runtime")
87 asan_lit_source_dir = get_required_attr(config, "asan_lit_source_dir")
88 if config.android == "1":
89 config.available_features.add('android')
93 config.available_features.add('not-android')
97 return " " + " ".join([clang_wrapper, config.clang] + compile_flags) + " "
99 config.substitutions.append( ("%clang ", build_invocation(target_cflags)) )
100 config.substitutions.append( ("%clangxx ", build_invocation(target_cxxflags)) )
101 config.substitutions.append( ("%clang_asan ", build_invocation(clang_asan_cflags)) )
102 config.substitutions.append( ("%clangxx_asan ", build_invocation(clang_asan_cxxflags)) )
103 config.substitutions.append( ("%shared_libasan", "libclang_rt.asan-%s.so" % config.target_arch))
104 if config.asan_dynamic:
105 config.substitutions.append( ("%clang_asan_static ", build_invocation(clang_asan_static_cflags)) )
106config.substitutions.append( ("%clangxx_asan_static ", build_invocation(clang_asan_static_cxxflags…
115 if config.asan_dynamic:
119 config.substitutions.append( ("%clang_cl_asan ", clang_cl_invocation) )
120 base_lib = os.path.join(config.compiler_rt_libdir, "clang_rt.asan%%s-%s.lib" % config.target_arch)
121 config.substitutions.append( ("%asan_lib", base_lib % "") )
122 config.substitutions.append( ("%asan_cxx_lib", base_lib % "_cxx") )
123 config.substitutions.append( ("%asan_dll_thunk", base_lib % "_dll_thunk") )
127 get_required_attr(config, "compiler_rt_src_root"), "lib", "asan")
132 python_exec = get_required_attr(config, "python_executable")
133 config.substitutions.append( ("%asan_symbolize", python_exec + " " + asan_symbolize + " ") )
136 get_required_attr(config, "compiler_rt_src_root"), "lib", "sanitizer_common")
140 python_exec = get_required_attr(config, "python_executable")
141 config.substitutions.append( ("%sancov", python_exec + " " + sancov + " ") )
144 if config.host_arch.find('64') != -1 and config.android != "1":
149 config.substitutions.append( ('CHECK-%kernel_bits', ("CHECK-kernel-" + kernel_bits + "-bits")))
151 config.substitutions.append( ("%libdl", libdl_flag) )
153 config.available_features.add("asan-" + config.bits + "-bits")
155 if config.host_os == 'Darwin':
156 config.substitutions.append( ("%ld_flags_rpath_exe", '-Wl,-rpath,@executable_path/ %dynamiclib') )
157config.substitutions.append( ("%ld_flags_rpath_so", '-install_name @rpath/`basename %dynamiclib`')…
158 elif config.host_os == 'FreeBSD':
159config.substitutions.append( ("%ld_flags_rpath_exe", "-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xd…
160 config.substitutions.append( ("%ld_flags_rpath_so", '') )
161 elif config.host_os == 'Linux':
162config.substitutions.append( ("%ld_flags_rpath_exe", "-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_name…
163 config.substitutions.append( ("%ld_flags_rpath_so", '') )
166 config.substitutions.append( ("%dynamiclib", '%T/lib%xdynamiclib_namespec.so') )
167 config.substitutions.append( ("%xdynamiclib_namespec", '$(basename %t).dynamic') )
171 if config.target_arch != 'arm' and config.target_arch != 'armhf' and config.target_arch != 'aarch64…
172 config.available_features.add('stable-runtime')
175 if config.host_os == 'Linux' and config.target_arch == 'x86_64':
176 config.available_features.add('leak-detection')
179 push_dynamic_library_lookup_path(config, config.compiler_rt_libdir)
182 if config.compiler_id == 'GNU':
183 gcc_dir = os.path.dirname(config.clang)
184 libasan_dir = os.path.join(gcc_dir, "..", "lib" + config.bits)
185 push_dynamic_library_lookup_path(config, libasan_dir)
188 config.suffixes = ['.c', '.cc', '.cpp']
190 if config.host_os == 'Darwin':
191 config.suffixes.append('.mm')
194 if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows']:
195 config.unsupported = True