[PATCH] D108467: [CMake][AIX] Disable visibility options in build
David Tenty via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 20 08:46:21 PDT 2021
daltenty created this revision.
daltenty added reviewers: hubert.reinterpretcast, sfertile, stevewan.
Herald added subscribers: hiraditya, mgorny.
daltenty requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Visibility options currently have limited support on AIX and may cause warnings or errors
depending on the build compiler used.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D108467
Files:
llvm/cmake/modules/HandleLLVMOptions.cmake
llvm/lib/Target/CMakeLists.txt
Index: llvm/lib/Target/CMakeLists.txt
===================================================================
--- llvm/lib/Target/CMakeLists.txt
+++ llvm/lib/Target/CMakeLists.txt
@@ -22,6 +22,7 @@
# When building shared objects for each target there are some internal APIs
# that are used across shared objects which we can't hide.
if (NOT BUILD_SHARED_LIBS AND NOT APPLE AND
+ NOT (${CMAKE_SYSTEM_NAME} MATCHES "AIX") AND
NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET)
# Set default visibility to hidden, so we don't export all the Target classes
# in libLLVM.so.
Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -341,9 +341,9 @@
endif()
endif()
-if(NOT WIN32 AND NOT CYGWIN AND NOT (${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
+if(NOT WIN32 AND NOT CYGWIN AND NOT (${CMAKE_SYSTEM_NAME} MATCHES "AIX"))
# MinGW warns if -fvisibility-inlines-hidden is used.
- # GCC on AIX warns if -fvisibility-inlines-hidden is used.
+ # GCC on AIX warns if -fvisibility-inlines-hidden is used and Clang on AIX doesn't currently support visibility.
check_cxx_compiler_flag("-fvisibility-inlines-hidden" SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG)
append_if(SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG "-fvisibility-inlines-hidden" CMAKE_CXX_FLAGS)
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108467.367796.patch
Type: text/x-patch
Size: 1462 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210820/bcbe5283/attachment.bin>
More information about the llvm-commits
mailing list