[compiler-rt] c21df2a - Revert "Re-apply "[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately""
Raul Tambre via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 14 08:44:01 PST 2020
Author: Raul Tambre
Date: 2020-12-14T18:43:55+02:00
New Revision: c21df2a79c268d1e0f467ec25a1ec7cb4aff5dfb
URL: https://github.com/llvm/llvm-project/commit/c21df2a79c268d1e0f467ec25a1ec7cb4aff5dfb
DIFF: https://github.com/llvm/llvm-project/commit/c21df2a79c268d1e0f467ec25a1ec7cb4aff5dfb.diff
LOG: Revert "Re-apply "[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately""
This reverts commit 03ebe1937192c247c4a7b8ec19dde2cf9845c914.
It's still breaking bots, e.g. http://green.lab.llvm.org/green/job/clang-stage1-RA/17027/console although it doesn't change any actual code.
The compile errors don't make much sense either. Revert for now.
Differential Revision: https://reviews.llvm.org/D93228
Added:
Modified:
compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
compiler-rt/lib/builtins/CMakeLists.txt
compiler-rt/lib/builtins/aarch64/lse.S
Removed:
################################################################################
diff --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
index 456a8dcda59f..f6689c2e79ad 100644
--- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -395,9 +395,7 @@ macro(darwin_add_builtin_libraries)
set(CMAKE_CXX_FLAGS "")
set(CMAKE_ASM_FLAGS "")
- append_string_if(COMPILER_RT_HAS_ASM_LSE " -DHAS_ASM_LSE" CFLAGS)
-
- set(PROFILE_SOURCES ../profile/InstrProfiling
+ set(PROFILE_SOURCES ../profile/InstrProfiling
../profile/InstrProfilingBuffer
../profile/InstrProfilingPlatformDarwin
../profile/InstrProfilingWriter
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 5259e951dff3..d84f4d09e53e 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -509,24 +509,31 @@ set(aarch64_SOURCES
)
# Generate outline atomics helpers from lse.S base
+set(CUSTOM_FLAGS ${CMAKE_C_FLAGS})
+if(NOT ANDROID)
+ append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG -DVISIBILITY_HIDDEN CUSTOM_FLAGS)
+endif()
+append_list_if(COMPILER_RT_HAS_ASM_LSE -DHAS_ASM_LSE CUSTOM_FLAGS)
+string(REPLACE " " "\t" CUSTOM_FLAGS "${CUSTOM_FLAGS}")
set(OA_HELPERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/outline_atomic_helpers.dir")
-file(MAKE_DIRECTORY "${OA_HELPERS_DIR}")
+file(MAKE_DIRECTORY ${OA_HELPERS_DIR})
foreach(pat cas swp ldadd ldclr ldeor ldset)
foreach(size 1 2 4 8 16)
foreach(model 1 2 3 4)
if(pat STREQUAL "cas" OR NOT size STREQUAL "16")
- set(helper_asm "${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S")
+ set(helper_asm ${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S)
add_custom_command(
OUTPUT ${helper_asm}
- COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S" "${helper_asm}"
+ COMMAND ${CMAKE_C_COMPILER} -E ${CUSTOM_FLAGS} -DL_${pat} -DSIZE=${size} -DMODEL=${model}
+ ${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S -o ${helper_asm}
+ DEPENDS aarch64/lse.S assembly.h
)
- set_source_files_properties("${helper_asm}"
- PROPERTIES
- COMPILE_DEFINITIONS "L_${pat};SIZE=${size};MODEL=${model}"
- INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}"
+ set_source_files_properties(${helper_asm} PROPERTIES GENERATED TRUE)
+ set(aarch64_SOURCES
+ ${aarch64_SOURCES}
+ ${helper_asm}
)
- list(APPEND aarch64_SOURCES "${helper_asm}")
endif()
endforeach(model)
endforeach(size)
@@ -680,8 +687,6 @@ else ()
append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG VISIBILITY_HIDDEN BUILTIN_DEFS)
endif()
- append_list_if(COMPILER_RT_HAS_ASM_LSE HAS_ASM_LSE BUILTIN_DEFS)
-
foreach (arch ${BUILTIN_SUPPORTED_ARCH})
if (CAN_TARGET_${arch})
# For ARM archs, exclude any VFP builtins if VFP is not supported
diff --git a/compiler-rt/lib/builtins/aarch64/lse.S b/compiler-rt/lib/builtins/aarch64/lse.S
index 7a9433fd89cf..770f098b7cf1 100644
--- a/compiler-rt/lib/builtins/aarch64/lse.S
+++ b/compiler-rt/lib/builtins/aarch64/lse.S
@@ -2,7 +2,7 @@
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-#include "assembly.h"
+#include "../assembly.h"
// Out-of-line LSE atomics helpers. Ported from libgcc library.
// N = {1, 2, 4, 8}
More information about the llvm-commits
mailing list