[PATCH] D53553: [CMake] Allow undefined unwinder API reference when compiler does not specify unwinder lib (in this case clang + compiler-rt) There is also a similar patch for compiler-rt, which will be submitted in a separate patch in compiler-rt tree.

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 22 20:33:21 PDT 2018


tabloid.adroit created this revision.
Herald added subscribers: llvm-commits, chrib, mgorny, dberris.

Repository:
  rL LLVM

https://reviews.llvm.org/D53553

Files:
  lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
  unittests/Support/DynamicLibrary/CMakeLists.txt


Index: unittests/Support/DynamicLibrary/CMakeLists.txt
===================================================================
--- unittests/Support/DynamicLibrary/CMakeLists.txt
+++ unittests/Support/DynamicLibrary/CMakeLists.txt
@@ -19,6 +19,9 @@
     PipSqueak.cpp
     )
   set_target_properties(${NAME} PROPERTIES FOLDER "Tests")
+  if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    target_link_libraries(${NAME} PRIVATE gcc_s)
+  endif()
 
   set_output_directory(${NAME}
     BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
Index: lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
===================================================================
--- lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
+++ lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
@@ -1,3 +1,11 @@
+# Ignore undef of __register_frame / __deregister_frame
+if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+  # TODO: see if -rtlib flag exists in CMAKE_SHARED_LINKER_FLAGS, then get
+  #       output of -print-libgcc-file-name, do removal only when output is
+  #       compiler-rt.
+  string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
+endif()
+
 add_llvm_library(LLVMRuntimeDyld
   JITSymbol.cpp
   RTDyldMemoryManager.cpp


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53553.170566.patch
Type: text/x-patch
Size: 1237 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181023/6b976877/attachment.bin>


More information about the llvm-commits mailing list