From: Bert Maher Date: Sun, 15 Aug 2021 18:28:23 +0000 (-0700) Subject: Hide all symbols in llvm namespace (#63272) X-Git-Tag: accepted/tizen/8.0/unified/20231005.095509~1012 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ce4d30c4466ad9b0402e221329070a97be545ea;p=platform%2Fupstream%2Fpytorch.git Hide all symbols in llvm namespace (#63272) 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 --- diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt index 83048ce..6194554 100644 --- a/caffe2/CMakeLists.txt +++ b/caffe2/CMakeLists.txt @@ -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) diff --git a/caffe2/unexported_symbols.lds b/caffe2/unexported_symbols.lds index 7c05d20..a8b10ca 100644 --- a/caffe2/unexported_symbols.lds +++ b/caffe2/unexported_symbols.lds @@ -1,2 +1 @@ -__ZN4llvm* -__ZNK4llvm* +*4llvm* diff --git a/caffe2/version_script.lds b/caffe2/version_script.lds index 900c6b8..8a97b5a 100644 --- a/caffe2/version_script.lds +++ b/caffe2/version_script.lds @@ -1,7 +1,4 @@ pytorch { - global: - *; local: - _ZN4llvm*; - _ZNK4llvm*; + *4llvm*; };