Skip to content

[builtins][CMake] Replace custom target for lse_builtin symlinks #66936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions compiler-rt/lib/builtins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,13 @@ foreach(pat cas swp ldadd ldclr ldeor ldset)
foreach(size 1 2 4 8 16)
foreach(model 1 2 3 4 5)
if(pat STREQUAL "cas" OR NOT size STREQUAL "16")
set(source_asm "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S")
set(helper_asm "${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S")
list(APPEND lse_builtins "${helper_asm}")
list(APPEND arm64_lse_commands COMMAND ${CMAKE_COMMAND} -E ${COMPILER_RT_LINK_OR_COPY} "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S" "${helper_asm}")
add_custom_command(
OUTPUT "${helper_asm}"
COMMAND ${CMAKE_COMMAND} -E ${COMPILER_RT_LINK_OR_COPY} "${source_asm}" "${helper_asm}"
DEPENDS "${source_asm}"
)
set_source_files_properties("${helper_asm}"
PROPERTIES
COMPILE_DEFINITIONS "L_${pat};SIZE=${size};MODEL=${model}"
Expand Down Expand Up @@ -827,16 +831,6 @@ else ()
list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128)
endif()

if(arch STREQUAL "aarch64")
add_custom_target(
lse_builtin_symlinks
BYPRODUCTS ${lse_builtins}
${arm64_lse_commands}
)

set(deps_aarch64 lse_builtin_symlinks)
endif()

add_compiler_rt_runtime(clang_rt.builtins
STATIC
ARCHS ${arch}
Expand Down