Hide all symbols in llvm namespace (#63272)
authorBert Maher <bertrand@fb.com>
Sun, 15 Aug 2021 18:28:23 +0000 (11:28 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sun, 15 Aug 2021 18:29:43 +0000 (11:29 -0700)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/63272

Test Plan: Imported from OSS

Reviewed By: nikithamalgifb

Differential Revision: D30331695

Pulled By: bertmaher

fbshipit-source-id: d35130c96f7e2a31fa86d9d80de59002e96301df

caffe2/CMakeLists.txt
caffe2/unexported_symbols.lds
caffe2/version_script.lds

index 83048ce..6194554 100644 (file)
@@ -815,7 +815,7 @@ if(USE_LLVM AND LLVM_FOUND)
   elseif(UNIX)
     set(LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/version_script.lds")
     set_target_properties(torch_cpu PROPERTIES LINK_DEPENDS ${LINKER_SCRIPT})
-    set_target_properties(torch_cpu PROPERTIES LINK_FLAGS "-Wl,--version-script=${LINKER_SCRIPT}")
+    target_link_libraries(torch_cpu PRIVATE "-Wl,--version-script=${LINKER_SCRIPT}")
   endif()
 endif(USE_LLVM AND LLVM_FOUND)
 
index 900c6b8..8a97b5a 100644 (file)
@@ -1,7 +1,4 @@
 pytorch {
-  global:
-    *;
   local:
-    _ZN4llvm*;
-    _ZNK4llvm*;
+    *4llvm*;
 };