summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-06-03 11:21:48 +0200
committerMichał Górny <mgorny@gentoo.org>2017-06-03 12:27:50 +0200
commit9fbbd3f25a352065041ab0a94b08785e00ef44bc (patch)
tree5377c265b3bf50d9e445cb86413e6bf7138525d6 /sys-devel/llvm
parentsys-devel/llvm: Move 3.6.2 patchset to tarball (diff)
downloadgentoo-9fbbd3f25a352065041ab0a94b08785e00ef44bc.tar.gz
gentoo-9fbbd3f25a352065041ab0a94b08785e00ef44bc.tar.bz2
gentoo-9fbbd3f25a352065041ab0a94b08785e00ef44bc.zip
sys-devel/llvm: Move 3.7.1 patchset to tarball
Diffstat (limited to 'sys-devel/llvm')
-rw-r--r--sys-devel/llvm/Manifest1
-rw-r--r--sys-devel/llvm/files/3.7.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch52
-rw-r--r--sys-devel/llvm/files/3.7.1/clang/ccc-analyzer-isystem.patch18
-rw-r--r--sys-devel/llvm/files/3.7.1/clang/gentoo-install.patch48
-rw-r--r--sys-devel/llvm/files/3.7.1/compiler-rt/arm_march_flags.patch16
-rw-r--r--sys-devel/llvm/files/3.7.1/compiler-rt/msan-fix.patch86
-rw-r--r--sys-devel/llvm/files/3.7.1/lldb/python.patch23
-rw-r--r--sys-devel/llvm/files/3.7.1/lldb/tinfo.patch12
-rw-r--r--sys-devel/llvm/files/3.7.1/llvm-config-0.patch83
-rw-r--r--sys-devel/llvm/files/3.7.1/llvm-config-1.patch453
-rw-r--r--sys-devel/llvm/files/3.7.1/llvm-config-2.patch113
-rw-r--r--sys-devel/llvm/files/3.7.1/llvm-config-3.patch29
-rw-r--r--sys-devel/llvm/files/3.7.1/msan-fix.patch79
-rw-r--r--sys-devel/llvm/llvm-3.7.1-r3.ebuild47
14 files changed, 25 insertions, 1035 deletions
diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
index c10f9ba0cf10..e91c605e22eb 100644
--- a/sys-devel/llvm/Manifest
+++ b/sys-devel/llvm/Manifest
@@ -26,6 +26,7 @@ DIST llvm-3.6.1-manpages.tar.bz2 38338 SHA256 b27c6198e09b11421841a7184d4e8a0f88
DIST llvm-3.6.2-patchset.tar.gz 4562 SHA256 7b85037d143732c0e635a2ba436d1f2418654161ecb5b9618f8e9ffad8fa3279 SHA512 6018e7d96317e6a46f373259430782a1377193ab64b337d5f6720a4ffe0eb0891e7e9373fb9c20da66e840f07e52f2bccb2a8c51bb55ded0f124748796cce1c8 WHIRLPOOL 01aeb3b454cc0d442c9a54ab3aca3be0106765f372ec4e82344f3967faa89fefec978562cdef56d1cc47cb418b0dd15ac685a2c1b05d415fb32b8684182aeb23
DIST llvm-3.6.2.src.tar.xz 12802380 SHA256 f60dc158bfda6822de167e87275848969f0558b3134892ff54fced87e4667b94 SHA512 42b44ce69cfb96e2dc12dc2246f0de8ff983a99741206e2c46ccf074b3248aaab9c0f22c6baad802de851d06f202f40db9dd62fe38aab4479b3f70026c936b36 WHIRLPOOL 1a15e16793fe4120f1c14a5334362c36db26745c493e7289281351b7c18c523d781ff9425dddfe1a2add9ea1e8aebb92f2313787da5f286259b55b0884b3039f
DIST llvm-3.7.0-manpages.tar.bz2 38095 SHA256 8597fa532464c6336aefbbef0b1ce452aaa98d474fa58108c6a6f57a9ccd6785 SHA512 ea70ac15dbaef3740b31f66aa798338f7f9b82484586582aa62e0364f9d74bf175be2f4f29721df253b8157c1cbc146ab9045c0656c42a6375434e994786b643 WHIRLPOOL 743b339b0df7c52d270a5197e9e765dfd92d4b5acee94cf9d9d7713e1a75aa9d987b3f5adab0952e7267febf88b318d0f31cb45847e2b0b42c7c7373b2358358
+DIST llvm-3.7.1-patchset.tar.gz 17234 SHA256 3add3f23c0eae09f52ac055362234a116da4fc1e5a7772cd9a90519549e9f096 SHA512 030dc7f72d11fcd53307f707d5dde321054feb0f0977601c3e188a37f2be6c14bfd05482d1c1e5f435aaf32ca7c7e3701cf5f1375fbd0cf83cf8afbad7f4f6be WHIRLPOOL fa5d3464ac6315dabac895b753918b0dbe301ef6d8e45a75934ba6b0ba947e30763d0522bd95b79ae4a714b1234bb08e654c0a9987fd74e692eeb2afe16694e8
DIST llvm-3.7.1.src.tar.xz 14592544 SHA256 be7794ed0cec42d6c682ca8e3517535b54555a3defabec83554dbc74db545ad5 SHA512 ac521debc02f6deba96ef975d6a546b0c5c77299c1dbf5e1b87a7974ff5e7fd715bd7e384b92d9adf572ce47130bdbf6d3c648eb0d7f72f16f976292e4909e90 WHIRLPOOL 788ce0907b906ebee595c766713bec5067563c8aba7460211f5830e116df7c830de84704834c0df2f2f2c90354d75521e4a4aff57e769a2d8ab590778c1e4a70
DIST llvm-3.8.0-manpages.tar.bz2 37889 SHA256 4dda7f69f9412e0fb50d32631df34d6ea7f93c945c9a59cb050a99f1d2d0508b SHA512 a93ed7a25b75c237a0967ba7a501c71af3e7e9292ebabf69733bc637e9a4534dcaee539c6b1f6b2df7a87103c2371b1cf130fac05b88047100988c814e89ab0f WHIRLPOOL 9790a576fd4db798c2339bb4ea1dc973f1057177364770a104be7916998a1ad824e6b4eee296066ddd32eb5e6c57ffd5716457cecbd8ca9fe1b317d0d5ed2676
DIST llvm-3.8.1.src.tar.xz 16551472 SHA256 6e82ce4adb54ff3afc18053d6981b6aed1406751b8742582ed50f04b5ab475f9 SHA512 99bbb2cc5f337fd5edf1621f8028c8cb74011aa4af2531018dc05409b27f7b8d0c2f76a00115f677f7c013029d5d9f55d085a5b40433409aac4e9161d53bd366 WHIRLPOOL a99cef164a0e05e5237b840bee776d48fe0bde460cb4536f03a5e4eb0cc630deeb96f76bdd42f912a4b2dab08133bd9137ea16be1b9582d375f0f5841dd40234
diff --git a/sys-devel/llvm/files/3.7.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch b/sys-devel/llvm/files/3.7.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
deleted file mode 100644
index 904a72a358a9..000000000000
--- a/sys-devel/llvm/files/3.7.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From b28503def986bcbc388a04be0d51cbe80bc59506 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Tue, 9 Jun 2015 12:11:50 +0200
-Subject: [PATCH] Install clang runtime into /usr/lib (without suffix)
-
----
- lib/Driver/Driver.cpp | 3 +--
- lib/Frontend/CompilerInvocation.cpp | 3 +--
- lib/Headers/CMakeLists.txt | 2 +-
- 3 files changed, 3 insertions(+), 5 deletions(-)
-
-diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
-index a04a1f8..418d46a 100644
---- a/tools/clang/lib/Driver/Driver.cpp
-+++ b/tools/clang//lib/Driver/Driver.cpp
-@@ -66,8 +66,7 @@ Driver::Driver(StringRef ClangExecutable, StringRef DefaultTargetTriple,
- if (ClangResourceDir != "") {
- llvm::sys::path::append(P, ClangResourceDir);
- } else {
-- StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX);
-- llvm::sys::path::append(P, "..", Twine("lib") + ClangLibdirSuffix, "clang",
-+ llvm::sys::path::append(P, "..", "lib", "clang",
- CLANG_VERSION_STRING);
- }
- ResourceDir = P.str();
-diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
-index 9485767..0b9ecbd 100644
---- a/tools/clang/lib/Frontend/CompilerInvocation.cpp
-+++ b/tools/clang/lib/Frontend/CompilerInvocation.cpp
-@@ -1053,8 +1053,7 @@ std::string CompilerInvocation::GetResourcesPath(const char *Argv0,
- if (ClangResourceDir != "") {
- llvm::sys::path::append(P, ClangResourceDir);
- } else {
-- StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX);
-- llvm::sys::path::append(P, "..", Twine("lib") + ClangLibdirSuffix, "clang",
-+ llvm::sys::path::append(P, "..", "lib", "clang",
- CLANG_VERSION_STRING);
- }
-
-diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
-index 29a738e..3769d23 100644
---- a/tools/clang/lib/Headers/CMakeLists.txt
-+++ b/tools/clang/lib/Headers/CMakeLists.txt
-@@ -93,4 +93,4 @@ set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
- install(
- FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
- PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-+ DESTINATION lib/clang/${CLANG_VERSION}/include)
---
-2.4.3
-
diff --git a/sys-devel/llvm/files/3.7.1/clang/ccc-analyzer-isystem.patch b/sys-devel/llvm/files/3.7.1/clang/ccc-analyzer-isystem.patch
deleted file mode 100644
index 78ca922b6366..000000000000
--- a/sys-devel/llvm/files/3.7.1/clang/ccc-analyzer-isystem.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-https://bugs.gentoo.org/586168
-
-Index: tools/clang/tools/scan-build/ccc-analyzer
-===================================================================
---- a/tools/clang/tools/scan-build/ccc-analyzer (revision 250980)
-+++ b/tools/clang/tools/scan-build/ccc-analyzer (working copy)
-@@ -586,9 +586,9 @@
- }
-
- # Compile mode flags.
-- if ($Arg =~ /^-[D,I,U,isystem](.*)$/) {
-+ if ($Arg =~ /^-(D|I|U|isystem)(.*)$/) {
- my $Tmp = $Arg;
-- if ($1 eq '') {
-+ if ($2 eq '') {
- # FIXME: Check if we are going off the end.
- ++$i;
- $Tmp = $Arg . $ARGV[$i];
diff --git a/sys-devel/llvm/files/3.7.1/clang/gentoo-install.patch b/sys-devel/llvm/files/3.7.1/clang/gentoo-install.patch
deleted file mode 100644
index 6d76ba9660ce..000000000000
--- a/sys-devel/llvm/files/3.7.1/clang/gentoo-install.patch
+++ /dev/null
@@ -1,48 +0,0 @@
----
- tools/clang/lib/Driver/Tools.cpp | 2 +-
- tools/clang/tools/scan-build/scan-build | 4 ++--
- tools/clang/tools/scan-view/scan-view | 2 +-
- 3 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
-index 187ed38..55bcd99 100644
---- a/tools/clang/lib/Driver/Tools.cpp
-+++ b/tools/clang/lib/Driver/Tools.cpp
-diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-build/scan-build
-index 0f119f6..58f78d9 100755
---- a/tools/clang/tools/scan-build/scan-build
-+++ b/tools/clang/tools/scan-build/scan-build
-@@ -419,7 +419,7 @@
-
- my $Dir = shift;
-
-- my $JS = Cwd::realpath("$RealBin/sorttable.js");
-+ my $JS = Cwd::realpath("@EPREFIX@/usr/share/llvm/sorttable.js");
-
- DieDiag("Cannot find 'sorttable.js'.\n")
- if (! -r $JS);
-@@ -429,7 +429,7 @@
- DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n")
- if (! -r "$Dir/sorttable.js");
-
-- my $CSS = Cwd::realpath("$RealBin/scanview.css");
-+ my $CSS = Cwd::realpath("@EPREFIX@/usr/share/llvm/scanview.css");
-
- DieDiag("Cannot find 'scanview.css'.\n")
- if (! -r $CSS);
-diff --git a/tools/clang/tools/scan-view/scan-view b/tools/clang/tools/scan-view/scan-view
-index fb27da6..1f8ddb8 100755
---- a/tools/clang/tools/scan-view/scan-view
-+++ b/tools/clang/tools/scan-view/scan-view
-@@ -54,7 +54,7 @@ def start_browser(port, options):
- webbrowser.open(url)
-
- def run(port, options, root):
-- import ScanView
-+ from clang import ScanView
- try:
- print 'Starting scan-view at: http://%s:%d'%(options.host,
- port)
---
-1.8.4.4
-
diff --git a/sys-devel/llvm/files/3.7.1/compiler-rt/arm_march_flags.patch b/sys-devel/llvm/files/3.7.1/compiler-rt/arm_march_flags.patch
deleted file mode 100644
index 943a8407f123..000000000000
--- a/sys-devel/llvm/files/3.7.1/compiler-rt/arm_march_flags.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -Naur llvm-3.7.0.src.orig/projects/compiler-rt/cmake/config-ix.cmake llvm-3.7.0.src/projects/compiler-rt/cmake/config-ix.cmake
---- llvm-3.7.0.src.orig/projects/compiler-rt/cmake/config-ix.cmake 2015-07-30 06:28:50.000000000 +0200
-+++ llvm-3.7.0.src/projects/compiler-rt/cmake/config-ix.cmake 2015-10-27 17:10:47.365847079 +0100
-@@ -209,12 +209,6 @@
- test_target_arch(mips "" "-mips32r2" "--target=mips-linux-gnu")
- test_target_arch(mips64 "" "-mips64r2" "-mabi=n64")
- endif()
-- elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "arm")
-- test_target_arch(arm "" "-march=armv7-a")
-- elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch32")
-- test_target_arch(aarch32 "" "-march=armv8-a")
-- elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch64")
-- test_target_arch(aarch64 "" "-march=armv8-a")
- endif()
- set(COMPILER_RT_OS_SUFFIX "")
- endif()
diff --git a/sys-devel/llvm/files/3.7.1/compiler-rt/msan-fix.patch b/sys-devel/llvm/files/3.7.1/compiler-rt/msan-fix.patch
deleted file mode 100644
index 3854a18497b1..000000000000
--- a/sys-devel/llvm/files/3.7.1/compiler-rt/msan-fix.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From 5dad120f9c9bc74c73edadb0467d8df81ae46066 Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Wed, 5 Aug 2015 05:34:27 -0700
-Subject: [PATCH 08/13] Apply split-layout-compiler-rt.patch
-
-https://llvm.org/bugs/show_bug.cgi?id=24155
----
- lib/msan/msan.h | 30 ++++++++++++++++++++----------
- lib/msan/msan_allocator.cc | 12 +++++++++++-
- 2 files changed, 31 insertions(+), 11 deletions(-)
-
-diff --git a/lib/msan/msan.h b/lib/msan/msan.h
-index cd8bc19..6251b38 100644
---- a/lib/msan/msan.h
-+++ b/lib/msan/msan.h
-@@ -94,17 +94,27 @@ const MappingDesc kMemoryLayout[] = {
-
- #elif SANITIZER_LINUX && SANITIZER_WORDSIZE == 64
-
--// Requries PIE binary and ASLR enabled.
--// Main thread stack and DSOs at 0x7f0000000000 (sometimes 0x7e0000000000).
--// Heap at 0x600000000000.
-+// All of the following configurations are supported.
-+// ASLR disabled: main executable and DSOs at 0x555550000000
-+// PIE and ASLR: main executable and DSOs at 0x7f0000000000
-+// non-PIE: main executable below 0x100000000, DSOs at 0x7f0000000000
-+// Heap at 0x700000000000.
- const MappingDesc kMemoryLayout[] = {
-- {0x000000000000ULL, 0x200000000000ULL, MappingDesc::INVALID, "invalid"},
-- {0x200000000000ULL, 0x400000000000ULL, MappingDesc::SHADOW, "shadow"},
-- {0x400000000000ULL, 0x600000000000ULL, MappingDesc::ORIGIN, "origin"},
-- {0x600000000000ULL, 0x800000000000ULL, MappingDesc::APP, "app"}};
--
--#define MEM_TO_SHADOW(mem) (((uptr)(mem)) & ~0x400000000000ULL)
--#define SHADOW_TO_ORIGIN(mem) (((uptr)(mem)) + 0x200000000000ULL)
-+ {0x000000000000ULL, 0x050000000000ULL, MappingDesc::APP, "app-1"},
-+ {0x050000000000ULL, 0x100000000000ULL, MappingDesc::SHADOW, "shadow-2"},
-+ {0x100000000000ULL, 0x150000000000ULL, MappingDesc::INVALID, "invalid"},
-+ {0x150000000000ULL, 0x200000000000ULL, MappingDesc::ORIGIN, "origin-2"},
-+ {0x200000000000ULL, 0x300000000000ULL, MappingDesc::SHADOW, "shadow-3"},
-+ {0x300000000000ULL, 0x400000000000ULL, MappingDesc::ORIGIN, "origin-3"},
-+ {0x400000000000ULL, 0x500000000000ULL, MappingDesc::INVALID, "invalid"},
-+ {0x500000000000ULL, 0x550000000000ULL, MappingDesc::SHADOW, "shadow-1"},
-+ {0x550000000000ULL, 0x600000000000ULL, MappingDesc::APP, "app-2"},
-+ {0x600000000000ULL, 0x650000000000ULL, MappingDesc::ORIGIN, "origin-1"},
-+ {0x650000000000ULL, 0x700000000000ULL, MappingDesc::INVALID, "invalid"},
-+ {0x700000000000ULL, 0x800000000000ULL, MappingDesc::APP, "app-3"}};
-+
-+#define MEM_TO_SHADOW(mem) (((uptr)(mem)) ^ 0x500000000000ULL)
-+#define SHADOW_TO_ORIGIN(mem) (((uptr)(mem)) + 0x100000000000ULL)
-
- #else
- #error "Unsupported platform"
-diff --git a/lib/msan/msan_allocator.cc b/lib/msan/msan_allocator.cc
-index 6df3566..e588bf8 100644
---- a/lib/msan/msan_allocator.cc
-+++ b/lib/msan/msan_allocator.cc
-@@ -49,7 +49,8 @@ struct MsanMapUnmapCallback {
- typedef SizeClassAllocator32<0, SANITIZER_MMAP_RANGE_SIZE, sizeof(Metadata),
- SizeClassMap, kRegionSizeLog, ByteMap,
- MsanMapUnmapCallback> PrimaryAllocator;
--#elif defined(__x86_64__)
-+
-+#elif SANITIZER_FREEBSD && SANITIZER_WORDSIZE == 64
- static const uptr kAllocatorSpace = 0x600000000000ULL;
- static const uptr kAllocatorSize = 0x80000000000; // 8T.
- static const uptr kMetadataSize = sizeof(Metadata);
-@@ -67,6 +68,15 @@ struct MsanMapUnmapCallback {
- typedef SizeClassAllocator64<kAllocatorSpace, kAllocatorSize, kMetadataSize,
- DefaultSizeClassMap,
- MsanMapUnmapCallback> PrimaryAllocator;
-+#elif SANITIZER_LINUX && SANITIZER_WORDSIZE == 64
-+ static const uptr kAllocatorSpace = 0x700000000000ULL;
-+ static const uptr kAllocatorSize = 0x80000000000; // 8T.
-+ static const uptr kMetadataSize = sizeof(Metadata);
-+ static const uptr kMaxAllowedMallocSize = 8UL << 30;
-+
-+ typedef SizeClassAllocator64<kAllocatorSpace, kAllocatorSize, kMetadataSize,
-+ DefaultSizeClassMap,
-+ MsanMapUnmapCallback> PrimaryAllocator;
- #endif
- typedef SizeClassAllocatorLocalCache<PrimaryAllocator> AllocatorCache;
- typedef LargeMmapAllocator<MsanMapUnmapCallback> SecondaryAllocator;
---
-2.6.4
-
diff --git a/sys-devel/llvm/files/3.7.1/lldb/python.patch b/sys-devel/llvm/files/3.7.1/lldb/python.patch
deleted file mode 100644
index 1a958271e187..000000000000
--- a/sys-devel/llvm/files/3.7.1/lldb/python.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -Naur llvm-3.7.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py llvm-3.7.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py
---- llvm-3.7.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py 2015-06-04 05:12:37.000000000 +0200
-+++ llvm-3.7.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py 2015-10-11 19:19:54.074935710 +0200
-@@ -371,14 +371,14 @@
- strLibFileExtn = ".dylib";
- else:
- strLibFileExtn = ".so";
-- strSrc = os.path.join("lib", "liblldb" + strLibFileExtn);
-+ strSrc = os.path.join("GENTOO_LIBDIR", "liblldb" + strLibFileExtn);
-
-- if eOSType != utilsOsType.EnumOsType.Windows:
-+# if eOSType != utilsOsType.EnumOsType.Windows:
- # Create a symlink to the "lib" directory, to ensure liblldb's RPATH is
- # effective.
-- bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, "lib", os.path.join("../lib") );
-- if not bOk:
-- return (bOk, strErrMsg)
-+# bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, "lib", os.path.join("../lib") );
-+# if not bOk:
-+# return (bOk, strErrMsg)
-
- bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget );
-
diff --git a/sys-devel/llvm/files/3.7.1/lldb/tinfo.patch b/sys-devel/llvm/files/3.7.1/lldb/tinfo.patch
deleted file mode 100644
index 626498c57eea..000000000000
--- a/sys-devel/llvm/files/3.7.1/lldb/tinfo.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/tools/lldb/cmake/LLDBDependencies.cmake 2015/09/16 20:13:53 247841
-+++ b/tools/lldb/cmake/LLDBDependencies.cmake 2015/09/16 20:14:01 247842
-@@ -141,6 +141,9 @@
- endif()
- if (NOT LLDB_DISABLE_CURSES)
- list(APPEND LLDB_SYSTEM_LIBS panel ncurses)
-+ if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
-+ list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
-+ endif()
- endif()
- endif()
- # On FreeBSD backtrace() is provided by libexecinfo, not libc.
diff --git a/sys-devel/llvm/files/3.7.1/llvm-config-0.patch b/sys-devel/llvm/files/3.7.1/llvm-config-0.patch
deleted file mode 100644
index 87f9ff8c5ad7..000000000000
--- a/sys-devel/llvm/files/3.7.1/llvm-config-0.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From a59464503a7e059ddfd3fb4308753b692d03d996 Mon Sep 17 00:00:00 2001
-From: Tom Stellard <thomas.stellard@amd.com>
-Date: Wed, 9 Sep 2015 16:39:30 +0000
-Subject: [PATCH 1/4] llvm-config: Add --build-system option
-
-Summary:
-This can be used for distinguishing between cmake and autoconf builds.
-Users may need this in order to handle inconsistencies between the
-outputs of the two build systems.
-
-Reviewers: echristo, chandlerc, beanz
-
-Subscribers: llvm-commits
-
-Differential Revision: http://reviews.llvm.org/D11838
-
-git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247159 91177308-0d34-0410-b5e6-96231b3b80d8
----
- tools/llvm-config/BuildVariables.inc.in | 1 +
- tools/llvm-config/CMakeLists.txt | 2 ++
- tools/llvm-config/Makefile | 2 ++
- tools/llvm-config/llvm-config.cpp | 3 +++
- 4 files changed, 8 insertions(+)
-
-diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-index 3f51f49..0f28fad 100644
---- a/tools/llvm-config/BuildVariables.inc.in
-+++ b/tools/llvm-config/BuildVariables.inc.in
-@@ -26,3 +26,4 @@
- #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
- #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
- #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
-+#define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"
-diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
-index edbd8c9..dd53460 100644
---- a/tools/llvm-config/CMakeLists.txt
-+++ b/tools/llvm-config/CMakeLists.txt
-@@ -24,6 +24,8 @@ 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}")
-+set(LLVM_BUILD_SYSTEM cmake)
-+
- # Use the C++ link flags, since they should be a superset of C link flags.
- set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}")
- set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
-diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
-index 1ff8b6f..c2b5e8f 100644
---- a/tools/llvm-config/Makefile
-+++ b/tools/llvm-config/Makefile
-@@ -65,6 +65,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
- >> temp.sed
- $(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
- >> temp.sed
-+ $(Verb) $(ECHO) 's/@LLVM_BUILD_SYSTEM@/autoconf/' \
-+ >> temp.sed
- $(Verb) $(SED) -f temp.sed < $< > $@
- $(Verb) $(RM) temp.sed
-
-diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 879b9ab..4ce8f10 100644
---- a/tools/llvm-config/llvm-config.cpp
-+++ b/tools/llvm-config/llvm-config.cpp
-@@ -157,6 +157,7 @@ Options:\n\
- --host-target Target triple used to configure LLVM.\n\
- --build-mode Print build mode of LLVM tree (e.g. Debug or Release).\n\
- --assertion-mode Print assertion mode of LLVM tree (ON or OFF).\n\
-+ --build-system Print the build system used to build LLVM (autoconf or cmake).\n\
- Typical components:\n\
- all All LLVM libraries (default).\n\
- engine Either a native JIT or a bitcode interpreter.\n";
-@@ -323,6 +324,8 @@ int main(int argc, char **argv) {
- #else
- OS << "ON\n";
- #endif
-+ } else if (Arg == "--build-system") {
-+ OS << LLVM_BUILD_SYSTEM << '\n';
- } else if (Arg == "--obj-root") {
- OS << ActivePrefix << '\n';
- } else if (Arg == "--src-root") {
---
-2.7.4
-
diff --git a/sys-devel/llvm/files/3.7.1/llvm-config-1.patch b/sys-devel/llvm/files/3.7.1/llvm-config-1.patch
deleted file mode 100644
index 214a3bbbc0e2..000000000000
--- a/sys-devel/llvm/files/3.7.1/llvm-config-1.patch
+++ /dev/null
@@ -1,453 +0,0 @@
-From 55433193c56e6b2e0792c3ca1b0ef3881ab01138 Mon Sep 17 00:00:00 2001
-From: Richard Diamond <wichard@vitalitystudios.com>
-Date: Mon, 9 Nov 2015 23:15:38 +0000
-Subject: [PATCH 2/4] Fix `llvm-config` to adapt to the install environment.
-
-Summary:
-This patch does a couple of things:
-
- - Adds a new argument `--shared-mode` which accepts a list of components and prints whether or not the provided components need to be linked statically or shared.
- - Fixes `--libnames` when CMake BUILD_SHARED_LIBS is used.
- - Fixes `--libnames`, `--libs`, and `--libfiles` for dylib when static components aren't installed.
- - Fixes `--libnames`, `--libs`, `--libfiles`, and `--components` to use LLVM_DYLIB_COMPONENTS as the component manifest for dylib linking.
- - Uses the host platform's usual convention for filename extensions and such, instead of always defaulting to Unix-izms.
-
-Because I don't own a Mac, I am not able to test the Mac platform dependent stuff locally. If someone would be willing to run a build for me on their machine (unless there's a better option), I'd appreciate it.
-
-Reviewers: jfb, brad.king, whitequark, beanz
-
-Subscribers: beanz, jauhien, llvm-commits
-
-Differential Revision: http://reviews.llvm.org/D13198
-
-git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252532 91177308-0d34-0410-b5e6-96231b3b80d8
----
- bindings/ocaml/Makefile.ocaml | 2 +
- tools/llvm-config/BuildVariables.inc.in | 3 +
- tools/llvm-config/CMakeLists.txt | 5 +
- tools/llvm-config/llvm-config.cpp | 265 +++++++++++++++++++++++++++++---
- 4 files changed, 253 insertions(+), 22 deletions(-)
-
-diff --git a/bindings/ocaml/Makefile.ocaml b/bindings/ocaml/Makefile.ocaml
-index 1f65a7b..22b96a2 100644
---- a/bindings/ocaml/Makefile.ocaml
-+++ b/bindings/ocaml/Makefile.ocaml
-@@ -277,6 +277,8 @@ uninstall-local:: uninstall-deplibs
-
- build-deplibs: $(OutputLibs)
-
-+$(OcamlDir)/%.so: $(LibDir)/%.so
-+ $(Verb) ln -sf $< $@
- $(OcamlDir)/%.a: $(LibDir)/%.a
- $(Verb) ln -sf $< $@
-
-diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-index 0f28fad..e384838 100644
---- a/tools/llvm-config/BuildVariables.inc.in
-+++ b/tools/llvm-config/BuildVariables.inc.in
-@@ -27,3 +27,6 @@
- #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
- #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
- #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"
-+#define LLVM_ENABLE_DYLIB "@LLVM_BUILD_LLVM_DYLIB@"
-+#define LLVM_ENABLE_SHARED "@LLVM_ENABLE_SHARED@"
-+#define LLVM_DYLIB_COMPONENTS "@LLVM_DYLIB_COMPONENTS@"
-diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
-index dd53460..173f6dc 100644
---- a/tools/llvm-config/CMakeLists.txt
-+++ b/tools/llvm-config/CMakeLists.txt
-@@ -30,6 +30,11 @@ set(LLVM_BUILD_SYSTEM cmake)
- set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}")
- set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
- set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
-+if(BUILD_SHARED_LIBS)
-+ set(LLVM_ENABLE_SHARED ON)
-+else()
-+ set(LLVM_ENABLE_SHARED OFF)
-+endif()
- string(REPLACE ";" " " LLVM_TARGETS_BUILT "${LLVM_TARGETS_TO_BUILD}")
- configure_file(${BUILDVARIABLES_SRCPATH} ${BUILDVARIABLES_OBJPATH} @ONLY)
-
-diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 4ce8f10..51efbd8 100644
---- a/tools/llvm-config/llvm-config.cpp
-+++ b/tools/llvm-config/llvm-config.cpp
-@@ -30,6 +30,7 @@
- #include <cstdlib>
- #include <set>
- #include <vector>
-+#include <unordered_set>
-
- using namespace llvm;
-
-@@ -51,12 +52,16 @@ using namespace llvm;
- /// \param Name - The component to traverse.
- /// \param ComponentMap - A prebuilt map of component names to descriptors.
- /// \param VisitedComponents [in] [out] - The set of already visited components.
--/// \param RequiredLibs [out] - The ordered list of required libraries.
-+/// \param RequiredLibs [out] - The ordered list of required
-+/// libraries.
-+/// \param GetComponentNames - Get the component names instead of the
-+/// library name.
- static void VisitComponent(StringRef Name,
- const StringMap<AvailableComponent*> &ComponentMap,
- std::set<AvailableComponent*> &VisitedComponents,
- std::vector<StringRef> &RequiredLibs,
-- bool IncludeNonInstalled) {
-+ bool IncludeNonInstalled, bool GetComponentNames,
-+ const std::string *ActiveLibDir, bool *HasMissing) {
- // Lookup the component.
- AvailableComponent *AC = ComponentMap.lookup(Name);
- assert(AC && "Invalid component name!");
-@@ -74,12 +79,22 @@ static void VisitComponent(StringRef Name,
- // Otherwise, visit all the dependencies.
- for (unsigned i = 0; AC->RequiredLibraries[i]; ++i) {
- VisitComponent(AC->RequiredLibraries[i], ComponentMap, VisitedComponents,
-- RequiredLibs, IncludeNonInstalled);
-+ RequiredLibs, IncludeNonInstalled, GetComponentNames,
-+ ActiveLibDir, HasMissing);
-+ }
-+
-+ if (GetComponentNames) {
-+ RequiredLibs.push_back(Name);
-+ return;
- }
-
- // Add to the required library list.
-- if (AC->Library)
-+ if (AC->Library) {
-+ if (!IncludeNonInstalled && HasMissing && !*HasMissing && ActiveLibDir) {
-+ *HasMissing = !sys::fs::exists(*ActiveLibDir + "/" + AC->Library);
-+ }
- RequiredLibs.push_back(AC->Library);
-+ }
- }
-
- /// \brief Compute the list of required libraries for a given list of
-@@ -91,9 +106,12 @@ static void VisitComponent(StringRef Name,
- /// are required to link the given components.
- /// \param IncludeNonInstalled - Whether non-installed components should be
- /// reported.
-+/// \param GetComponentNames - True if one would prefer the component names.
- static void ComputeLibsForComponents(const std::vector<StringRef> &Components,
- std::vector<StringRef> &RequiredLibs,
-- bool IncludeNonInstalled) {
-+ bool IncludeNonInstalled, bool GetComponentNames,
-+ const std::string *ActiveLibDir,
-+ bool *HasMissing) {
- std::set<AvailableComponent*> VisitedComponents;
-
- // Build a map of component names to information.
-@@ -116,7 +134,8 @@ static void ComputeLibsForComponents(const std::vector<StringRef> &Components,
- }
-
- VisitComponent(ComponentLower, ComponentMap, VisitedComponents,
-- RequiredLibs, IncludeNonInstalled);
-+ RequiredLibs, IncludeNonInstalled, GetComponentNames,
-+ ActiveLibDir, HasMissing);
- }
-
- // The list is now ordered with leafs first, we want the libraries to printed
-@@ -157,6 +176,7 @@ Options:\n\
- --host-target Target triple used to configure LLVM.\n\
- --build-mode Print build mode of LLVM tree (e.g. Debug or Release).\n\
- --assertion-mode Print assertion mode of LLVM tree (ON or OFF).\n\
-+ --shared-mode Print how the provided components can be collectively linked (`shared` or `static`).\n\
- --build-system Print the build system used to build LLVM (autoconf or cmake).\n\
- Typical components:\n\
- all All LLVM libraries (default).\n\
-@@ -172,10 +192,38 @@ std::string GetExecutablePath(const char *Argv0) {
- return llvm::sys::fs::getMainExecutable(Argv0, P);
- }
-
-+/// \brief Expand the semi-colon delimited LLVM_DYLIB_COMPONENTS into
-+/// the full list of components.
-+std::vector<StringRef> GetAllDyLibComponents(const bool IsInDevelopmentTree,
-+ const bool GetComponentNames) {
-+ std::vector<StringRef> DyLibComponents;
-+ {
-+ StringRef DyLibComponentsStr(LLVM_DYLIB_COMPONENTS);
-+ size_t Offset = 0;
-+ while (true) {
-+ const size_t NextOffset = DyLibComponentsStr.find(';', Offset);
-+ DyLibComponents.push_back(DyLibComponentsStr.substr(Offset, NextOffset));
-+ if (NextOffset == std::string::npos) {
-+ break;
-+ }
-+ Offset = NextOffset + 1;
-+ }
-+
-+ assert(DyLibComponents.size() > 0);
-+ }
-+
-+ std::vector<StringRef> Components;
-+ ComputeLibsForComponents(DyLibComponents, Components,
-+ /*IncludeNonInstalled=*/IsInDevelopmentTree,
-+ GetComponentNames, nullptr, nullptr);
-+
-+ return std::move(Components);
-+}
-+
- int main(int argc, char **argv) {
- std::vector<StringRef> Components;
- bool PrintLibs = false, PrintLibNames = false, PrintLibFiles = false;
-- bool PrintSystemLibs = false;
-+ bool PrintSystemLibs = false, PrintSharedMode = false;
- bool HasAnyOption = false;
-
- // llvm-config is designed to support being run both from a development tree
-@@ -270,6 +318,108 @@ int main(int argc, char **argv) {
- ActiveIncludeOption = "-I" + ActiveIncludeDir;
- }
-
-+ /// We only use `shared library` mode in cases where the static library form
-+ /// of the components provided are not available; note however that this is
-+ /// skipped if we're run from within the build dir. However, once installed,
-+ /// we still need to provide correct output when the static archives are
-+ /// removed or, as in the case of CMake's `BUILD_SHARED_LIBS`, never present
-+ /// in the first place. This can't be done at configure/build time.
-+
-+ StringRef SharedExt, SharedVersionedExt, SharedDir, SharedPrefix, StaticExt,
-+ StaticPrefix, StaticDir = "lib";
-+ const Triple HostTriple(Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE));
-+ if (HostTriple.isOSWindows()) {
-+ SharedExt = "dll";
-+ SharedVersionedExt = PACKAGE_VERSION ".dll";
-+ StaticExt = "a";
-+ SharedDir = ActiveBinDir;
-+ StaticDir = ActiveLibDir;
-+ StaticPrefix = SharedPrefix = "";
-+ } else if (HostTriple.isOSDarwin()) {
-+ SharedExt = "dylib";
-+ SharedVersionedExt = PACKAGE_VERSION ".dylib";
-+ StaticExt = "a";
-+ StaticDir = SharedDir = ActiveLibDir;
-+ StaticPrefix = SharedPrefix = "lib";
-+ } else {
-+ // default to the unix values:
-+ SharedExt = "so";
-+ SharedVersionedExt = PACKAGE_VERSION ".so";
-+ StaticExt = "a";
-+ StaticDir = SharedDir = ActiveLibDir;
-+ StaticPrefix = SharedPrefix = "lib";
-+ }
-+
-+ const bool BuiltDyLib = (std::strcmp(LLVM_ENABLE_DYLIB, "ON") == 0);
-+
-+ enum { CMake, AutoConf } ConfigTool;
-+ if (std::strcmp(LLVM_BUILD_SYSTEM, "cmake") == 0) {
-+ ConfigTool = CMake;
-+ } else {
-+ ConfigTool = AutoConf;
-+ }
-+
-+ /// CMake style shared libs, ie each component is in a shared library.
-+ const bool BuiltSharedLibs =
-+ (ConfigTool == CMake && std::strcmp(LLVM_ENABLE_SHARED, "ON") == 0);
-+
-+ bool DyLibExists = false;
-+ const std::string DyLibName =
-+ (SharedPrefix + "LLVM-" + SharedVersionedExt).str();
-+
-+ if (BuiltDyLib) {
-+ DyLibExists = sys::fs::exists(SharedDir + "/" + DyLibName);
-+ }
-+
-+ /// Get the component's library name without the lib prefix and the
-+ /// extension. Returns true if Lib is in a recognized format.
-+ auto GetComponentLibraryNameSlice = [&](const StringRef &Lib,
-+ StringRef &Out) {
-+ if (Lib.startswith("lib")) {
-+ unsigned FromEnd;
-+ if (Lib.endswith(StaticExt)) {
-+ FromEnd = StaticExt.size() + 1;
-+ } else if (Lib.endswith(SharedExt)) {
-+ FromEnd = SharedExt.size() + 1;
-+ } else {
-+ FromEnd = 0;
-+ }
-+
-+ if (FromEnd != 0) {
-+ Out = Lib.slice(3, Lib.size() - FromEnd);
-+ return true;
-+ }
-+ }
-+
-+ return false;
-+ };
-+ /// Maps Unixizms to the host platform.
-+ auto GetComponentLibraryFileName = [&](const StringRef &Lib,
-+ const bool ForceShared) {
-+ std::string LibFileName = Lib;
-+ StringRef LibName;
-+ if (GetComponentLibraryNameSlice(Lib, LibName)) {
-+ if (BuiltSharedLibs || ForceShared) {
-+ LibFileName = (SharedPrefix + LibName + "." + SharedExt).str();
-+ } else {
-+ // default to static
-+ LibFileName = (StaticPrefix + LibName + "." + StaticExt).str();
-+ }
-+ }
-+
-+ return LibFileName;
-+ };
-+ /// Get the full path for a possibly shared component library.
-+ auto GetComponentLibraryPath = [&](const StringRef &Name,
-+ const bool ForceShared) {
-+ auto LibFileName = GetComponentLibraryFileName(Name, ForceShared);
-+ if (BuiltSharedLibs || ForceShared) {
-+ return (SharedDir + "/" + LibFileName).str();
-+ } else {
-+ return (StaticDir + "/" + LibFileName).str();
-+ }
-+ };
-+
- raw_ostream &OS = outs();
- for (int i = 1; i != argc; ++i) {
- StringRef Arg = argv[i];
-@@ -303,13 +453,33 @@ int main(int argc, char **argv) {
- } else if (Arg == "--libfiles") {
- PrintLibFiles = true;
- } else if (Arg == "--components") {
-+ /// If there are missing static archives and a dylib was
-+ /// built, print LLVM_DYLIB_COMPONENTS instead of everything
-+ /// in the manifest.
-+ std::vector<StringRef> Components;
- for (unsigned j = 0; j != array_lengthof(AvailableComponents); ++j) {
- // Only include non-installed components when in a development tree.
- if (!AvailableComponents[j].IsInstalled && !IsInDevelopmentTree)
- continue;
-
-- OS << ' ';
-- OS << AvailableComponents[j].Name;
-+ Components.push_back(AvailableComponents[j].Name);
-+ if (AvailableComponents[j].Library && !IsInDevelopmentTree) {
-+ if (DyLibExists &&
-+ !sys::fs::exists(GetComponentLibraryPath(
-+ AvailableComponents[j].Library, false))) {
-+ Components = GetAllDyLibComponents(IsInDevelopmentTree, true);
-+ std::sort(Components.begin(), Components.end());
-+ break;
-+ }
-+ }
-+ }
-+
-+ for (unsigned I = 0; I < Components.size(); ++I) {
-+ if (I) {
-+ OS << ' ';
-+ }
-+
-+ OS << Components[I];
- }
- OS << '\n';
- } else if (Arg == "--targets-built") {
-@@ -324,6 +494,8 @@ int main(int argc, char **argv) {
- #else
- OS << "ON\n";
- #endif
-+ } else if (Arg == "--shared-mode") {
-+ PrintSharedMode = true;
- } else if (Arg == "--build-system") {
- OS << LLVM_BUILD_SYSTEM << '\n';
- } else if (Arg == "--obj-root") {
-@@ -341,35 +513,84 @@ int main(int argc, char **argv) {
- if (!HasAnyOption)
- usage();
-
-- if (PrintLibs || PrintLibNames || PrintLibFiles || PrintSystemLibs) {
-+ if (PrintLibs || PrintLibNames || PrintLibFiles || PrintSystemLibs ||
-+ PrintSharedMode) {
-+
-+ if (PrintSharedMode && BuiltSharedLibs) {
-+ OS << "shared\n";
-+ return 0;
-+ }
-+
- // If no components were specified, default to "all".
- if (Components.empty())
- Components.push_back("all");
-
- // Construct the list of all the required libraries.
- std::vector<StringRef> RequiredLibs;
-+ bool HasMissing = false;
- ComputeLibsForComponents(Components, RequiredLibs,
-- /*IncludeNonInstalled=*/IsInDevelopmentTree);
-+ /*IncludeNonInstalled=*/IsInDevelopmentTree, false,
-+ &ActiveLibDir, &HasMissing);
-+
-+ if (PrintSharedMode) {
-+ std::unordered_set<std::string> FullDyLibComponents;
-+ std::vector<StringRef> DyLibComponents =
-+ GetAllDyLibComponents(IsInDevelopmentTree, false);
-+
-+ for (auto &Component : DyLibComponents) {
-+ FullDyLibComponents.insert(Component);
-+ }
-+ DyLibComponents.clear();
-+
-+ for (auto &Lib : RequiredLibs) {
-+ if (!FullDyLibComponents.count(Lib)) {
-+ OS << "static\n";
-+ return 0;
-+ }
-+ }
-+ FullDyLibComponents.clear();
-+
-+ if (HasMissing && DyLibExists) {
-+ OS << "shared\n";
-+ return 0;
-+ } else {
-+ OS << "static\n";
-+ return 0;
-+ }
-+ }
-
- if (PrintLibs || PrintLibNames || PrintLibFiles) {
-- for (unsigned i = 0, e = RequiredLibs.size(); i != e; ++i) {
-- StringRef Lib = RequiredLibs[i];
-- if (i)
-- OS << ' ';
-
-+ auto PrintForLib = [&](const StringRef &Lib, const bool ForceShared) {
- if (PrintLibNames) {
-- OS << Lib;
-+ OS << GetComponentLibraryFileName(Lib, ForceShared);
- } else if (PrintLibFiles) {
-- OS << ActiveLibDir << '/' << Lib;
-+ OS << GetComponentLibraryPath(Lib, ForceShared);
- } else if (PrintLibs) {
- // If this is a typical library name, include it using -l.
-- if (Lib.startswith("lib") && Lib.endswith(".a")) {
-- OS << "-l" << Lib.slice(3, Lib.size()-2);
-- continue;
-+ StringRef LibName;
-+ if (Lib.startswith("lib")) {
-+ if (GetComponentLibraryNameSlice(Lib, LibName)) {
-+ OS << "-l" << LibName;
-+ } else {
-+ OS << "-l:" << GetComponentLibraryFileName(Lib, ForceShared);
-+ }
-+ } else {
-+ // Otherwise, print the full path.
-+ OS << GetComponentLibraryPath(Lib, ForceShared);
- }
-+ }
-+ };
-+
-+ if (HasMissing && DyLibExists) {
-+ PrintForLib(DyLibName, true);
-+ } else {
-+ for (unsigned i = 0, e = RequiredLibs.size(); i != e; ++i) {
-+ StringRef Lib = RequiredLibs[i];
-+ if (i)
-+ OS << ' ';
-
-- // Otherwise, print the full path.
-- OS << ActiveLibDir << '/' << Lib;
-+ PrintForLib(Lib, false);
- }
- }
- OS << '\n';
---
-2.7.4
-
diff --git a/sys-devel/llvm/files/3.7.1/llvm-config-2.patch b/sys-devel/llvm/files/3.7.1/llvm-config-2.patch
deleted file mode 100644
index 2895d38d7a2c..000000000000
--- a/sys-devel/llvm/files/3.7.1/llvm-config-2.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 4abc261d14c886c21d24f639293a60ce45c1dca3 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Wed, 2 Dec 2015 16:04:56 +0100
-Subject: [PATCH 3/4] llvm-config: Clean up exported values, update for shared
- linking
-
-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,
-- 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 | 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 173f6dc..013ea8c 100644
---- a/tools/llvm-config/CMakeLists.txt
-+++ b/tools/llvm-config/CMakeLists.txt
-@@ -22,14 +22,19 @@ 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_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)
-
- # Use the C++ link flags, since they should be a superset of C link flags.
- set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}")
- set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
--set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
-+# We don't do static libs, so we don't need to supply any system-libs
-+set(LLVM_SYSTEM_LIBS "")
- if(BUILD_SHARED_LIBS)
- set(LLVM_ENABLE_SHARED ON)
- else()
-diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 51efbd8..315e5e1 100644
---- a/tools/llvm-config/llvm-config.cpp
-+++ b/tools/llvm-config/llvm-config.cpp
-@@ -487,7 +487,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";
-@@ -498,10 +499,19 @@ int main(int argc, char **argv) {
- PrintSharedMode = true;
- } else if (Arg == "--build-system") {
- OS << LLVM_BUILD_SYSTEM << '\n';
-- } else if (Arg == "--obj-root") {
-- OS << ActivePrefix << '\n';
-- } else if (Arg == "--src-root") {
-- OS << LLVM_SRC_ROOT << '\n';
-+ } else if (Arg == "--obj-root" || Arg == "--src-root") {
-+ if (IsInDevelopmentTree) {
-+ if (Arg == "--obj-root") {
-+ OS << ActivePrefix << '\n';
-+ } else {
-+ OS << LLVM_SRC_ROOT << '\n';
-+ }
-+ } else {
-+ // sources are not installed
-+ llvm::errs() << "llvm-config: sources not installed, "
-+ << Arg << " not available\n";
-+ exit(1);
-+ }
- } else {
- usage();
- }
-diff --git a/utils/llvm-build/llvmbuild/main.py b/utils/llvm-build/llvmbuild/main.py
-index 353741f..4ba5e91 100644
---- a/utils/llvm-build/llvmbuild/main.py
-+++ b/utils/llvm-build/llvmbuild/main.py
-@@ -393,6 +393,8 @@ subdirectories = %s
- //
- //===----------------------------------------------------------------------===//
-
-+#include "llvm/Config/config.h"
-+
- """)
- f.write('struct AvailableComponent {\n')
- f.write(' /// The name of the component.\n')
-@@ -413,7 +415,7 @@ subdirectories = %s
- if library_name is None:
- library_name_as_cstr = '0'
- else:
-- library_name_as_cstr = '"lib%s.a"' % library_name
-+ library_name_as_cstr = '"lib%s" LTDL_SHLIB_EXT' % library_name
- f.write(' { "%s", %s, %d, { %s } },\n' % (
- name, library_name_as_cstr, is_installed,
- ', '.join('"%s"' % dep
---
-2.7.4
-
diff --git a/sys-devel/llvm/files/3.7.1/llvm-config-3.patch b/sys-devel/llvm/files/3.7.1/llvm-config-3.patch
deleted file mode 100644
index 7a1547e255dc..000000000000
--- a/sys-devel/llvm/files/3.7.1/llvm-config-3.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 9308d1858852bdc6f099025ca0482d7b3a32a9aa Mon Sep 17 00:00:00 2001
-From: NAKAMURA Takumi <geek4civic@gmail.com>
-Date: Wed, 10 Feb 2016 01:12:55 +0000
-Subject: [PATCH 4/4] llvm-config: Quick fix for cross compilation. Don't be
- confsed between host and target. It has been there since r252532.
-
-FIXME: The clause may use conditions of host compiler, not HOST_TRIPLE.
-
-git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260343 91177308-0d34-0410-b5e6-96231b3b80d8
----
- tools/llvm-config/llvm-config.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 315e5e1..346c9d9 100644
---- a/tools/llvm-config/llvm-config.cpp
-+++ b/tools/llvm-config/llvm-config.cpp
-@@ -327,7 +327,7 @@ int main(int argc, char **argv) {
-
- StringRef SharedExt, SharedVersionedExt, SharedDir, SharedPrefix, StaticExt,
- StaticPrefix, StaticDir = "lib";
-- const Triple HostTriple(Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE));
-+ const Triple HostTriple(Triple::normalize(LLVM_HOST_TRIPLE));
- if (HostTriple.isOSWindows()) {
- SharedExt = "dll";
- SharedVersionedExt = PACKAGE_VERSION ".dll";
---
-2.7.4
-
diff --git a/sys-devel/llvm/files/3.7.1/msan-fix.patch b/sys-devel/llvm/files/3.7.1/msan-fix.patch
deleted file mode 100644
index e44baa8a5164..000000000000
--- a/sys-devel/llvm/files/3.7.1/msan-fix.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 8b0f2fff6e080c053e4fd94d44a694768b8c156e Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Wed, 5 Aug 2015 05:35:26 -0700
-Subject: [PATCH 78/84] Apply split-layout-llvm.patch
-
-https://llvm.org/bugs/show_bug.cgi?id=24155
----
- lib/Transforms/Instrumentation/MemorySanitizer.cpp | 31 ++++++++++++++++------
- 1 file changed, 23 insertions(+), 8 deletions(-)
-
-diff --git a/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/lib/Transforms/Instrumentation/MemorySanitizer.cpp
-index 286a563..2ab8bfc 100644
---- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp
-+++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp
-@@ -194,6 +194,12 @@ static cl::opt<bool> ClCheckConstantShadow("msan-check-constant-shadow",
- static const char *const kMsanModuleCtorName = "msan.module_ctor";
- static const char *const kMsanInitName = "__msan_init";
-
-+static cl::opt<bool> ClSplitLayout(
-+ "msan-split-layout", cl::desc(
-+ "use experimental memory layout compatible with "
-+ "non-pie and non-aslr execution"),
-+ cl::Hidden, cl::init(true));
-+
- namespace {
-
- // Memory map parameters used in application-to-shadow address calculation.
-@@ -228,6 +234,13 @@ static const MemoryMapParams Linux_X86_64_MemoryMapParams = {
- 0x200000000000, // OriginBase
- };
-
-+static const MemoryMapParams Linux_X86_64_Split_MemoryMapParams = {
-+ 0, // AndMask (not used)
-+ 0x500000000000, // XorMask
-+ 0, // ShadowBase (not used)
-+ 0x100000000000, // OriginBase
-+};
-+
- // mips64 Linux
- static const MemoryMapParams Linux_MIPS64_MemoryMapParams = {
- 0x004000000000, // AndMask
-@@ -483,7 +496,8 @@ bool MemorySanitizer::doInitialization(Module &M) {
- case Triple::Linux:
- switch (TargetTriple.getArch()) {
- case Triple::x86_64:
-- MapParams = Linux_X86_MemoryMapParams.bits64;
-+ MapParams = ClSplitLayout ? &Linux_X86_64_Split_MemoryMapParams
-+ : Linux_X86_MemoryMapParams.bits64;
- break;
- case Triple::x86:
- MapParams = Linux_X86_MemoryMapParams.bits32;
-@@ -893,16 +907,17 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
- ///
- /// Offset = (Addr & ~AndMask) ^ XorMask
- Value *getShadowPtrOffset(Value *Addr, IRBuilder<> &IRB) {
-+ Value *OffsetLong = IRB.CreatePointerCast(Addr, MS.IntptrTy);
-+
- uint64_t AndMask = MS.MapParams->AndMask;
-- assert(AndMask != 0 && "AndMask shall be specified");
-- Value *OffsetLong =
-- IRB.CreateAnd(IRB.CreatePointerCast(Addr, MS.IntptrTy),
-- ConstantInt::get(MS.IntptrTy, ~AndMask));
-+ if (AndMask)
-+ OffsetLong =
-+ IRB.CreateAnd(OffsetLong, ConstantInt::get(MS.IntptrTy, ~AndMask));
-
- uint64_t XorMask = MS.MapParams->XorMask;
-- if (XorMask != 0)
-- OffsetLong = IRB.CreateXor(OffsetLong,
-- ConstantInt::get(MS.IntptrTy, XorMask));
-+ if (XorMask)
-+ OffsetLong =
-+ IRB.CreateXor(OffsetLong, ConstantInt::get(MS.IntptrTy, XorMask));
- return OffsetLong;
- }
-
---
-2.6.4
-
diff --git a/sys-devel/llvm/llvm-3.7.1-r3.ebuild b/sys-devel/llvm/llvm-3.7.1-r3.ebuild
index 9da3d4f0aa30..5e3be43913a3 100644
--- a/sys-devel/llvm/llvm-3.7.1-r3.ebuild
+++ b/sys-devel/llvm/llvm-3.7.1-r3.ebuild
@@ -16,7 +16,8 @@ SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz
http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
lldb? ( http://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz )
- !doc? ( http://dev.gentoo.org/~voyageur/distfiles/${PN}-3.7.0-manpages.tar.bz2 )"
+ !doc? ( https://dev.gentoo.org/~voyageur/distfiles/${PN}-3.7.0-manpages.tar.bz2 )
+ https://dev.gentoo.org/~mgorny/dist/llvm/${P}-patchset.tar.gz"
# Additional licenses:
# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
@@ -156,21 +157,21 @@ src_prepare() {
# Make ocaml warnings non-fatal, bug #537308
sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml || die
# Fix libdir for ocaml bindings install, bug #559134
- eapply "${FILESDIR}"/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch
+ eapply "${WORKDIR}/${P}-patchset"/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch
# Do not build/install ocaml docs with USE=-doc, bug #562008
- eapply "${FILESDIR}"/3.9.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch
+ eapply "${WORKDIR}/${P}-patchset"/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch
# Make it possible to override Sphinx HTML install dirs
# https://llvm.org/bugs/show_bug.cgi?id=23780
- eapply "${FILESDIR}"/3.9.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
+ eapply "${WORKDIR}/${P}-patchset"/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
# Prevent race conditions with parallel Sphinx runs
# https://llvm.org/bugs/show_bug.cgi?id=23781
- eapply "${FILESDIR}"/3.8.1/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch
+ eapply "${WORKDIR}/${P}-patchset"/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch
# Prevent installing libgtest
# https://llvm.org/bugs/show_bug.cgi?id=18341
- eapply "${FILESDIR}"/3.8.1/0005-cmake-Do-not-install-libgtest.patch
+ eapply "${WORKDIR}/${P}-patchset"/0005-cmake-Do-not-install-libgtest.patch
# Fix llvm-config for shared linking, sane flags and return values
# in order:
@@ -180,49 +181,49 @@ src_prepare() {
# - backported r260343 that fixes cross-compilation
# combination of backported upstream r252532 with our patch
# https://bugs.gentoo.org/show_bug.cgi?id=565358
- eapply "${FILESDIR}"/3.7.1/llvm-config-0.patch
- eapply "${FILESDIR}"/3.7.1/llvm-config-1.patch
- eapply "${FILESDIR}"/3.7.1/llvm-config-2.patch
- eapply "${FILESDIR}"/3.7.1/llvm-config-3.patch
+ eapply "${WORKDIR}/${P}-patchset"/llvm-config-0.patch
+ eapply "${WORKDIR}/${P}-patchset"/llvm-config-1.patch
+ eapply "${WORKDIR}/${P}-patchset"/llvm-config-2.patch
+ eapply "${WORKDIR}/${P}-patchset"/llvm-config-3.patch
# Fix msan with newer kernels, #569894
- eapply "${FILESDIR}"/3.7.1/msan-fix.patch
+ eapply "${WORKDIR}/${P}-patchset"/msan-fix.patch
# disable use of SDK on OSX, bug #568758
sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
if use clang; then
# Automatically select active system GCC's libraries, bugs #406163 and #417913
- eapply "${FILESDIR}"/3.8.1/clang/gentoo-runtime-gcc-detection-v3.patch
+ eapply "${WORKDIR}/${P}-patchset"/clang/gentoo-runtime-gcc-detection-v3.patch
# Support gcc4.9 search paths
# https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3
- eapply "${FILESDIR}"/3.8.1/clang/gcc4.9-search-path.patch
+ eapply "${WORKDIR}/${P}-patchset"/clang/gcc4.9-search-path.patch
- eapply "${FILESDIR}"/3.7.1/clang/gentoo-install.patch
+ eapply "${WORKDIR}/${P}-patchset"/clang/gentoo-install.patch
- eapply "${FILESDIR}"/3.9.1/clang/darwin_prefix-include-paths.patch
+ eapply "${WORKDIR}/${P}-patchset"/clang/darwin_prefix-include-paths.patch
eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
# Fix -isystem support in ccc-analyzer
- eapply "${FILESDIR}"/3.7.1/clang/ccc-analyzer-isystem.patch
+ eapply "${WORKDIR}/${P}-patchset"/clang/ccc-analyzer-isystem.patch
sed -i -e "s^@EPREFIX@^${EPREFIX}^" \
tools/clang/tools/scan-build/scan-build || die
# Install clang runtime into /usr/lib/clang
# https://llvm.org/bugs/show_bug.cgi?id=23792
- eapply "${FILESDIR}"/3.7.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
- eapply "${FILESDIR}"/3.8.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
+ eapply "${WORKDIR}/${P}-patchset"/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
+ eapply "${WORKDIR}/${P}-patchset"/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
# Do not force -march flags on arm platforms
# https://bugs.gentoo.org/show_bug.cgi?id=562706
- eapply "${FILESDIR}"/3.7.1/compiler-rt/arm_march_flags.patch
+ eapply "${WORKDIR}/${P}-patchset"/compiler-rt/arm_march_flags.patch
# Make it possible to override CLANG_LIBDIR_SUFFIX
# (that is used only to find LLVMgold.so)
# https://llvm.org/bugs/show_bug.cgi?id=23793
- eapply "${FILESDIR}"/3.9.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
+ eapply "${WORKDIR}/${P}-patchset"/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
# Fix git-clang-format shebang, bug #562688
python_fix_shebang tools/clang/tools/clang-format/git-clang-format
@@ -230,7 +231,7 @@ src_prepare() {
pushd projects/compiler-rt >/dev/null || die
# Fix msan with newer kernels, compiler-rt part, #569894
- eapply "${FILESDIR}"/3.7.1/compiler-rt/msan-fix.patch
+ eapply "${WORKDIR}/${P}-patchset"/compiler-rt/msan-fix.patch
# Fix WX sections, bug #421527
find lib/builtins -type f -name '*.S' -exec sed \
@@ -247,13 +248,13 @@ src_prepare() {
-i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
# Fix Python paths, bugs #562436 and #562438
- eapply "${FILESDIR}"/3.7.1/lldb/python.patch
+ eapply "${WORKDIR}/${P}-patchset"/lldb/python.patch
sed -e "s/GENTOO_LIBDIR/$(get_libdir)/" \
-i tools/lldb/scripts/Python/finishSwigPythonLLDB.py || die
# Fix build with ncurses[tinfo], #560474
# http://llvm.org/viewvc/llvm-project?view=revision&revision=247842
- eapply "${FILESDIR}"/3.7.1/lldb/tinfo.patch
+ eapply "${WORKDIR}/${P}-patchset"/lldb/tinfo.patch
fi
# User patches