[compiler-rt] ae79854 - [AIX][compiler-rt] Deliver libatomic.a at top level library directory
Kai Luo via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 28 20:14:29 PDT 2021
Author: Kai Luo
Date: 2021-06-29T03:14:20Z
New Revision: ae79854e1c597962b74cb13293fcd5d31a2ca9bc
URL: https://github.com/llvm/llvm-project/commit/ae79854e1c597962b74cb13293fcd5d31a2ca9bc
DIFF: https://github.com/llvm/llvm-project/commit/ae79854e1c597962b74cb13293fcd5d31a2ca9bc.diff
LOG: [AIX][compiler-rt] Deliver libatomic.a at top level library directory
Install libatomic.a in top level library directory so that compiler can find it in search directories.
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D104908
Added:
Modified:
compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake
Removed:
################################################################################
diff --git a/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake
index 983d97df2d29..3b61430f471e 100644
--- a/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake
@@ -57,8 +57,16 @@ macro(archive_aix_libatomic name)
if(shared_libraries_to_archive)
set(output_dir "")
set(install_dir "")
- get_compiler_rt_output_dir(${COMPILER_RT_DEFAULT_TARGET_ARCH} output_dir)
- get_compiler_rt_install_dir(${COMPILER_RT_DEFAULT_TARGET_ARCH} install_dir)
+ # If LLVM defines top level library directory, we want to deliver
+ # libatomic.a at top level. See `llvm/cmake/modules/AddLLVM.cmake'
+ # setting _install_rpath on AIX for reference.
+ if(LLVM_LIBRARY_OUTPUT_INTDIR AND CMAKE_INSTALL_PREFIX)
+ set(output_dir "${LLVM_LIBRARY_OUTPUT_INTDIR}")
+ set(install_dir "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}")
+ else()
+ 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"
${shared_libraries_to_archive}
More information about the llvm-commits
mailing list