diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake --- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake +++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake @@ -123,17 +123,6 @@ 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 --- a/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake @@ -10,18 +10,12 @@ # 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 --- a/compiler-rt/lib/orc/CMakeLists.txt +++ b/compiler-rt/lib/orc/CMakeLists.txt @@ -83,7 +83,7 @@ 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 @@ 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 --- a/compiler-rt/lib/tsan/rtl/CMakeLists.txt +++ b/compiler-rt/lib/tsan/rtl/CMakeLists.txt @@ -124,7 +124,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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.