Skip to content

Commit 42478d1

Browse files
committed
[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
1 parent 617e601 commit 42478d1

File tree

4 files changed

+11
-28
lines changed

4 files changed

+11
-28
lines changed

compiler-rt/cmake/Modules/AddCompilerRT.cmake

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,6 @@ function(add_compiler_rt_component name)
123123
add_dependencies(compiler-rt ${name})
124124
endfunction()
125125

126-
function(add_asm_sources output)
127-
set(${output} ${ARGN} PARENT_SCOPE)
128-
# CMake doesn't pass the correct architecture for Apple prior to CMake 3.19. https://gitlab.kitware.com/cmake/cmake/-/issues/20771
129-
# 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
130-
# Workaround these two issues by compiling as C.
131-
# Same workaround used in libunwind. Also update there if changed here.
132-
if((APPLE AND CMAKE_VERSION VERSION_LESS 3.19) OR (MINGW AND CMAKE_VERSION VERSION_LESS 3.17))
133-
set_source_files_properties(${ARGN} PROPERTIES LANGUAGE C)
134-
endif()
135-
endfunction()
136-
137126
macro(set_output_name output name arch)
138127
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
139128
set(${output} ${name})

compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,12 @@ set(linkopts
1010
# Add `-Wl,-G`. Quoted from release notes of cmake-3.16.0
1111
# > On AIX, runtime linking is no longer enabled by default.
1212
# See https://cmake.org/cmake/help/latest/release/3.16.html
13-
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
14-
set(linkopts -Wl,-G ${linkopts})
15-
endif()
13+
set(linkopts -Wl,-G ${linkopts})
1614
set(${link_flags} ${linkopts} PARENT_SCOPE)
1715
endfunction()
1816

1917
function(get_aix_libatomic_type type)
20-
if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
21-
set(${type} SHARED PARENT_SCOPE)
22-
else()
23-
set(${type} MODULE PARENT_SCOPE)
24-
endif()
18+
set(${type} MODULE PARENT_SCOPE)
2519
endfunction()
2620

2721
macro(archive_aix_libatomic name libname)

compiler-rt/lib/orc/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ if (TARGET cxx-headers OR HAVE_LIBCXX)
8383
endif()
8484

8585
if (APPLE)
86-
add_asm_sources(ORC_ASM_SOURCES
86+
set(ORC_ASM_SOURCES
8787
macho_tlv.x86-64.S
8888
macho_tlv.arm64.S
8989
)
@@ -146,7 +146,7 @@ else() # not Apple
146146
elfnix_platform.cpp
147147
)
148148

149-
add_asm_sources(ORC_ASM_SOURCES
149+
set(ORC_ASM_SOURCES
150150
elfnix_tls.x86-64.S
151151
elfnix_tls.aarch64.S
152152
)

compiler-rt/lib/tsan/rtl/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ if(APPLE)
124124
message(FATAL_ERROR "Building the TSan runtime requires at least macOS SDK 10.12 (or aligned SDK on other platforms)")
125125
endif()
126126

127-
add_asm_sources(TSAN_ASM_SOURCES
127+
set(TSAN_ASM_SOURCES
128128
tsan_rtl_amd64.S
129129
tsan_rtl_aarch64.S
130130
)
@@ -171,7 +171,7 @@ if(APPLE)
171171
else()
172172
foreach(arch ${TSAN_SUPPORTED_ARCH})
173173
if(arch STREQUAL "x86_64")
174-
add_asm_sources(TSAN_ASM_SOURCES
174+
set(TSAN_ASM_SOURCES
175175
tsan_rtl_amd64.S
176176
)
177177
# Check for Go runtime.
@@ -185,7 +185,7 @@ else()
185185
COMMENT "Checking TSan Go runtime..."
186186
VERBATIM)
187187
elseif(arch STREQUAL "aarch64")
188-
add_asm_sources(TSAN_ASM_SOURCES
188+
set(TSAN_ASM_SOURCES
189189
tsan_rtl_aarch64.S
190190
)
191191
# Check for Go runtime.
@@ -199,7 +199,7 @@ else()
199199
COMMENT "Checking TSan Go runtime..."
200200
VERBATIM)
201201
elseif(arch MATCHES "powerpc64|powerpc64le")
202-
add_asm_sources(TSAN_ASM_SOURCES
202+
set(TSAN_ASM_SOURCES
203203
tsan_rtl_ppc64.S
204204
)
205205
# Check for Go runtime.
@@ -213,15 +213,15 @@ else()
213213
COMMENT "Checking TSan Go runtime..."
214214
VERBATIM)
215215
elseif(arch MATCHES "loongarch64")
216-
add_asm_sources(TSAN_ASM_SOURCES
216+
set(TSAN_ASM_SOURCES
217217
tsan_rtl_loongarch64.S
218218
)
219219
elseif(arch MATCHES "mips64|mips64le")
220-
add_asm_sources(TSAN_ASM_SOURCES
220+
set(TSAN_ASM_SOURCES
221221
tsan_rtl_mips64.S
222222
)
223223
elseif(arch MATCHES "s390x")
224-
add_asm_sources(TSAN_ASM_SOURCES
224+
set(TSAN_ASM_SOURCES
225225
tsan_rtl_s390x.S
226226
)
227227
# Check for Go runtime.

0 commit comments

Comments
 (0)