[compiler-rt] 26c1d68 - [compiler-rt] Disable ranlib when using libtool
Shoaib Meenai via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 13:49:20 PDT 2020
Author: Shoaib Meenai
Date: 2020-08-24T13:48:28-07:00
New Revision: 26c1d689ae4cd24d228df1c35a2067fa970c52cc
URL: https://github.com/llvm/llvm-project/commit/26c1d689ae4cd24d228df1c35a2067fa970c52cc
DIFF: https://github.com/llvm/llvm-project/commit/26c1d689ae4cd24d228df1c35a2067fa970c52cc.diff
LOG: [compiler-rt] Disable ranlib when using libtool
libtool already produces a table of contents, and ranlib just gives
spurious errors because it doesn't understand universal binaries.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D86365
Added:
Modified:
compiler-rt/cmake/Modules/UseLibtool.cmake
Removed:
################################################################################
diff --git a/compiler-rt/cmake/Modules/UseLibtool.cmake b/compiler-rt/cmake/Modules/UseLibtool.cmake
index 38d197d4846f..130810c970d8 100644
--- a/compiler-rt/cmake/Modules/UseLibtool.cmake
+++ b/compiler-rt/cmake/Modules/UseLibtool.cmake
@@ -34,6 +34,14 @@ if(CMAKE_LIBTOOL)
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
"\"${CMAKE_LIBTOOL}\" -static ${LIBTOOL_NO_WARNING_FLAG} -o <TARGET> <LINK_FLAGS> <OBJECTS>")
endforeach()
+
+ # By default, CMake invokes ranlib on a static library after installing it.
+ # libtool will have produced the table of contents for us already, and ranlib
+ # does not understanding universal binaries, so skip this step. It's important
+ # to set it to empty instead of unsetting it to shadow the cache variable, and
+ # we don't want to unset the cache variable to not affect anything outside
+ # this scope.
+ set(CMAKE_RANLIB "")
endif()
# If DYLD_LIBRARY_PATH is set we need to set it on archiver commands
More information about the llvm-commits
mailing list