summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2016-03-28 22:25:17 +0200
committerMichał Górny <mgorny@gentoo.org>2016-03-28 23:31:31 +0200
commit3c90ddbcb3f0bbee391074c17bc6ca6ef909bd23 (patch)
tree87f1db5e445e273f4efd4d55baf8b89b5596f259 /sys-devel/llvm
parentdev-lisp/uiop: Use common-lisp-3 eclass (diff)
downloadgentoo-3c90ddbcb3f0bbee391074c17bc6ca6ef909bd23.tar.gz
gentoo-3c90ddbcb3f0bbee391074c17bc6ca6ef909bd23.tar.bz2
gentoo-3c90ddbcb3f0bbee391074c17bc6ca6ef909bd23.zip
sys-devel/llvm: Update llvm-config & restore shared libs in 3.8, #578392
Diffstat (limited to 'sys-devel/llvm')
-rw-r--r--sys-devel/llvm/files/llvm-3.8-llvm-config.patch43
-rw-r--r--sys-devel/llvm/files/llvm-3.8-soversion.patch28
-rw-r--r--sys-devel/llvm/llvm-3.8.0-r1.ebuild (renamed from sys-devel/llvm/llvm-3.8.0.ebuild)6
3 files changed, 60 insertions, 17 deletions
diff --git a/sys-devel/llvm/files/llvm-3.8-llvm-config.patch b/sys-devel/llvm/files/llvm-3.8-llvm-config.patch
index acc0601cece..3eace43f6de 100644
--- a/sys-devel/llvm/files/llvm-3.8-llvm-config.patch
+++ b/sys-devel/llvm/files/llvm-3.8-llvm-config.patch
@@ -1,6 +1,6 @@
-From cc0ac62d1c03206bc3a1edba4d60f97921b854f5 Mon Sep 17 00:00:00 2001
+From 5ed05738769643b7c652f798fa6c3aa30c7f0b2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Fri, 4 Dec 2015 20:45:33 +0100
+Date: Wed, 2 Dec 2015 16:04:56 +0100
Subject: [PATCH] llvm-config: Clean up exported values, update for shared
linking
@@ -8,32 +8,34 @@ Gentoo-specific fixup for llvm-config, including:
- wiping build-specific CFLAGS, CXXFLAGS,
- updating library suffixes for shared libs,
- wiping --system-libs for shared linking,
-- banning --obj-root and --src-root due to no sources installed.
+- banning --obj-root and --src-root due to no sources installed,
+- making --build-mode return "Release" rather than "Gentoo".
Thanks to Steven Newbury for the initial patch.
Bug: https://bugs.gentoo.org/565358
Bug: https://bugs.gentoo.org/501684
---
- tools/llvm-config/CMakeLists.txt | 9 +++++++--
- tools/llvm-config/llvm-config.cpp | 17 +++++++++++++----
- utils/llvm-build/llvmbuild/main.py | 5 ++++-
- 3 files changed, 24 insertions(+), 7 deletions(-)
+ tools/llvm-config/CMakeLists.txt | 11 ++++++++---
+ tools/llvm-config/llvm-config.cpp | 20 +++++++++++++++-----
+ utils/llvm-build/llvmbuild/main.py | 4 +++-
+ 3 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
-index 83794bb..21fd845 100644
+index 83794bb..eba6f45 100644
--- a/tools/llvm-config/CMakeLists.txt
+++ b/tools/llvm-config/CMakeLists.txt
@@ -22,15 +22,20 @@ get_property(COMPILE_FLAGS TARGET llvm-config PROPERTY COMPILE_FLAGS)
set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR})
set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+-set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+-set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
+# Just use CMAKE_CPP_FLAGS for CFLAGS and CXXFLAGS, otherwise compiler
+# specific flags will be set when we don't know what compiler will be used
+# with external project utilising llvm-config. C++ Standard is required.
+# TODO: figure out if we can remove -std=c++11 and move it to revdeps.
- set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
--set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
++set(LLVM_CFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+set(LLVM_CXXFLAGS "${CMAKE_CPP_FLAGS} -std=c++11 ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
set(LLVM_BUILD_SYSTEM cmake)
set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
@@ -48,10 +50,20 @@ index 83794bb..21fd845 100644
set(LLVM_ENABLE_SHARED ON)
else()
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 80f6279..b16b9a3 100644
+index 80f6279..5c65c57 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
-@@ -497,10 +497,19 @@ int main(int argc, char **argv) {
+@@ -484,7 +484,8 @@ int main(int argc, char **argv) {
+ } else if (Arg == "--host-target") {
+ OS << Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE) << '\n';
+ } else if (Arg == "--build-mode") {
+- OS << build_mode << '\n';
++ // force Release since we force non-standard Gentoo build mode
++ OS << "Release" << '\n';
+ } else if (Arg == "--assertion-mode") {
+ #if defined(NDEBUG)
+ OS << "OFF\n";
+@@ -497,10 +498,19 @@ int main(int argc, char **argv) {
OS << LLVM_HAS_RTTI << '\n';
} else if (Arg == "--shared-mode") {
PrintSharedMode = true;
@@ -76,7 +88,7 @@ index 80f6279..b16b9a3 100644
usage();
}
diff --git a/utils/llvm-build/llvmbuild/main.py b/utils/llvm-build/llvmbuild/main.py
-index f2472f6..a29fc83 100644
+index f2472f6..c89c77a 100644
--- a/utils/llvm-build/llvmbuild/main.py
+++ b/utils/llvm-build/llvmbuild/main.py
@@ -393,6 +393,8 @@ subdirectories = %s
@@ -88,16 +100,15 @@ index f2472f6..a29fc83 100644
""")
f.write('struct AvailableComponent {\n')
f.write(' /// The name of the component.\n')
-@@ -413,7 +415,8 @@ subdirectories = %s
+@@ -413,7 +415,7 @@ subdirectories = %s
if library_name is None:
library_name_as_cstr = 'nullptr'
else:
- library_name_as_cstr = '"lib%s.a"' % library_name
+ library_name_as_cstr = '"lib%s" LTDL_SHLIB_EXT' % library_name
-+
if is_installed:
is_installed_as_cstr = 'true'
else:
--
-2.6.3
+2.7.4
diff --git a/sys-devel/llvm/files/llvm-3.8-soversion.patch b/sys-devel/llvm/files/llvm-3.8-soversion.patch
new file mode 100644
index 00000000000..1a30643d675
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.8-soversion.patch
@@ -0,0 +1,28 @@
+From 3da7d5f7f928aa2aa5e7436b27908bb7e7eb3cc1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 28 Mar 2016 22:21:19 +0200
+Subject: [PATCH] cmake: Restore SOVERSIONs on shared libraries
+
+---
+ cmake/modules/AddLLVM.cmake | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
+index a829751..a7e0688 100644
+--- a/cmake/modules/AddLLVM.cmake
++++ b/cmake/modules/AddLLVM.cmake
+@@ -436,6 +436,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)
+--
+2.7.4
+
diff --git a/sys-devel/llvm/llvm-3.8.0.ebuild b/sys-devel/llvm/llvm-3.8.0-r1.ebuild
index f8e26f54407..41f1d792b92 100644
--- a/sys-devel/llvm/llvm-3.8.0.ebuild
+++ b/sys-devel/llvm/llvm-3.8.0-r1.ebuild
@@ -175,6 +175,10 @@ src_prepare() {
# https://bugs.gentoo.org/show_bug.cgi?id=565358
epatch "${FILESDIR}"/llvm-3.8-llvm-config.patch
+ # Restore SOVERSIONs for shared libraries
+ # https://bugs.gentoo.org/show_bug.cgi?id=578392
+ epatch "${FILESDIR}"/llvm-3.8-soversion.patch
+
# disable use of SDK on OSX, bug #568758
sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
@@ -249,7 +253,7 @@ multilib_src_configure() {
local mycmakeargs=(
-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
- -DLLVM_LINK_LLVM_DYLIB=ON
+ -DBUILD_SHARED_LIBS=ON
-DLLVM_ENABLE_TIMESTAMPS=OFF
-DLLVM_TARGETS_TO_BUILD="${targets}"
-DLLVM_BUILD_TESTS=$(usex test)