Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions compiler-rt/cmake/Modules/CompilerRTUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,9 @@ macro(construct_compiler_rt_default_triple)
# Pass the necessary flags to make flag detection work.
if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "amdgcn")
set(COMPILER_RT_GPU_BUILD ON)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nogpulib")
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "nvptx")
set(COMPILER_RT_GPU_BUILD ON)
set(CMAKE_REQUIRED_FLAGS
"${CMAKE_REQUIRED_FLAGS} -flto -c -Wno-unused-command-line-argument")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -flto -c")
endif()
endif()

Expand Down
9 changes: 0 additions & 9 deletions flang-rt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,6 @@ endif()
# System Introspection #
########################

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

include(CheckCXXSymbolExists)
include(CheckCXXSourceCompiles)
check_cxx_symbol_exists(strerror_r string.h HAVE_STRERROR_R)
Expand Down
6 changes: 0 additions & 6 deletions libc/cmake/modules/prepare_libc_gpu_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ endif()
if(LIBC_TARGET_TRIPLE)
set(CMAKE_REQUIRED_FLAGS "--target=${LIBC_TARGET_TRIPLE}")
endif()
if(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nogpulib")
elseif(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
set(CMAKE_REQUIRED_FLAGS
"${CMAKE_REQUIRED_FLAGS} -flto -c -Wno-unused-command-line-argument")
endif()

# Optionally set up a job pool to limit the number of GPU tests run in parallel.
# This is sometimes necessary as running too many tests in parallel can cause
Expand Down
6 changes: 0 additions & 6 deletions llvm/cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,6 @@ if( LLVM_ENABLE_ASSERTIONS )
endif()
endif()

# If we are targeting a GPU architecture in a runtimes build we want to ignore
# all the standard flag handling.
if(LLVM_RUNTIMES_GPU_BUILD)
return()
endif()

if(LLVM_ENABLE_EXPENSIVE_CHECKS)
# When LLVM_ENABLE_EXPENSIVE_CHECKS is ON, LLVM will intercept errors
# using assert(). An explicit check is performed here.
Expand Down
8 changes: 0 additions & 8 deletions openmp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@ else()
set(CMAKE_CXX_EXTENSIONS NO)
endif()

# Targeting the GPU directly requires a few flags to make CMake happy.
if("${CMAKE_CXX_COMPILER_TARGET}" MATCHES "^amdgcn")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nogpulib")
elseif("${CMAKE_CXX_COMPILER_TARGET}" MATCHES "^nvptx")
set(CMAKE_REQUIRED_FLAGS
"${CMAKE_REQUIRED_FLAGS} -flto -c -Wno-unused-command-line-argument")
endif()

# Check and set up common compiler flags.
include(config-ix)
include(HandleOpenMPOptions)
Expand Down
11 changes: 5 additions & 6 deletions runtimes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,14 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
endif()
endif()

# The NVPTX target needs to override linking to pass compiler flag checks.
if("${LLVM_RUNTIMES_TARGET}" MATCHES "^nvptx")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -flto -c")
endif()

# Avoid checking whether the compiler is working.
set(LLVM_COMPILER_CHECKED ON)

# This can be used to detect whether we're targeting a GPU architecture.
if("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn" OR
"${LLVM_RUNTIMES_TARGET}" MATCHES "^nvptx64")
set(LLVM_RUNTIMES_GPU_BUILD ON)
endif()

# Handle common options used by all runtimes.
include(AddLLVM)
include(HandleLLVMOptions)
Expand Down
Loading