Lines Matching +full:- +full:- +full:config

1 # -*- Python -*-
18 config.name = 'LLVM'
21 config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
25 config.suffixes = ['.ll', '.c', '.test', '.txt', '.s', '.mir', '.yaml']
30 config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']
33 config.test_source_root = os.path.dirname(__file__)
36 config.test_exec_root = os.path.join(config.llvm_obj_root, 'test')
39 llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
47 top_ocaml_lib = os.path.join(config.llvm_lib_dir, 'ocaml')
66 if not 'Address' in config.llvm_use_sanitizer or \
67 not 'Darwin' in config.host_os or \
68 not 'x86' in config.host_triple:
77 host_lib_dir = os.path.join(os.path.dirname(config.host_cc), '../lib')
87 config.substitutions.append(('%FileCheckWithUnusedPrefixes%',
88 'FileCheck --allow-unused-prefixes=true'))
92 # Add site-specific substitutions.
93 config.substitutions.append(('%llvmshlibdir', config.llvm_shlib_dir))
94 config.substitutions.append(('%shlibext', config.llvm_shlib_ext))
95 config.substitutions.append(('%exeext', config.llvm_exe_ext))
104 if re.search(r'cygwin|windows-gnu|windows-msvc', config.host_triple):
105 lli_args = ['-mtriple=' + config.host_triple + '-elf']
110 if re.search(r'windows-msvc', config.target_triple):
111 llc_args = [' -mtriple=' +
112 config.target_triple.replace('-msvc', '-gnu')]
117 ld64_cmd = config.ld64_executable
122 ocamlc_command = '%s ocamlc -cclib -L%s %s' % (
123 config.ocamlfind_executable, config.llvm_lib_dir, config.ocaml_flags)
125 if config.have_ocamlopt:
126 ocamlopt_command = '%s ocamlopt -cclib -L%s -cclib -Wl,-rpath,%s %s' % (
127 config.ocamlfind_executable, config.llvm_lib_dir, config.llvm_lib_dir, config.ocaml_flags)
129 opt_viewer_cmd = '%s %s/tools/opt-viewer/opt-viewer.py' % (sys.executable, config.llvm_src_root)
131 llvm_locstats_tool = os.path.join(config.llvm_tools_dir, 'llvm-locstats')
132 config.substitutions.append(
133 ('%llvm-locstats', "'%s' %s" % (config.python_executable, llvm_locstats_tool)))
134 config.llvm_locstats_used = os.path.exists(llvm_locstats_tool)
139 ToolSubst('%go', config.go_executable, unresolved='ignore'),
140 ToolSubst('%gold', config.gold_executable, unresolved='ignore'),
144 ToolSubst('%opt-viewer', opt_viewer_cmd),
145 ToolSubst('%llvm-objcopy', FindTool('llvm-objcopy')),
146 ToolSubst('%llvm-strip', FindTool('llvm-strip')),
147 ToolSubst('%llvm-install-name-tool', FindTool('llvm-install-name-tool')),
148 ToolSubst('%llvm-bitcode-strip', FindTool('llvm-bitcode-strip')),
149 ToolSubst('%split-file', FindTool('split-file')),
154 'dsymutil', 'lli', 'lli-child-target', 'llvm-ar', 'llvm-as',
155 'llvm-addr2line', 'llvm-bcanalyzer', 'llvm-bitcode-strip', 'llvm-config',
156 'llvm-cov', 'llvm-cxxdump', 'llvm-cvtres', 'llvm-diff', 'llvm-dis',
157 'llvm-dwarfdump', 'llvm-dlltool', 'llvm-exegesis', 'llvm-extract',
158 'llvm-isel-fuzzer', 'llvm-ifs',
159 'llvm-install-name-tool', 'llvm-jitlink', 'llvm-opt-fuzzer', 'llvm-lib',
160 'llvm-link', 'llvm-lto', 'llvm-lto2', 'llvm-mc', 'llvm-mca',
161 'llvm-modextract', 'llvm-nm', 'llvm-objcopy', 'llvm-objdump',
162 'llvm-pdbutil', 'llvm-profdata', 'llvm-ranlib', 'llvm-rc', 'llvm-readelf',
163 'llvm-readobj', 'llvm-rtdyld', 'llvm-size', 'llvm-split', 'llvm-strings',
164 'llvm-strip', 'llvm-tblgen', 'llvm-undname', 'llvm-c-test', 'llvm-cxxfilt',
165 'llvm-xray', 'yaml2obj', 'obj2yaml', 'yaml-bench', 'verify-uselistorder',
166 'bugpoint', 'llc', 'llvm-symbolizer', 'opt', 'sancov', 'sanstats'])
170 ToolSubst('llvm-go', unresolved='ignore'),
171 ToolSubst('llvm-mt', unresolved='ignore'),
172 ToolSubst('Kaleidoscope-Ch3', unresolved='ignore'),
173 ToolSubst('Kaleidoscope-Ch4', unresolved='ignore'),
174 ToolSubst('Kaleidoscope-Ch5', unresolved='ignore'),
175 ToolSubst('Kaleidoscope-Ch6', unresolved='ignore'),
176 ToolSubst('Kaleidoscope-Ch7', unresolved='ignore'),
177 ToolSubst('Kaleidoscope-Ch8', unresolved='ignore'),
180 llvm_config.add_tool_substitutions(tools, config.llvm_tools_dir)
184 config.targets = frozenset(config.targets_to_build.split())
186 for arch in config.targets_to_build.split():
187 config.available_features.add(arch.lower() + '-registered-target')
191 if (config.host_ldflags.find("-m32") < 0
192 and any(config.llvm_host_triple.startswith(x) for x in known_arches)):
193 config.available_features.add("llvm-64-bits")
195 config.available_features.add("host-byteorder-" + sys.byteorder + "-endian")
199 config.available_features.add('uses_COFF')
201 # Others/can-execute.txt
202 config.available_features.add('can-execute')
205 if config.has_plugins:
206 config.available_features.add('plugins')
208 if config.build_examples:
209 config.available_features.add('examples')
211 if config.linked_bye_extension:
212 config.substitutions.append(('%llvmcheckext', 'CHECK-EXT'))
213 config.substitutions.append(('%loadbye', ''))
214 config.substitutions.append(('%loadnewpmbye', ''))
216 config.substitutions.append(('%llvmcheckext', 'CHECK-NOEXT'))
217 config.substitutions.append(('%loadbye',
218 '-load={}/Bye{}'.format(config.llvm_shlib_dir,
219 config.llvm_shlib_ext)))
220 config.substitutions.append(('%loadnewpmbye',
221 '-load-pass-plugin={}/Bye{}'
222 .format(config.llvm_shlib_dir,
223 config.llvm_shlib_ext)))
227 if not config.build_shared_libs and not config.link_llvm_dylib:
228 config.available_features.add('static-libs')
230 if config.have_tf_aot:
231 config.available_features.add("have_tf_aot")
233 if config.have_tf_api:
234 config.available_features.add("have_tf_api")
237 readobj_exe = lit.util.which('llvm-readobj', config.llvm_tools_dir)
239 print('llvm-readobj not found')
244 [readobj_exe, '-needed-libs', readobj_exe], stdout=subprocess.PIPE)
246 print('could not exec llvm-readobj')
264 config.available_features.add('cxx-shared-library')
266 if config.libcxx_used:
267 config.available_features.add('libcxx-used')
271 if config.target_triple:
272 config.available_features.add('default_triple')
278 if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'LLVMgold' + config.llvm_shlib_ext)):
282 [config.gold_executable, '--help'], stdout=subprocess.PIPE, env={'LANG': 'C'})
286 if not '-plugin' in ld_out:
301 config.available_features.add('ld_emu_elf32ppc')
304 [config.gold_executable, '--version'], stdout=subprocess.PIPE, env={'LANG': 'C'})
313 config.available_features.add('ld_plugin')
317 if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'libLTO' + config.llvm_shlib_ext)):
320 if config.ld64_executable == '':
324 [config.ld64_executable, '-v'], stderr=subprocess.PIPE)
335 config.available_features.add('ld64_plugin')
337 # Ask llvm-config about asserts
339 [('--assertion-mode', {'ON': 'asserts'}),
340 ('--build-mode', {'[Dd][Ee][Bb][Uu][Gg]': 'debug'})])
354 config.available_features.add('fma3')
357 if not re.match(r'^x86_64.*-(windows-gnu|windows-msvc)', config.target_triple):
358 config.available_features.add('debug_frame')
360 if config.have_libxar:
361 config.available_features.add('xar')
363 if config.enable_threads:
364 config.available_features.add('thread_support')
366 if config.have_libxml2:
367 config.available_features.add('libxml2')
369 if config.have_opt_viewer_modules:
370 config.available_features.add('have_opt_viewer_modules')
372 if config.expensive_checks:
373 config.available_features.add('expensive_checks')