From bf07de38b05e4c952beb4009aa15060d0e4f7cc7 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 2 Feb 2023 15:13:04 -0800 Subject: [PATCH] libRemarks.{so,dylib}: remove Remarks.dylib.exports Remarks.exports is only intended for NOT (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) builds. For (unintended use case) BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB (the latter is used by some Linux distros), the library defines just one symbol on ELF. There is no need to use a version script. I think this is a more proper solution than D139932 and fixes `symbol not defined` errors after lld default change D135402. --- llvm/tools/remarks-shlib/CMakeLists.txt | 4 +--- llvm/tools/remarks-shlib/Remarks.dylib.exports | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 llvm/tools/remarks-shlib/Remarks.dylib.exports diff --git a/llvm/tools/remarks-shlib/CMakeLists.txt b/llvm/tools/remarks-shlib/CMakeLists.txt index 2f108a42c9aa..bc4bd67e2c9e 100644 --- a/llvm/tools/remarks-shlib/CMakeLists.txt +++ b/llvm/tools/remarks-shlib/CMakeLists.txt @@ -9,9 +9,7 @@ if(LLVM_ENABLE_PIC) libremarks.cpp ) - if (LLVM_LINK_LLVM_DYLIB) - set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.dylib.exports) - else() + if (NOT (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB)) set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) endif() diff --git a/llvm/tools/remarks-shlib/Remarks.dylib.exports b/llvm/tools/remarks-shlib/Remarks.dylib.exports deleted file mode 100644 index 0c2a3c38c78c..000000000000 --- a/llvm/tools/remarks-shlib/Remarks.dylib.exports +++ /dev/null @@ -1 +0,0 @@ -LLVMRemarkVersion