Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
llvm5.9231
llvm_build_tablegen_component_as_shared_library...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File llvm_build_tablegen_component_as_shared_library.patch of Package llvm5.9231
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. Index: llvm-5.0.2.src/cmake/modules/AddLLVM.cmake =================================================================== --- llvm-5.0.2.src.orig/cmake/modules/AddLLVM.cmake +++ llvm-5.0.2.src/cmake/modules/AddLLVM.cmake @@ -517,7 +517,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() @@ -569,7 +569,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}) @@ -588,7 +588,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) Index: llvm-5.0.2.src/cmake/modules/TableGen.cmake =================================================================== --- llvm-5.0.2.src.orig/cmake/modules/TableGen.cmake +++ llvm-5.0.2.src/cmake/modules/TableGen.cmake @@ -133,7 +133,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} LLVMTableGen) set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS}) set(${project}_TABLEGEN "${target}" CACHE Index: llvm-5.0.2.src/lib/TableGen/CMakeLists.txt =================================================================== --- llvm-5.0.2.src.orig/lib/TableGen/CMakeLists.txt +++ llvm-5.0.2.src/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 ) Index: llvm-5.0.2.src/test/tools/llvm-config/system-libs.test =================================================================== --- llvm-5.0.2.src.orig/test/tools/llvm-config/system-libs.test +++ /dev/null @@ -1,6 +0,0 @@ -RUN: llvm-config --link-static --system-libs 2>&1 | FileCheck %s -REQUIRES: static-libs -UNSUPPORTED: system-windows -CHECK: -l -CHECK-NOT: error -CHECK-NOT: warning
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor