libRemarks.{so,dylib}: remove Remarks.dylib.exports
authorFangrui Song <i@maskray.me>
Thu, 2 Feb 2023 23:13:04 +0000 (15:13 -0800)
committerFangrui Song <i@maskray.me>
Thu, 2 Feb 2023 23:13:04 +0000 (15:13 -0800)
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
llvm/tools/remarks-shlib/Remarks.dylib.exports [deleted file]

index 2f108a4..bc4bd67 100644 (file)
@@ -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 (file)
index 0c2a3c3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-LLVMRemarkVersion