Skip to content

Commit 494f411

Browse files
author
git apple-llvm automerger
committed
Merge commit '724e17329614' from apple/main into swift/next
2 parents f904289 + 724e173 commit 494f411

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,7 @@ macro(darwin_add_builtin_libraries)
395395
set(CMAKE_CXX_FLAGS "")
396396
set(CMAKE_ASM_FLAGS "")
397397

398-
append_string_if(COMPILER_RT_HAS_ASM_LSE " -DHAS_ASM_LSE" CFLAGS)
399-
400-
set(PROFILE_SOURCES ../profile/InstrProfiling
398+
set(PROFILE_SOURCES ../profile/InstrProfiling
401399
../profile/InstrProfilingBuffer
402400
../profile/InstrProfilingPlatformDarwin
403401
../profile/InstrProfilingWriter

compiler-rt/lib/builtins/CMakeLists.txt

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -509,24 +509,31 @@ set(aarch64_SOURCES
509509
)
510510

511511
# Generate outline atomics helpers from lse.S base
512+
set(CUSTOM_FLAGS ${CMAKE_C_FLAGS})
513+
if(NOT ANDROID)
514+
append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG -DVISIBILITY_HIDDEN CUSTOM_FLAGS)
515+
endif()
516+
append_list_if(COMPILER_RT_HAS_ASM_LSE -DHAS_ASM_LSE CUSTOM_FLAGS)
517+
string(REPLACE " " "\t" CUSTOM_FLAGS "${CUSTOM_FLAGS}")
512518
set(OA_HELPERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/outline_atomic_helpers.dir")
513-
file(MAKE_DIRECTORY "${OA_HELPERS_DIR}")
519+
file(MAKE_DIRECTORY ${OA_HELPERS_DIR})
514520

515521
foreach(pat cas swp ldadd ldclr ldeor ldset)
516522
foreach(size 1 2 4 8 16)
517523
foreach(model 1 2 3 4)
518524
if(pat STREQUAL "cas" OR NOT size STREQUAL "16")
519-
set(helper_asm "${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S")
525+
set(helper_asm ${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S)
520526
add_custom_command(
521527
OUTPUT ${helper_asm}
522-
COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S" "${helper_asm}"
528+
COMMAND ${CMAKE_C_COMPILER} -E ${CUSTOM_FLAGS} -DL_${pat} -DSIZE=${size} -DMODEL=${model}
529+
${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S -o ${helper_asm}
530+
DEPENDS aarch64/lse.S assembly.h
523531
)
524-
set_source_files_properties("${helper_asm}"
525-
PROPERTIES
526-
COMPILE_DEFINITIONS "L_${pat};SIZE=${size};MODEL=${model}"
527-
INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}"
532+
set_source_files_properties(${helper_asm} PROPERTIES GENERATED TRUE)
533+
set(aarch64_SOURCES
534+
${aarch64_SOURCES}
535+
${helper_asm}
528536
)
529-
list(APPEND aarch64_SOURCES "${helper_asm}")
530537
endif()
531538
endforeach(model)
532539
endforeach(size)
@@ -680,8 +687,6 @@ else ()
680687
append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG VISIBILITY_HIDDEN BUILTIN_DEFS)
681688
endif()
682689

683-
append_list_if(COMPILER_RT_HAS_ASM_LSE HAS_ASM_LSE BUILTIN_DEFS)
684-
685690
foreach (arch ${BUILTIN_SUPPORTED_ARCH})
686691
if (CAN_TARGET_${arch})
687692
# For ARM archs, exclude any VFP builtins if VFP is not supported

compiler-rt/lib/builtins/aarch64/lse.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// See https://llvm.org/LICENSE.txt for license information.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5-
#include "assembly.h"
5+
#include "../assembly.h"
66

77
// Out-of-line LSE atomics helpers. Ported from libgcc library.
88
// N = {1, 2, 4, 8}

0 commit comments

Comments
 (0)