[compiler-rt] eb3730c - [AIX][cmake][NFC] Customize name of output atomic library
Kai Luo via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 27 18:32:02 PST 2022
Author: Kai Luo
Date: 2022-02-28T02:31:56Z
New Revision: eb3730cf89950bdae6f86409558c52a8bab62df6
URL: https://github.com/llvm/llvm-project/commit/eb3730cf89950bdae6f86409558c52a8bab62df6
DIFF: https://github.com/llvm/llvm-project/commit/eb3730cf89950bdae6f86409558c52a8bab62df6.diff
LOG: [AIX][cmake][NFC] Customize name of output atomic library
Let `archive-aix-libatomic` accept additional argument to customize name of output atomic library.
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D120534
Added:
Modified:
compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake
compiler-rt/lib/builtins/CMakeLists.txt
Removed:
################################################################################
diff --git a/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake
index b35ff2b86568d..0e131d0ba74c0 100644
--- a/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake
@@ -24,7 +24,7 @@ function(get_aix_libatomic_type type)
endif()
endfunction()
-macro(archive_aix_libatomic name)
+macro(archive_aix_libatomic name libname)
cmake_parse_arguments(LIB
""
""
@@ -33,7 +33,7 @@ macro(archive_aix_libatomic name)
set(objects_to_archive "")
foreach (arch ${LIB_ARCHS})
if(CAN_TARGET_${arch})
- set(output_dir "${CMAKE_CURRENT_BINARY_DIR}/libatomic-${arch}.dir")
+ set(output_dir "${CMAKE_CURRENT_BINARY_DIR}/${libname}-${arch}.dir")
# FIXME: Target name should be kept consistent with definition
# in AddCompilerRT.cmake added by
# add_compiler_rt_runtime(<name> SHARED ...)
@@ -67,14 +67,14 @@ macro(archive_aix_libatomic name)
get_compiler_rt_output_dir(${COMPILER_RT_DEFAULT_TARGET_ARCH} output_dir)
get_compiler_rt_install_dir(${COMPILER_RT_DEFAULT_TARGET_ARCH} install_dir)
endif()
- add_custom_command(OUTPUT "${output_dir}/libatomic.a"
- COMMAND ${CMAKE_AR} -X32_64 r "${output_dir}/libatomic.a"
+ add_custom_command(OUTPUT "${output_dir}/${libname}.a"
+ COMMAND ${CMAKE_AR} -X32_64 r "${output_dir}/${libname}.a"
${objects_to_archive}
DEPENDS ${objects_to_archive})
- install(FILES "${output_dir}/libatomic.a"
+ install(FILES "${output_dir}/${libname}.a"
DESTINATION ${install_dir})
- add_custom_target(aix-libatomic
- DEPENDS "${output_dir}/libatomic.a")
+ add_custom_target(aix-${libname}
+ DEPENDS "${output_dir}/${libname}.a")
endif()
- add_dependencies(${LIB_PARENT_TARGET} aix-libatomic)
+ add_dependencies(${LIB_PARENT_TARGET} aix-${libname})
endmacro()
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index ea5ad9cdb8643..d9c317e2a1e4e 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -803,7 +803,7 @@ if(COMPILER_RT_BUILD_STANDALONE_LIBATOMIC)
# archive, i.e., libatomic.a. Once cmake adds support of such usage for AIX,
# this ad-hoc part can be removed.
if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
- archive_aix_libatomic(clang_rt.atomic
+ archive_aix_libatomic(clang_rt.atomic libatomic
ARCHS ${BUILTIN_SUPPORTED_ARCH}
PARENT_TARGET builtins-standalone-atomic)
endif()
More information about the llvm-commits
mailing list