Revert "[LLVM] Replace use of LLVM_RUNTIMES_TARGET with LLVM_DEFAULT_TARGET_TRIPLE (#136208)"

This reverts commit 2e145f11c0.

Somehow causes some static assertions to fail?
This commit is contained in:
Joseph Huber
2025-04-22 08:08:26 -05:00
parent 974a8ccb2b
commit a5cdbef5f0
6 changed files with 24 additions and 23 deletions

View File

@@ -223,9 +223,9 @@ endif()
# The GPU targets require a few mandatory arguments to make the standard CMake
# check flags happy.
if ("${LLVM_DEFAULT_TARGET_TRIPLE}" MATCHES "^amdgcn")
if ("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nogpulib")
elseif ("${LLVM_DEFAULT_TARGET_TRIPLE}" MATCHES "^nvptx")
elseif ("${LLVM_RUNTIMES_TARGET}" MATCHES "^nvptx")
set(CMAKE_REQUIRED_FLAGS
"${CMAKE_REQUIRED_FLAGS} -flto -c -Wno-unused-command-line-argument")
endif()

View File

@@ -107,10 +107,11 @@ The `CMAKE_Fortran_COMPILER_WORKS` parameter must be set because otherwise CMake
will test whether the Fortran compiler can compile and link programs which will
obviously fail without a runtime library available yet.
Building Flang-RT for cross-compilation triple, the target triple can be
selected using `LLVM_DEFAULT_TARGET_TRIPLE`. Of course, Flang-RT can be built
multiple times with different build configurations, but have to be located
manually when using with the Flang driver using the `-L` option.
Building Flang-RT for cross-compilation triple, the target triple can
be selected using `LLVM_DEFAULT_TARGET_TRIPLE` AND `LLVM_RUNTIMES_TARGET`.
Of course, Flang-RT can be built multiple times with different build
configurations, but have to be located manually when using with the Flang
driver using the `-L` option.
After configuration, build, test, and install the runtime via

View File

@@ -234,11 +234,11 @@ function (add_flangrt_library name)
endif ()
# Add target specific options if necessary.
if ("${LLVM_DEFAULT_TARGET_TRIPLE}" MATCHES "^amdgcn")
if ("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn")
target_compile_options(${tgtname} PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:-nogpulib -flto -fvisibility=hidden>
)
elseif ("${LLVM_DEFAULT_TARGET_TRIPLE}" MATCHES "^nvptx")
elseif ("${LLVM_RUNTIMES_TARGET}" MATCHES "^nvptx")
target_compile_options(${tgtname} PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:-nogpulib -flto -fvisibility=hidden -Wno-unknown-cuda-version --cuda-feature=+ptx63>
)

View File

@@ -172,7 +172,7 @@ else ()
set(f128_sources "")
endif ()
if ("${LLVM_DEFAULT_TARGET_TRIPLE}" MATCHES "^amdgcn|^nvptx")
if ("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn|^nvptx")
set(sources ${gpu_sources})
else ()
set(sources ${supported_sources} ${host_sources} ${f128_sources})