diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2016-12-29 19:27:13 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2016-12-29 19:27:13 +0300 |
commit | af9bc6048f75920d7916539e1c95e53a317840bb (patch) | |
tree | 876eb249ce2f4ede68ad5b5286fbac98e73147e2 /debian/patches/dyson-gnu-ld.patch | |
parent | 24254972eecd64b4752eadf0a1386e774a6b7291 (diff) | |
download | llvm-toolchain-3.8-af9bc6048f75920d7916539e1c95e53a317840bb.tar.gz |
Added dyson-coreutils.patch & dyson-gnu-ld.patch
Diffstat (limited to 'debian/patches/dyson-gnu-ld.patch')
-rw-r--r-- | debian/patches/dyson-gnu-ld.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/debian/patches/dyson-gnu-ld.patch b/debian/patches/dyson-gnu-ld.patch new file mode 100644 index 0000000..b257b34 --- /dev/null +++ b/debian/patches/dyson-gnu-ld.patch @@ -0,0 +1,50 @@ +Index: llvm-toolchain-3.8-3.8.1/cmake/modules/AddLLVM.cmake +=================================================================== +--- llvm-toolchain-3.8-3.8.1.orig/cmake/modules/AddLLVM.cmake ++++ llvm-toolchain-3.8-3.8.1/cmake/modules/AddLLVM.cmake +@@ -82,13 +82,8 @@ function(add_llvm_symbol_exports target_ + DEPENDS ${export_file} + VERBATIM + COMMENT "Creating export file for ${target_name}") +- if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") +- set_property(TARGET ${target_name} APPEND_STRING PROPERTY +- LINK_FLAGS " -Wl,-M,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}") +- else() + set_property(TARGET ${target_name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}") +- endif() + else() + set(native_export_file "${target_name}.def") + +@@ -156,7 +151,7 @@ function(add_link_opts target_name) + + # Pass -O3 to the linker. This enabled different optimizations on different + # linkers. +- if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin|SunOS" OR WIN32)) ++ if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32)) + set_property(TARGET ${target_name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-O3") + endif() +@@ -174,9 +169,6 @@ function(add_link_opts target_name) + # ld64's implementation of -dead_strip breaks tools that use plugins. + set_property(TARGET ${target_name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-dead_strip") +- elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS") +- set_property(TARGET ${target_name} APPEND_STRING PROPERTY +- LINK_FLAGS " -Wl,-z -Wl,discard-unused=sections") + elseif(NOT WIN32 AND NOT LLVM_LINKER_IS_GOLD) + # Object files are compiled with -ffunction-data-sections. + # Versions of bfd ld < 2.23.1 have a bug in --gc-sections that breaks +Index: llvm-toolchain-3.8-3.8.1/tools/llvm-shlib/CMakeLists.txt +=================================================================== +--- llvm-toolchain-3.8-3.8.1.orig/tools/llvm-shlib/CMakeLists.txt ++++ llvm-toolchain-3.8-3.8.1/tools/llvm-shlib/CMakeLists.txt +@@ -42,7 +42,7 @@ add_llvm_library(LLVM SHARED DISABLE_LLV + set_property(TARGET LLVM PROPERTY VERSION "1") # Append .1 to SONAME + + list(REMOVE_DUPLICATES LIB_NAMES) +-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "GNU" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "kFreeBSD") # FIXME: It should be "GNU ld for elf" ++if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "GNU" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "kFreeBSD" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS") + # GNU ld doesn't resolve symbols in the version script. + set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive) + elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") |