[compiler-rt] Removes CMake work-arounds.
authorMark de Wever <koraq@xs4all.nl>
Sun, 4 Jun 2023 15:44:30 +0000 (17:44 +0200)
committerMark de Wever <koraq@xs4all.nl>
Wed, 7 Jun 2023 15:42:28 +0000 (17:42 +0200)
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

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

index 752ce2ff1c8f576932a42b4102c1790c92ad0dcb..a72e279dd75e8fe76e65c9031d2425388d3b3273 100644 (file)
@@ -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})
index d28b46463e7f5661060023c23c0b6dd68807b314..d8a491dbbd732a6166af88ffbc247b4262a3b781 100644 (file)
@@ -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)
index acc37319974c48468c8574f6c8e8644b5d582df4..7943f3ff3374df4872ce307f4a267b075cddf6b8 100644 (file)
@@ -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
       )
index c9e19e0f16c587480cf9c1f7ed78963ddfff8991..4107e04b87d8ae5d6ac9a2e470a308284b8ed581 100644 (file)
@@ -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.