f08dbfb441
Update to llvm 3.8.1 Many other fixes and cleanups OBS-URL: https://build.opensuse.org/request/show/425075 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=467
111 lines
4.2 KiB
Diff
111 lines
4.2 KiB
Diff
Index: llvm-3.8.1.src/cmake/modules/AddLLVM.cmake
|
|
===================================================================
|
|
--- llvm-3.8.1.src.orig/cmake/modules/AddLLVM.cmake
|
|
+++ llvm-3.8.1.src/cmake/modules/AddLLVM.cmake
|
|
@@ -326,12 +326,10 @@ endfunction(set_windows_version_resource
|
|
# Same semantics as target_link_libraries().
|
|
# ADDITIONAL_HEADERS
|
|
# May specify header files for IDE generators.
|
|
-# SONAME
|
|
-# Should set SONAME link flags and create symlinks
|
|
# )
|
|
function(llvm_add_library name)
|
|
cmake_parse_arguments(ARG
|
|
- "MODULE;SHARED;STATIC;OBJECT;DISABLE_LLVM_LINK_LLVM_DYLIB;SONAME"
|
|
+ "MODULE;SHARED;STATIC;OBJECT;DISABLE_LLVM_LINK_LLVM_DYLIB"
|
|
"OUTPUT_NAME"
|
|
"ADDITIONAL_HEADERS;DEPENDS;LINK_COMPONENTS;LINK_LIBS;OBJLIBS"
|
|
${ARGN})
|
|
@@ -436,6 +434,11 @@ function(llvm_add_library name)
|
|
PREFIX ""
|
|
)
|
|
endif()
|
|
+
|
|
+ set_target_properties(${name}
|
|
+ PROPERTIES
|
|
+ SOVERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}
|
|
+ VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX})
|
|
endif()
|
|
|
|
if(ARG_MODULE OR ARG_SHARED)
|
|
@@ -450,24 +453,6 @@ function(llvm_add_library name)
|
|
endif()
|
|
endif()
|
|
|
|
- if(ARG_SHARED AND UNIX)
|
|
- if(NOT APPLE AND ARG_SONAME)
|
|
- get_target_property(output_name ${name} OUTPUT_NAME)
|
|
- if(${output_name} STREQUAL "output_name-NOTFOUND")
|
|
- set(output_name ${name})
|
|
- endif()
|
|
- set(library_name ${output_name}-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX})
|
|
- set(api_name ${output_name}-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX})
|
|
- set_target_properties(${name} PROPERTIES OUTPUT_NAME ${library_name})
|
|
- llvm_install_library_symlink(${api_name} ${library_name} SHARED
|
|
- COMPONENT ${name}
|
|
- ALWAYS_GENERATE)
|
|
- llvm_install_library_symlink(${output_name} ${library_name} SHARED
|
|
- COMPONENT ${name}
|
|
- ALWAYS_GENERATE)
|
|
- endif()
|
|
- endif()
|
|
-
|
|
if (DEFINED LLVM_LINK_COMPONENTS OR DEFINED ARG_LINK_COMPONENTS)
|
|
if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB)
|
|
set(llvm_libs LLVM)
|
|
@@ -1073,41 +1058,6 @@ function(add_lit_testsuites project dire
|
|
endif()
|
|
endfunction()
|
|
|
|
-function(llvm_install_library_symlink name dest type)
|
|
- cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN})
|
|
- foreach(path ${CMAKE_MODULE_PATH})
|
|
- if(EXISTS ${path}/LLVMInstallSymlink.cmake)
|
|
- set(INSTALL_SYMLINK ${path}/LLVMInstallSymlink.cmake)
|
|
- break()
|
|
- endif()
|
|
- endforeach()
|
|
-
|
|
- set(component ${ARG_COMPONENT})
|
|
- if(NOT component)
|
|
- set(component ${name})
|
|
- endif()
|
|
-
|
|
- set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX})
|
|
- set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX})
|
|
-
|
|
- set(output_dir lib${LLVM_LIBDIR_SUFFIX})
|
|
- if(WIN32 AND "${type}" STREQUAL "SHARED")
|
|
- set(output_dir bin)
|
|
- endif()
|
|
-
|
|
- install(SCRIPT ${INSTALL_SYMLINK}
|
|
- CODE "install_symlink(${full_name} ${full_dest} ${output_dir})"
|
|
- COMPONENT ${component})
|
|
-
|
|
- if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE)
|
|
- add_custom_target(install-${name}
|
|
- DEPENDS ${name} ${dest} install-${dest}
|
|
- COMMAND "${CMAKE_COMMAND}"
|
|
- -DCMAKE_INSTALL_COMPONENT=${name}
|
|
- -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
|
|
- endif()
|
|
-endfunction()
|
|
-
|
|
function(llvm_install_symlink name dest)
|
|
cmake_parse_arguments(ARG "ALWAYS_GENERATE" "" "" ${ARGN})
|
|
foreach(path ${CMAKE_MODULE_PATH})
|
|
Index: llvm-3.8.1.src/tools/llvm-shlib/CMakeLists.txt
|
|
===================================================================
|
|
--- llvm-3.8.1.src.orig/tools/llvm-shlib/CMakeLists.txt
|
|
+++ llvm-3.8.1.src/tools/llvm-shlib/CMakeLists.txt
|
|
@@ -38,7 +38,7 @@ if(LLVM_DYLIB_EXPORTED_SYMBOL_FILE)
|
|
add_custom_target(libLLVMExports DEPENDS ${LLVM_EXPORTED_SYMBOL_FILE})
|
|
endif()
|
|
|
|
-add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})
|
|
+add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB ${SOURCES})
|
|
|
|
list(REMOVE_DUPLICATES LIB_NAMES)
|
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") # FIXME: It should be "GNU ld for elf"
|