Skip to content

Commit 5724769

Browse files
committed
[LLVM] Pass correct target to LLVM_RUNTIMES_TARGET for runtimes
Summary: When doing a multilib build, we pass `+feature` as the canonical runtime name. Currently, this is being passed through to the `LLVM_RUNTIMES_TARGET` which is supposed to imply the cross-compiling target as a triple. The `+feature` will be present, making it invalid. This patch separates the runtimes name from the target name.
1 parent f12078e commit 5724769

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/runtimes/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ function(runtime_default_target)
297297
${EXTRA_ARGS} ${ARG_EXTRA_ARGS})
298298
endfunction()
299299

300-
# runtime_register_target(name)
300+
# runtime_register_target(name target)
301301
# Utility function to register external runtime target.
302-
function(runtime_register_target name)
302+
function(runtime_register_target name target)
303303
cmake_parse_arguments(ARG "" "BASE_NAME" "DEPENDS;CMAKE_ARGS;EXTRA_ARGS" ${ARGN})
304304
include(${LLVM_BINARY_DIR}/runtimes/${name}/Components.cmake OPTIONAL)
305305
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${LLVM_BINARY_DIR}/runtimes/${name}/Components.cmake)
@@ -414,7 +414,7 @@ function(runtime_register_target name)
414414
-DCMAKE_Fortran_COMPILER_WORKS=ON
415415
-DCMAKE_ASM_COMPILER_WORKS=ON
416416
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
417-
-DLLVM_RUNTIMES_TARGET=${name}
417+
-DLLVM_RUNTIMES_TARGET=${target}
418418
${COMMON_CMAKE_ARGS}
419419
${${name}_extra_args}
420420
EXTRA_TARGETS ${${name}_extra_targets}
@@ -605,15 +605,15 @@ if(build_runtimes)
605605

606606
check_apple_target(${name} runtime)
607607

608-
runtime_register_target(${name}
608+
runtime_register_target(${name} ${name}
609609
DEPENDS ${builtins_dep_name} ${extra_deps}
610610
CMAKE_ARGS -DLLVM_DEFAULT_TARGET_TRIPLE=${name} ${extra_cmake_args}
611611
EXTRA_ARGS TARGET_TRIPLE ${name} ${extra_args})
612612
endforeach()
613613

614614
foreach(multilib ${LLVM_RUNTIME_MULTILIBS})
615615
foreach(name ${LLVM_RUNTIME_MULTILIB_${multilib}_TARGETS})
616-
runtime_register_target(${name}+${multilib}
616+
runtime_register_target(${name}+${multilib} ${name}
617617
DEPENDS runtimes-${name}
618618
CMAKE_ARGS -DLLVM_DEFAULT_TARGET_TRIPLE=${name}
619619
-DLLVM_RUNTIMES_PREFIX=${name}/

0 commit comments

Comments
 (0)