[PATCH] D105148: [CMake] Don't use -Bsymbolic-functions for MinGW targets

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 30 12:55:07 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGbf6770f9bd60: [CMake] Don't use -Bsymbolic-functions for MinGW targets (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105148/new/

https://reviews.llvm.org/D105148

Files:
  clang/tools/clang-shlib/CMakeLists.txt
  llvm/tools/llvm-shlib/CMakeLists.txt


Index: llvm/tools/llvm-shlib/CMakeLists.txt
===================================================================
--- llvm/tools/llvm-shlib/CMakeLists.txt
+++ llvm/tools/llvm-shlib/CMakeLists.txt
@@ -50,11 +50,13 @@
       # Solaris ld does not accept global: *; so there is no way to version *all* global symbols
       set(LIB_NAMES -Wl,--version-script,${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map ${LIB_NAMES})
     endif()
-    # Optimize function calls for default visibility definitions to avoid PLT and
-    # reduce dynamic relocations.
-    # Note: for -fno-pic default, the address of a function may be different from
-    # inside and outside libLLVM.so.
-    target_link_options(LLVM PRIVATE LINKER:-Bsymbolic-functions)
+    if (NOT MINGW)
+      # Optimize function calls for default visibility definitions to avoid PLT and
+      # reduce dynamic relocations.
+      # Note: for -fno-pic default, the address of a function may be different from
+      # inside and outside libLLVM.so.
+      target_link_options(LLVM PRIVATE LINKER:-Bsymbolic-functions)
+    endif()
   elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
     set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
   endif()
Index: clang/tools/clang-shlib/CMakeLists.txt
===================================================================
--- clang/tools/clang-shlib/CMakeLists.txt
+++ clang/tools/clang-shlib/CMakeLists.txt
@@ -50,6 +50,6 @@
                   ${_DEPS})
 # Optimize function calls for default visibility definitions to avoid PLT and
 # reduce dynamic relocations.
-if (NOT APPLE)
+if (NOT APPLE AND NOT MINGW)
   target_link_options(clang-cpp PRIVATE LINKER:-Bsymbolic-functions)
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105148.355671.patch
Type: text/x-patch
Size: 1691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210630/2912c3ca/attachment.bin>


More information about the llvm-commits mailing list