Lines Matching refs:config
27 config.recursiveExpansionLimit = 10
30 config.test_format = lit.formats.ShTest(execute_external)
32 config.available_features.add('shell')
34 compiler_id = getattr(config, 'compiler_id', None)
37 config.cxx_mode_flags = ["--driver-mode=g++"]
39 config.cxx_mode_flags = []
42 config.debug_info_flags = ["-gline-tables-only"]
47 config.debug_info_flags.append("-gcodeview")
48 config.debug_info_flags.append("-gcolumn-info")
50 config.cxx_mode_flags = ["-x c++"]
51 config.debug_info_flags = ["-g"]
55 config.available_features.add(compiler_id)
58 if config.asan_shadow_scale != '':
59 config.target_cflags += " -mllvm -asan-mapping-scale=" + config.asan_shadow_scale
60 if config.memprof_shadow_scale != '':
61 config.target_cflags += " -mllvm -memprof-mapping-scale=" + config.memprof_shadow_scale
63 config.environment = dict(os.environ)
82 if name in config.environment:
83 del config.environment[name]
86 if (not config.llvm_tools_dir) or (not os.path.exists(config.llvm_tools_dir)):
87 lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % config.llvm_tools_dir)
88 path = os.path.pathsep.join((config.llvm_tools_dir, config.environment['PATH']))
89 config.environment['PATH'] = path
93 if platform.system() == 'Windows' and '-win' in config.target_triple:
94 config.environment['LIB'] = os.environ['LIB']
96 config.available_features.add(config.host_os.lower())
98 if re.match(r'^x86_64.*-linux', config.target_triple):
99 config.available_features.add("x86_64-linux")
101 config.available_features.add("host-byteorder-" + sys.byteorder + "-endian")
103 if config.have_zlib == "1":
104 config.available_features.add("zlib")
108 config.substitutions.append(
112 if config.host_os == 'NetBSD':
113 nb_commands_dir = os.path.join(config.compiler_rt_src_root,
115 config.netbsd_noaslr_prefix = ('sh ' +
117 config.netbsd_nomprotect_prefix = ('sh ' +
120 config.substitutions.append( ('%run_nomprotect',
121 config.netbsd_nomprotect_prefix) )
123 config.substitutions.append( ('%run_nomprotect', '%run') )
130 val = getattr(config, name, None)
139 config.substitutions.append( ('%run', emulator) )
140 config.substitutions.append( ('%env ', "env ") )
144 config.substitutions.append( ('%device_rm', 'echo ') )
145 config.compile_wrapper = ""
146 elif config.host_os == 'Darwin' and config.apple_platform != "osx":
163 ios_or_iossim = "iossim" if config.apple_platform.endswith("sim") else "ios"
165 config.available_features.add('ios')
168 config.available_features.add('iossim')
173 if config.apple_platform != "ios" and config.apple_platform != "iossim":
174 config.available_features.add(config.apple_platform)
176 …ios_commands_dir = os.path.join(config.compiler_rt_src_root, "test", "sanitizer_common", "ios_comm…
184 config.environment[device_id_env] = os.environ[device_id_env]
185 config.substitutions.append(('%run', run_wrapper))
186 config.substitutions.append(('%env ', env_wrapper + " "))
189 config.substitutions.append(('%device_rm', '{} rm '.format(run_wrapper)))
190 config.compile_wrapper = compile_wrapper
193 …prepare_output = subprocess.check_output([prepare_script, config.apple_platform, config.clang]).de…
201 config.environment.update(prepare_output["env"])
202 elif config.android:
203 config.available_features.add('android')
204 …compile_wrapper = os.path.join(config.compiler_rt_src_root, "test", "sanitizer_common", "android_c…
205 config.compile_wrapper = compile_wrapper
206 config.substitutions.append( ('%run', "") )
207 config.substitutions.append( ('%env ', "env ") )
209 config.substitutions.append( ('%run', "") )
210 config.substitutions.append( ('%env ', "env ") )
212 config.substitutions.append( ('%device_rm', 'echo ') )
213 config.compile_wrapper = ""
216 config.substitutions.append( ('CHECK-%os', ("CHECK-" + config.host_os)))
219 config.substitutions.append( ('%arch', (config.host_arch)))
221 if config.host_os == 'Windows':
226 config.expect_crash = "not KillTheDoctor "
228 config.expect_crash = "not --crash "
230 config.substitutions.append( ("%expect_crash ", config.expect_crash) )
232 target_arch = getattr(config, 'target_arch', None)
234 config.available_features.add(target_arch + '-target-arch')
236 config.available_features.add('x86-target-arch')
237 config.available_features.add(target_arch + '-' + config.host_os.lower())
239 compiler_rt_debug = getattr(config, 'compiler_rt_debug', False)
241 config.available_features.add('compiler-rt-optimized')
243 libdispatch = getattr(config, 'compiler_rt_intercept_libdispatch', False)
245 config.available_features.add('libdispatch')
247 sanitizer_can_use_cxxabi = getattr(config, 'sanitizer_can_use_cxxabi', True)
249 config.available_features.add('cxxabi')
251 if config.has_lld:
252 config.available_features.add('lld-available')
254 if config.use_lld:
255 config.available_features.add('lld')
257 if config.can_symbolize:
258 config.available_features.add('can-symbolize')
260 if config.gwp_asan:
261 config.available_features.add('gwp_asan')
263 lit.util.usePlatformSdkOnDarwin(config, lit_config)
270 config.substitutions.append( ('%darwin_min_target_with_tls_support', '%min_macos_deployment_target=…
272 if config.host_os == 'Darwin':
280 config.available_features.add('osx-autointerception')
281 config.available_features.add('osx-ld64-live_support')
285 config.darwin_osx_version = osx_version
294 config.available_features.add('x86_64h')
299 if config.apple_platform == "iossim":
300 if config.target_arch == "i386":
301 config.unsupported = True
304 platform = config.apple_platform
330 flag = config.apple_platform_min_deployment_target_flag
332 …config.substitutions.append( ('%%min_macos_deployment_target=%s.%s' % vers, '{}={}.{}'.format(flag…
335 config.substitutions.append( ('%%min_macos_deployment_target=%s.%s' % vers, '') )
337 if config.android:
339 if config.android_serial:
340 env['ANDROID_SERIAL'] = config.android_serial
341 config.environment['ANDROID_SERIAL'] = config.android_serial
347 config.substitutions.append( ('%device_rundir', "/data/local/tmp/Output") )
348 …config.substitutions.append( ('%push_to_device', "%s -s '%s' push " % (adb, env['ANDROID_SERIAL'])…
349 …config.substitutions.append( ('%pull_from_device', "%s -s '%s' pull " % (adb, env['ANDROID_SERIAL'…
350 …config.substitutions.append( ('%adb_shell ', "%s -s '%s' shell " % (adb, env['ANDROID_SERIAL']) ) )
351 …config.substitutions.append( ('%device_rm', "%s -s '%s' shell 'rm ' " % (adb, env['ANDROID_SERIAL'…
362 android_api_level = min(android_api_level, int(config.android_api_level))
365 config.available_features.add('android-%s' % required)
368 config.available_features.add('android-thread-properties-api')
373 for file in config.android_files_to_push:
376 config.substitutions.append( ('%device_rundir', "") )
377 config.substitutions.append( ('%push_to_device', "echo ") )
378 config.substitutions.append( ('%pull_from_device', "echo ") )
379 config.substitutions.append( ('%adb_shell', "echo ") )
381 if config.host_os == 'Linux':
389 if not config.android and ver_line.startswith(b"ldd "):
394 config.available_features.add("glibc-" + required)
396 sancovcc_path = os.path.join(config.llvm_tools_dir, "sancov")
398 config.available_features.add("has_sancovcc")
399 config.substitutions.append( ("%sancovcc ", sancovcc_path) )
402 return os.path.exists(os.path.join(config.llvm_shlib_dir, 'libLTO.dylib'))
405 if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'LLVMgold.so')):
410 for exe in (config.gnu_ld_executable, config.gold_executable):
420 return os.path.exists(os.path.join(config.llvm_tools_dir, 'lld-link.exe'))
422 if config.host_os == 'Darwin' and is_darwin_lto_supported():
423 config.lto_supported = True
424 config.lto_launch = ["env", "DYLD_LIBRARY_PATH=" + config.llvm_shlib_dir]
425 config.lto_flags = []
426 elif config.host_os in ['Linux', 'FreeBSD', 'NetBSD']:
427 config.lto_supported = False
428 if config.use_lld:
429 config.lto_supported = True
431 config.available_features.add('binutils_lto')
432 config.lto_supported = True
434 if config.lto_supported:
435 config.lto_launch = []
436 if config.use_lld:
437 config.lto_flags = ["-fuse-ld=lld"]
439 config.lto_flags = ["-fuse-ld=gold"]
440 elif config.host_os == 'Windows' and is_windows_lto_supported():
441 config.lto_supported = True
442 config.lto_launch = []
443 config.lto_flags = ["-fuse-ld=lld"]
445 config.lto_supported = False
447 if config.lto_supported:
448 config.available_features.add('lto')
449 if config.use_thinlto:
450 config.available_features.add('thinlto')
451 config.lto_flags += ["-flto=thin"]
453 config.lto_flags += ["-flto"]
454 if config.use_newpm:
455 config.lto_flags += ["-fexperimental-new-pass-manager"]
457 if config.have_rpc_xdr_h:
458 config.available_features.add('sunrpc')
463 [os.path.join(config.llvm_tools_dir, 'llvm-config'), '--assertion-mode'],
465 env=config.environment)
467 print("Could not launch llvm-config in " + config.llvm_tools_dir)
472 config.available_features.add('asserts')
478 config.test_retry_attempts = 2
484 ios_device = config.apple_platform != 'osx' and not config.apple_platform.endswith('sim')
489 config.parallelism_group = 'ios-device'
494 elif config.target_arch in ['x86_64', 'x86_64h']:
503 if config.host_os == 'Darwin':
504 …config.substitutions.append( ("%ld_flags_rpath_exe" + postfix, '-Wl,-rpath,@executable_path/ %dyna…
505 …config.substitutions.append( ("%ld_flags_rpath_so" + postfix, '-install_name @rpath/`basename %dyn…
506 elif config.host_os in ('FreeBSD', 'NetBSD', 'OpenBSD'):
507 …config.substitutions.append( ("%ld_flags_rpath_exe" + postfix, "-Wl,-z,origin -Wl,-rpath,\$ORIGIN …
508 config.substitutions.append( ("%ld_flags_rpath_so" + postfix, '') )
509 elif config.host_os == 'Linux':
510 …config.substitutions.append( ("%ld_flags_rpath_exe" + postfix, "-Wl,-rpath,\$ORIGIN -L%T -l%xdynam…
511 config.substitutions.append( ("%ld_flags_rpath_so" + postfix, '') )
512 elif config.host_os == 'SunOS':
513 …config.substitutions.append( ("%ld_flags_rpath_exe" + postfix, "-Wl,-R\$ORIGIN -L%T -l%xdynamiclib…
514 config.substitutions.append( ("%ld_flags_rpath_so" + postfix, '') )
517 config.substitutions.append( ("%dynamiclib" + postfix, '%T/%xdynamiclib_filename' + postfix) )
518 …config.substitutions.append( ("%xdynamiclib_filename" + postfix, 'lib%xdynamiclib_namespec{}.so'.f…
519 config.substitutions.append( ("%xdynamiclib_namespec", '%basename_t.dynamic') )
524 if config.host_os == 'Linux':
525 …config.substitutions.append( ("%linux_static_libstdcplusplus", "-stdlib=libstdc++ -static-libstdc+…
527 config.substitutions.append( ("%linux_static_libstdcplusplus", "") )
529 config.default_sanitizer_opts = []
530 if config.host_os == 'Darwin':
533 config.default_sanitizer_opts += ['abort_on_error=0']
534 config.default_sanitizer_opts += ['log_to_syslog=0']
543 config.available_features.add('darwin_log_cmd')
548 elif config.android:
549 config.default_sanitizer_opts += ['abort_on_error=0']
553 if config.android or (config.target_arch not in ['arm', 'armhf', 'aarch64']):
554 config.available_features.add('stable-runtime')
556 if config.asan_shadow_scale:
557 config.available_features.add("shadow-scale-%s" % config.asan_shadow_scale)
559 config.available_features.add("shadow-scale-3")
561 if config.memprof_shadow_scale:
562 config.available_features.add("memprof-shadow-scale-%s" % config.memprof_shadow_scale)
564 config.available_features.add("memprof-shadow-scale-3")
566 if config.expensive_checks:
567 config.available_features.add("expensive_checks")
571 target_cflags = [getattr(config, 'target_cflags', None)]
574 if config.use_lto and config.lto_supported:
575 run_wrapper += config.lto_launch
576 extra_cflags += config.lto_flags
577 elif config.use_lto and (not config.lto_supported):
578 config.unsupported = True
580 if config.use_lld and config.has_lld and not config.use_lto:
582 elif config.use_lld and (not config.has_lld):
583 config.unsupported = True
591 config.clang = " " + " ".join(run_wrapper + [config.compile_wrapper, config.clang]) + " "
592 config.target_cflags = " " + " ".join(target_cflags + extra_cflags) + " "