From fdc622b513610b53ddcdc0b40282df9beae369bd Mon Sep 17 00:00:00 2001 From: cyy Date: Wed, 8 Oct 2025 18:39:16 +0000 Subject: [PATCH] [CMake] Remove LLVM link code (#134940) This handling is not needed no recent LLVM APIs. Pull Request resolved: https://github.com/pytorch/pytorch/pull/134940 Approved by: https://github.com/ezyang, https://github.com/malfet --- caffe2/CMakeLists.txt | 9 --------- caffe2/unexported_symbols.lds | 1 - caffe2/version_script.lds | 4 ---- 3 files changed, 14 deletions(-) delete mode 100644 caffe2/unexported_symbols.lds delete mode 100644 caffe2/version_script.lds diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt index b844e41a6163..7ab54dfa86ad 100644 --- a/caffe2/CMakeLists.txt +++ b/caffe2/CMakeLists.txt @@ -904,15 +904,6 @@ if(USE_LLVM AND LLVM_FOUND) support core analysis executionengine instcombine scalaropts transformutils ${LLVM_TARGETS_TO_BUILD} orcjit) target_link_libraries(torch_cpu PRIVATE ${LLVM_LINK_LIBS}) - if(APPLE) - set(LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/unexported_symbols.lds") - set_target_properties(torch_cpu PROPERTIES LINK_DEPENDS ${LINKER_SCRIPT}) - set_target_properties(torch_cpu PROPERTIES LINK_FLAGS "-Wl,-unexported_symbols_list,${LINKER_SCRIPT}") - elseif(UNIX) - set(LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/version_script.lds") - set_target_properties(torch_cpu PROPERTIES LINK_DEPENDS ${LINKER_SCRIPT}) - target_link_libraries(torch_cpu PRIVATE "-Wl,--version-script=${LINKER_SCRIPT}") - endif() endif(USE_LLVM AND LLVM_FOUND) # This is required for older versions of CMake, which don't allow diff --git a/caffe2/unexported_symbols.lds b/caffe2/unexported_symbols.lds deleted file mode 100644 index a8b10ca3de1a..000000000000 --- a/caffe2/unexported_symbols.lds +++ /dev/null @@ -1 +0,0 @@ -*4llvm* diff --git a/caffe2/version_script.lds b/caffe2/version_script.lds deleted file mode 100644 index 8a97b5aef027..000000000000 --- a/caffe2/version_script.lds +++ /dev/null @@ -1,4 +0,0 @@ -pytorch { - local: - *4llvm*; -};