radford created this revision.
radford added a reviewer: arphaman.
Herald added a subscriber: mgorny.
radford requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Compiling LLVM, as a cmake sub-project that compiles with visibility
hidden, will generate a "cannot export hidden symbol" error because we
require default visibility.  Even though we export using
-Wl,-exported_symbols_list,libclang.exports, if each .cpp file is
compiled with -fvisibility=hidden, then you'll get this warning and
linking will fail. Essentially -exported_symbols_list is not strong
enough to reverse the -fvisibility=hidden.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100896

Files:
  clang/cmake/modules/AddClang.cmake


Index: clang/cmake/modules/AddClang.cmake
===================================================================
--- clang/cmake/modules/AddClang.cmake
+++ clang/cmake/modules/AddClang.cmake
@@ -142,6 +142,7 @@
     endif()
   endforeach()
 
+  set_target_properties(${name} PROPERTIES CXX_VISIBILITY_PRESET default)
   set_target_properties(${name} PROPERTIES FOLDER "Clang libraries")
   set_clang_windows_version_resource_properties(${name})
 endmacro(add_clang_library)


Index: clang/cmake/modules/AddClang.cmake
===================================================================
--- clang/cmake/modules/AddClang.cmake
+++ clang/cmake/modules/AddClang.cmake
@@ -142,6 +142,7 @@
     endif()
   endforeach()
 
+  set_target_properties(${name} PROPERTIES CXX_VISIBILITY_PRESET default)
   set_target_properties(${name} PROPERTIES FOLDER "Clang libraries")
   set_clang_windows_version_resource_properties(${name})
 endmacro(add_clang_library)
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to