Enable symbol versioning in libLLVM.so

This commit is contained in:
Tom Stellard 2018-03-14 22:21:22 +00:00
parent 025cf6ec25
commit 3ff2527fa4
2 changed files with 4 additions and 66 deletions

View File

@ -1,62 +0,0 @@
From a5f7c93301bb1177e1cbd9332c56f47b68059fb8 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Fri, 19 Jan 2018 12:10:53 -0800
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 | 5 +----
tools/llvm-shlib/simple_version_script.map.in | 1 -
3 files changed, 2 insertions(+), 7 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 78f106f..5faa9a7 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 b2109c8..b1ea65c 100644
--- a/tools/llvm-shlib/CMakeLists.txt
+++ b/tools/llvm-shlib/CMakeLists.txt
@@ -41,15 +41,12 @@ if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")) # 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)
# GNU ld doesn't resolve symbols in the version script.
set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
if (NOT LLVM_LINKER_IS_SOLARISLD)
# Solaris ld does not accept global: *; so there is no way to version *all* global symbols
- set(LIB_NAMES -Wl,--version-script,${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map ${LIB_NAMES})
+ set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
endif()
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
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

View File

@ -12,7 +12,7 @@
Name: llvm
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
Release: 5%{?dist}
Release: 6%{?dist}
Summary: The Low Level Virtual Machine
License: NCSA
@ -22,9 +22,6 @@ Source0: http://llvm.org/releases/%{version}/%{name}-%{version}%{?rc_ver:rc%{rc_
# recognize s390 as SystemZ when configuring build
Patch0: llvm-3.7.1-cmake-s390.patch
Patch3: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch
# FIXME: Symbol versioning breaks some unittests when statically linking
# libstdc++, so we disable it for now.
Patch4: 0001-Revert-Add-a-linker-script-to-version-LLVM-symbols.patch
Patch5: 0001-DebugInfo-Discard-invalid-DBG_VALUE-instructions-in-.patch
Patch6: 0001-Fixup-for-rL326769-RegState-Debug-is-being-truncated.patch
@ -218,6 +215,9 @@ fi
%{_libdir}/cmake/llvm/LLVMStaticExports.cmake
%changelog
* Wed Mar 14 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-6
- Enable symbol versioning in libLLVM.so
* Wed Mar 14 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-5
- Stop statically linking libstdc++. This is no longer required by Steam
client, but the steam installer still needs a work-around which should