[compiler-rt] 42478d1 - [compiler-rt] Removes CMake work-arounds.
Mark de Wever via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 7 08:42:46 PDT 2023
Author: Mark de Wever
Date: 2023-06-07T17:42:28+02:00
New Revision: 42478d1473da6c119bc8eb9aa17608bfc54ce086
URL: https://github.com/llvm/llvm-project/commit/42478d1473da6c119bc8eb9aa17608bfc54ce086
DIFF: https://github.com/llvm/llvm-project/commit/42478d1473da6c119bc8eb9aa17608bfc54ce086.diff
LOG: [compiler-rt] Removes CMake work-arounds.
CMake older than 3.20.0 is no longer supported.
This removes work-arounds for no longer supported versions.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D152102
Added:
Modified:
compiler-rt/cmake/Modules/AddCompilerRT.cmake
compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake
compiler-rt/lib/orc/CMakeLists.txt
compiler-rt/lib/tsan/rtl/CMakeLists.txt
Removed:
################################################################################
diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index 752ce2ff1c8f5..a72e279dd75e8 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -123,17 +123,6 @@ function(add_compiler_rt_component name)
add_dependencies(compiler-rt ${name})
endfunction()
-function(add_asm_sources output)
- set(${output} ${ARGN} PARENT_SCOPE)
- # CMake doesn't pass the correct architecture for Apple prior to CMake 3.19. https://gitlab.kitware.com/cmake/cmake/-/issues/20771
- # MinGW didn't work correctly with assembly prior to CMake 3.17. https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4287 and https://reviews.llvm.org/rGb780df052dd2b246a760d00e00f7de9ebdab9d09
- # Workaround these two issues by compiling as C.
- # Same workaround used in libunwind. Also update there if changed here.
- if((APPLE AND CMAKE_VERSION VERSION_LESS 3.19) OR (MINGW AND CMAKE_VERSION VERSION_LESS 3.17))
- set_source_files_properties(${ARGN} PROPERTIES LANGUAGE C)
- endif()
-endfunction()
-
macro(set_output_name output name arch)
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
set(${output} ${name})
diff --git a/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake
index d28b46463e7f5..d8a491dbbd732 100644
--- a/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake
@@ -10,18 +10,12 @@ set(linkopts
# Add `-Wl,-G`. Quoted from release notes of cmake-3.16.0
# > On AIX, runtime linking is no longer enabled by default.
# See https://cmake.org/cmake/help/latest/release/3.16.html
- if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
- set(linkopts -Wl,-G ${linkopts})
- endif()
+ set(linkopts -Wl,-G ${linkopts})
set(${link_flags} ${linkopts} PARENT_SCOPE)
endfunction()
function(get_aix_libatomic_type type)
- if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
- set(${type} SHARED PARENT_SCOPE)
- else()
- set(${type} MODULE PARENT_SCOPE)
- endif()
+ set(${type} MODULE PARENT_SCOPE)
endfunction()
macro(archive_aix_libatomic name libname)
diff --git a/compiler-rt/lib/orc/CMakeLists.txt b/compiler-rt/lib/orc/CMakeLists.txt
index acc37319974c4..7943f3ff3374d 100644
--- a/compiler-rt/lib/orc/CMakeLists.txt
+++ b/compiler-rt/lib/orc/CMakeLists.txt
@@ -83,7 +83,7 @@ if (TARGET cxx-headers OR HAVE_LIBCXX)
endif()
if (APPLE)
- add_asm_sources(ORC_ASM_SOURCES
+ set(ORC_ASM_SOURCES
macho_tlv.x86-64.S
macho_tlv.arm64.S
)
@@ -146,7 +146,7 @@ else() # not Apple
elfnix_platform.cpp
)
- add_asm_sources(ORC_ASM_SOURCES
+ set(ORC_ASM_SOURCES
elfnix_tls.x86-64.S
elfnix_tls.aarch64.S
)
diff --git a/compiler-rt/lib/tsan/rtl/CMakeLists.txt b/compiler-rt/lib/tsan/rtl/CMakeLists.txt
index c9e19e0f16c58..4107e04b87d8a 100644
--- a/compiler-rt/lib/tsan/rtl/CMakeLists.txt
+++ b/compiler-rt/lib/tsan/rtl/CMakeLists.txt
@@ -124,7 +124,7 @@ if(APPLE)
message(FATAL_ERROR "Building the TSan runtime requires at least macOS SDK 10.12 (or aligned SDK on other platforms)")
endif()
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_amd64.S
tsan_rtl_aarch64.S
)
@@ -171,7 +171,7 @@ if(APPLE)
else()
foreach(arch ${TSAN_SUPPORTED_ARCH})
if(arch STREQUAL "x86_64")
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_amd64.S
)
# Check for Go runtime.
@@ -185,7 +185,7 @@ else()
COMMENT "Checking TSan Go runtime..."
VERBATIM)
elseif(arch STREQUAL "aarch64")
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_aarch64.S
)
# Check for Go runtime.
@@ -199,7 +199,7 @@ else()
COMMENT "Checking TSan Go runtime..."
VERBATIM)
elseif(arch MATCHES "powerpc64|powerpc64le")
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_ppc64.S
)
# Check for Go runtime.
@@ -213,15 +213,15 @@ else()
COMMENT "Checking TSan Go runtime..."
VERBATIM)
elseif(arch MATCHES "loongarch64")
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_loongarch64.S
)
elseif(arch MATCHES "mips64|mips64le")
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_mips64.S
)
elseif(arch MATCHES "s390x")
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_s390x.S
)
# Check for Go runtime.
More information about the llvm-commits
mailing list