Hello community,

here is the log from the commit of package llvm6 for openSUSE:Factory checked 
in at 2018-06-05 12:49:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/llvm6 (Old)
 and      /work/SRC/openSUSE:Factory/.llvm6.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "llvm6"

Tue Jun  5 12:49:51 2018 rev:6 rq:613475 version:6.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/llvm6/llvm6.changes      2018-05-23 
16:06:59.174631208 +0200
+++ /work/SRC/openSUSE:Factory/.llvm6.new/llvm6.changes 2018-06-05 
12:49:52.260320606 +0200
@@ -1,0 +2,8 @@
+Thu May 17 15:26:21 UTC 2018 - m...@suse.com
+
+- llvm_build_tablegen_component_as_shared_library.patch
+  * Build TableGen component as its own shared library because it
+    is not included in the libLLVM library and is needed for ldc.
+    (bsc#1086445)
+
+-------------------------------------------------------------------

New:
----
  llvm_build_tablegen_component_as_shared_library.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ llvm6.spec ++++++
--- /var/tmp/diff_new_pack.WSevyR/_old  2018-06-05 12:49:54.452240289 +0200
+++ /var/tmp/diff_new_pack.WSevyR/_new  2018-06-05 12:49:54.452240289 +0200
@@ -99,6 +99,7 @@
 Patch17:        polly-cmake-Trust-pkg-config-in-FindJsoncpp.patch
 Patch18:        llvm-build-tests-with-rtti.patch
 Patch19:        llvm6-fix-InstCombine.patch
+Patch20:        llvm_build_tablegen_component_as_shared_library.patch
 BuildRequires:  binutils-devel >= 2.21.90
 BuildRequires:  binutils-gold
 BuildRequires:  cmake
@@ -518,6 +519,7 @@
 %patch15 -p1
 %patch18 -p1
 %patch19 -p2
+%patch20 -p1
 
 pushd cfe-%{version}.src
 %patch1 -p1
@@ -1541,6 +1543,7 @@
 %defattr(-,root,root,-)
 %{_bindir}/llvm-config
 %{_libdir}/libLLVM.so
+%{_libdir}/libLLVMTableGen.so
 %{_libdir}/BugpointPasses.*
 %{_libdir}/LLVMHello.*
 %{_includedir}/llvm/

++++++ llvm_build_tablegen_component_as_shared_library.patch ++++++
The LLVMTableGen component is a special case that is excluded from libLLVM and
normally is only built as static library and linked into llvm-tblgen.

We need to have it as a shared library to be available for other projects such
as ldc.

This patch makes it even more special and forces it to be build and installed
as separate shared library.

diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index d631fcc0f05..6fba74a6e5b 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -524,7 +524,7 @@ function(llvm_add_library name)
   if(ARG_MODULE AND LLVM_EXPORT_SYMBOLS_FOR_PLUGINS AND ARG_PLUGIN_TOOL AND 
(WIN32 OR CYGWIN))
     # On DLL platforms symbols are imported from the tool by linking against 
it.
     set(llvm_libs ${ARG_PLUGIN_TOOL})
-  elseif (DEFINED LLVM_LINK_COMPONENTS OR DEFINED ARG_LINK_COMPONENTS)
+  elseif (DEFINED LLVM_LINK_COMPONENTS OR DEFINED ARG_LINK_COMPONENTS OR 
(${name} STREQUAL "LLVMTableGen" AND LLVM_BUILD_LLVM_DYLIB))
     if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB)
       set(llvm_libs LLVM)
     else()
@@ -602,7 +602,7 @@ macro(add_llvm_library name)
     ""
     ""
     ${ARGN})
-  if( BUILD_SHARED_LIBS OR ARG_SHARED )
+  if( BUILD_SHARED_LIBS OR ARG_SHARED)
     llvm_add_library(${name} SHARED ${ARG_UNPARSED_ARGUMENTS})
   else()
     llvm_add_library(${name} ${ARG_UNPARSED_ARGUMENTS})
@@ -621,7 +621,7 @@ macro(add_llvm_library name)
     set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
   else()
     if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO" OR
-        (LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM"))
+        (LLVM_LINK_LLVM_DYLIB AND (${name} STREQUAL "LLVM" OR ${name} STREQUAL 
"LLVMTableGen")))
       set(install_dir lib${LLVM_LIBDIR_SUFFIX})
       if(ARG_SHARED OR BUILD_SHARED_LIBS)
         if(WIN32 OR CYGWIN OR MINGW)
diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake
index d1afcb42f9d..486105474a4 100644
--- a/cmake/modules/TableGen.cmake
+++ b/cmake/modules/TableGen.cmake
@@ -127,7 +127,8 @@ macro(add_tablegen target project)
     set(LLVM_ENABLE_OBJLIB ON)
   endif()
 
-  add_llvm_executable(${target} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
+  add_llvm_executable(${target} ${ARGN})
+  target_link_libraries(${target} PRIVATE LLVMTableGen)
   set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS})
 
   set(${project}_TABLEGEN "${target}" CACHE
diff --git a/lib/TableGen/CMakeLists.txt b/lib/TableGen/CMakeLists.txt
index 9333b653777..eb9af223025 100644
--- a/lib/TableGen/CMakeLists.txt
+++ b/lib/TableGen/CMakeLists.txt
@@ -1,3 +1,7 @@
+if (LLVM_BUILD_LLVM_DYLIB)
+    set(MAYBE_SHARED SHARED)
+endif()
+
 add_llvm_library(LLVMTableGen
   Error.cpp
   Main.cpp
@@ -8,6 +12,8 @@ add_llvm_library(LLVMTableGen
   TGLexer.cpp
   TGParser.cpp
 
+  ${MAYBE_SHARED}
+
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/TableGen
   )

Reply via email to