[PATCH] D96282: [CMake][AIX] Adjust plugin library externsion used on AIX
Xiangling Liao via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 18 13:55:00 PST 2021
Xiangling_L updated this revision to Diff 324763.
Xiangling_L marked 2 inline comments as done.
Xiangling_L added a comment.
Fix the regression on Linux;
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96282/new/
https://reviews.llvm.org/D96282
Files:
llvm/cmake/modules/HandleLLVMOptions.cmake
llvm/include/llvm/Config/config.h.cmake
llvm/unittests/Support/DynamicLibrary/CMakeLists.txt
llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
Index: llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
===================================================================
--- llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
+++ llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
@@ -26,7 +26,7 @@
void *Ptr = (void*)(intptr_t)TestA;
std::string Path = fs::getMainExecutable(Argv0, Ptr);
llvm::SmallString<256> Buf(path::parent_path(Path));
- path::append(Buf, (Name + LTDL_SHLIB_EXT).c_str());
+ path::append(Buf, (Name + LLVM_PLUGIN_EXT).c_str());
return std::string(Buf.str());
}
Index: llvm/unittests/Support/DynamicLibrary/CMakeLists.txt
===================================================================
--- llvm/unittests/Support/DynamicLibrary/CMakeLists.txt
+++ llvm/unittests/Support/DynamicLibrary/CMakeLists.txt
@@ -22,7 +22,7 @@
export_executable_symbols(DynamicLibraryTests)
function(dynlib_add_module NAME)
- add_library(${NAME} SHARED
+ add_library(${NAME} MODULE
PipSqueak.cpp
)
set_target_properties(${NAME} PROPERTIES FOLDER "Tests")
@@ -34,7 +34,7 @@
set_target_properties(${NAME}
PROPERTIES PREFIX ""
- SUFFIX ${LTDL_SHLIB_EXT}
+ SUFFIX ${LLVM_PLUGIN_EXT}
)
add_dependencies(DynamicLibraryTests ${NAME})
@@ -54,8 +54,8 @@
# Revert -Wl,-z,nodelete on this test since it relies on the file
# being unloaded.
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- string(REPLACE "-Wl,-z,nodelete" "" CMAKE_SHARED_LINKER_FLAGS
- ${CMAKE_SHARED_LINKER_FLAGS})
+ string(REPLACE "-Wl,-z,nodelete" "" CMAKE_MODULE_LINKER_FLAGS
+ ${CMAKE_MODULE_LINKER_FLAGS})
endif()
dynlib_add_module(PipSqueak)
Index: llvm/include/llvm/Config/config.h.cmake
===================================================================
--- llvm/include/llvm/Config/config.h.cmake
+++ llvm/include/llvm/Config/config.h.cmake
@@ -317,6 +317,9 @@
/* Define to the extension used for shared libraries, say, ".so". */
#cmakedefine LTDL_SHLIB_EXT "${LTDL_SHLIB_EXT}"
+/* Define to the extension used for plugin libraries, say, ".so". */
+#cmakedefine LLVM_PLUGIN_EXT "${LLVM_PLUGIN_EXT}"
+
/* Define to the address where bug reports for this package should be sent. */
#cmakedefine PACKAGE_BUGREPORT "${PACKAGE_BUGREPORT}"
Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -153,7 +153,11 @@
set(LTDL_SHLIB_EXT ${CMAKE_SHARED_LIBRARY_SUFFIX})
# We use *.dylib rather than *.so on darwin.
-set(LLVM_PLUGIN_EXT ${CMAKE_SHARED_LIBRARY_SUFFIX})
+if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
+ set(LLVM_PLUGIN_EXT ${CMAKE_SHARED_MODULE_SUFFIX})
+else()
+ set(LLVM_PLUGIN_EXT ${CMAKE_SHARED_LIBRARY_SUFFIX})
+endif()
if(APPLE)
if(LLVM_ENABLE_LLD AND LLVM_ENABLE_LTO)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96282.324763.patch
Type: text/x-patch
Size: 2873 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210218/d54c3412/attachment.bin>
More information about the llvm-commits
mailing list