-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LLVM][runtimes] Prepopulate LLVM_BUILTIN_TARGETS
with runtimes values
#95554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,12 @@ foreach(proj ${LLVM_ENABLE_RUNTIMES}) | |
endforeach() | ||
|
||
function(get_compiler_rt_path path) | ||
foreach(entry ${runtimes}) | ||
set(all_runtimes ${runtimes}) | ||
foreach(name ${LLVM_RUNTIME_TARGETS}) | ||
list(APPEND all_runtimes ${RUNTIMES_${name}_LLVM_ENABLE_RUNTIMES}) | ||
endforeach() | ||
list(REMOVE_DUPLICATES all_runtimes) | ||
foreach(entry ${all_runtimes}) | ||
get_filename_component(projName ${entry} NAME) | ||
if("${projName}" MATCHES "compiler-rt") | ||
set(${path} ${entry} PARENT_SCOPE) | ||
|
@@ -138,37 +143,44 @@ endfunction() | |
# before the just-built compiler can pass the configuration tests. | ||
get_compiler_rt_path(compiler_rt_path) | ||
if(compiler_rt_path) | ||
if(NOT LLVM_BUILTIN_TARGETS) | ||
# If the user did not specify the targets infer them from the runtimes. | ||
set(builtin_targets ${LLVM_BUILTIN_TARGETS}) | ||
if(NOT builtin_targets) | ||
if("compiler-rt" IN_LIST LLVM_ENABLE_RUNTIMES) | ||
list(APPEND builtin_targets "default") | ||
endif() | ||
Comment on lines
+149
to
+151
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure that applying DRY here is worth it. I'd rather just duplicate the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need the following case to work,
Honestly I think we should get rid of the distinction between the "default" target, but that's a much larger refactoring I think @petrhosek wanted to do. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "default" target is also important for how the compiler-rt parts of this are built on Darwin, which is a mess. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I have a WIP change that removes the |
||
foreach(name ${LLVM_RUNTIME_TARGETS}) | ||
if("compiler-rt" IN_LIST RUNTIMES_${name}_LLVM_ENABLE_RUNTIMES) | ||
list(APPEND builtin_targets ${name}) | ||
endif() | ||
endforeach() | ||
endif() | ||
if("default" IN_LIST builtin_targets) | ||
builtin_default_target(${compiler_rt_path} | ||
DEPENDS clang-resource-headers) | ||
list(REMOVE_ITEM builtin_targets "default") | ||
else() | ||
if("default" IN_LIST LLVM_BUILTIN_TARGETS) | ||
builtin_default_target(${compiler_rt_path} | ||
DEPENDS clang-resource-headers) | ||
list(REMOVE_ITEM LLVM_BUILTIN_TARGETS "default") | ||
else() | ||
add_custom_target(builtins) | ||
add_custom_target(install-builtins) | ||
add_custom_target(install-builtins-stripped) | ||
set_target_properties( | ||
builtins install-builtins install-builtins-stripped | ||
PROPERTIES FOLDER "Compiler-RT" | ||
) | ||
endif() | ||
add_custom_target(builtins) | ||
add_custom_target(install-builtins) | ||
add_custom_target(install-builtins-stripped) | ||
set_target_properties( | ||
builtins install-builtins install-builtins-stripped | ||
PROPERTIES FOLDER "Compiler-RT" | ||
) | ||
endif() | ||
|
||
foreach(target ${LLVM_BUILTIN_TARGETS}) | ||
check_apple_target(${target} builtin) | ||
foreach(target ${builtin_targets}) | ||
check_apple_target(${target} builtin) | ||
|
||
builtin_register_target(${compiler_rt_path} ${target} | ||
DEPENDS clang-resource-headers | ||
CMAKE_ARGS -DLLVM_DEFAULT_TARGET_TRIPLE=${target} | ||
EXTRA_ARGS TARGET_TRIPLE ${target}) | ||
builtin_register_target(${compiler_rt_path} ${target} | ||
DEPENDS clang-resource-headers | ||
CMAKE_ARGS -DLLVM_DEFAULT_TARGET_TRIPLE=${target} | ||
EXTRA_ARGS TARGET_TRIPLE ${target}) | ||
|
||
add_dependencies(builtins builtins-${target}) | ||
add_dependencies(install-builtins install-builtins-${target}) | ||
add_dependencies(install-builtins-stripped install-builtins-${target}-stripped) | ||
endforeach() | ||
endif() | ||
add_dependencies(builtins builtins-${target}) | ||
add_dependencies(install-builtins install-builtins-${target}) | ||
add_dependencies(install-builtins-stripped install-builtins-${target}-stripped) | ||
endforeach() | ||
set(builtins_dep builtins) | ||
# We don't need to depend on the builtins if we're building instrumented | ||
# because the next stage will use the same compiler used to build this stage. | ||
|
Uh oh!
There was an error while loading. Please reload this page.