From ac4d3051327e73ae889760188b46b1ce7781d604 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Oct 03 2017 23:13:41 +0000 Subject: Add missing patch. --- diff --git a/0001-Revert-Add-a-linker-script-to-version-LLVM-symbols.patch b/0001-Revert-Add-a-linker-script-to-version-LLVM-symbols.patch new file mode 100644 index 0000000..af11182 --- /dev/null +++ b/0001-Revert-Add-a-linker-script-to-version-LLVM-symbols.patch @@ -0,0 +1,61 @@ +From 2912190aec4a215849a6dea0463f6599425fb7c7 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Mon, 14 Aug 2017 17:46:14 -0700 +Subject: [PATCH] Revert "Add a linker script to version LLVM symbols" + +This reverts commit cd789d8cfe12aa374e66eafc748f4fc06e149ca7. + +Conflicts: + tools/llvm-shlib/CMakeLists.txt +--- + cmake/modules/AddLLVM.cmake | 3 +-- + tools/llvm-shlib/CMakeLists.txt | 8 ++------ + tools/llvm-shlib/simple_version_script.map.in | 1 - + 3 files changed, 3 insertions(+), 9 deletions(-) + delete mode 100644 tools/llvm-shlib/simple_version_script.map.in + +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index e1ad9b9..e5ee4ee 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -81,9 +81,8 @@ function(add_llvm_symbol_exports target_name export_file) + # Gold and BFD ld require a version script rather than a plain list. + set(native_export_file "${target_name}.exports") + # FIXME: Don't write the "local:" line on OpenBSD. +- # in the export file, also add a linker script to version LLVM symbols (form: LLVM_N.M) + add_custom_command(OUTPUT ${native_export_file} +- COMMAND echo "LLVM_${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR} {" > ${native_export_file} ++ COMMAND echo "{" > ${native_export_file} + COMMAND grep -q "[[:alnum:]]" ${export_file} && echo " global:" >> ${native_export_file} || : + COMMAND sed -e "s/$/;/" -e "s/^/ /" < ${export_file} >> ${native_export_file} + COMMAND echo " local: *;" >> ${native_export_file} +diff --git a/tools/llvm-shlib/CMakeLists.txt b/tools/llvm-shlib/CMakeLists.txt +index 907345a..01a37b5 100644 +--- a/tools/llvm-shlib/CMakeLists.txt ++++ b/tools/llvm-shlib/CMakeLists.txt +@@ -37,13 +37,9 @@ endif() + add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES}) + + list(REMOVE_DUPLICATES LIB_NAMES) +-if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU) OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")) # FIXME: It should be "GNU ld for elf" +- configure_file( +- ${CMAKE_CURRENT_SOURCE_DIR}/simple_version_script.map.in +- ${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map) +- ++if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")) # FIXME: It should be "GNU ld for elf" + # GNU ld doesn't resolve symbols in the version script. +- set(LIB_NAMES -Wl,--version-script,${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive) ++ set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive) + elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") + set(LIB_NAMES -Wl,-all_load ${LIB_NAMES}) + endif() +diff --git a/tools/llvm-shlib/simple_version_script.map.in b/tools/llvm-shlib/simple_version_script.map.in +deleted file mode 100644 +index e9515fe..0000000 +--- a/tools/llvm-shlib/simple_version_script.map.in ++++ /dev/null +@@ -1 +0,0 @@ +-LLVM_@LLVM_VERSION_MAJOR@.@LLVM_VERSION_MINOR@ { global: *; }; +-- +1.8.3.1 +