• Home
  • Raw
  • Download

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 if config.target_arch == 's390x':
78 clang_asan_static_cxxflags = config.cxx_mode_flags + clang_asan_static_cflags
80 if config.asan_dynamic:
83 config.available_features.add("asan-dynamic-runtime")
87 config.available_features.add("asan-static-runtime")
89 asan_lit_source_dir = get_required_attr(config, "asan_lit_source_dir")
90 if config.android == "1":
91 config.available_features.add('android')
95 config.available_features.add('not-android')
99 return " " + " ".join([clang_wrapper, config.clang] + compile_flags) + " "
101 config.substitutions.append( ("%clang ", build_invocation(target_cflags)) )
102 config.substitutions.append( ("%clangxx ", build_invocation(target_cxxflags)) )
103 config.substitutions.append( ("%clang_asan ", build_invocation(clang_asan_cflags)) )
104 config.substitutions.append( ("%clangxx_asan ", build_invocation(clang_asan_cxxflags)) )
105 config.substitutions.append( ("%shared_libasan", "libclang_rt.asan-%s.so" % config.target_arch))
106 if config.asan_dynamic:
107 config.substitutions.append( ("%clang_asan_static ", build_invocation(clang_asan_static_cflags)) )
108config.substitutions.append( ("%clangxx_asan_static ", build_invocation(clang_asan_static_cxxflags…
117 if config.asan_dynamic:
121 config.substitutions.append( ("%clang_cl_asan ", clang_cl_invocation) )
122 base_lib = os.path.join(config.compiler_rt_libdir, "clang_rt.asan%%s-%s.lib" % config.target_arch)
123 config.substitutions.append( ("%asan_lib", base_lib % "") )
124 config.substitutions.append( ("%asan_cxx_lib", base_lib % "_cxx") )
125 config.substitutions.append( ("%asan_dll_thunk", base_lib % "_dll_thunk") )
129 get_required_attr(config, "compiler_rt_src_root"), "lib", "asan")
134 python_exec = get_required_attr(config, "python_executable")
135 config.substitutions.append( ("%asan_symbolize", python_exec + " " + asan_symbolize + " ") )
138 get_required_attr(config, "compiler_rt_src_root"), "lib", "sanitizer_common")
142 python_exec = get_required_attr(config, "python_executable")
143 config.substitutions.append( ("%sancov ", python_exec + " " + sancov + " ") )
146 if config.host_arch.find('64') != -1 and config.android != "1":
151 config.substitutions.append( ('CHECK-%kernel_bits', ("CHECK-kernel-" + kernel_bits + "-bits")))
153 config.substitutions.append( ("%libdl", libdl_flag) )
155 config.available_features.add("asan-" + config.bits + "-bits")
157 if config.host_os == 'Darwin':
158 config.substitutions.append( ("%ld_flags_rpath_exe", '-Wl,-rpath,@executable_path/ %dynamiclib') )
159config.substitutions.append( ("%ld_flags_rpath_so", '-install_name @rpath/`basename %dynamiclib`')…
160 elif config.host_os == 'FreeBSD':
161config.substitutions.append( ("%ld_flags_rpath_exe", "-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xd…
162 config.substitutions.append( ("%ld_flags_rpath_so", '') )
163 elif config.host_os == 'Linux':
164config.substitutions.append( ("%ld_flags_rpath_exe", "-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_name…
165 config.substitutions.append( ("%ld_flags_rpath_so", '') )
168 config.substitutions.append( ("%dynamiclib", '%T/lib%xdynamiclib_namespec.so') )
169 config.substitutions.append( ("%xdynamiclib_namespec", '$(basename %t).dynamic') )
173 if config.target_arch != 'arm' and config.target_arch != 'armhf' and config.target_arch != 'aarch64…
174 config.available_features.add('stable-runtime')
177 if config.host_os == 'Linux' and config.target_arch == 'x86_64':
178 config.available_features.add('leak-detection')
181 push_dynamic_library_lookup_path(config, config.compiler_rt_libdir)
184 if config.compiler_id == 'GNU':
185 gcc_dir = os.path.dirname(config.clang)
186 libasan_dir = os.path.join(gcc_dir, "..", "lib" + config.bits)
187 push_dynamic_library_lookup_path(config, libasan_dir)
190 config.suffixes = ['.c', '.cc', '.cpp']
192 if config.host_os == 'Darwin':
193 config.suffixes.append('.mm')
196 if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows']:
197 config.unsupported = True