<pre style='margin:0'>
Jeremy Huddleston Sequoia (jeremyhu) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/c986f1ff0be895880a3731009a0786981d2dd3db">https://github.com/macports/macports-ports/commit/c986f1ff0be895880a3731009a0786981d2dd3db</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit c986f1ff0be895880a3731009a0786981d2dd3db
</span>Author: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
AuthorDate: Mon Dec 19 01:17:46 2016 -0800
<span style='display:block; white-space:pre;color:#404040;'> clang-3.[89]: Update dylib ids to not be @rpath-based
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Fixes https://trac.macports.org/ticket/52196
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
</span>---
lang/llvm-3.8/Portfile | 25 +++-
...h-O-CPU-Subtype-to-ppc7400-when-targeting.patch | 8 +-
...MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch | 10 +-
...ly-Update-install-targets-for-clang-subpo.patch | 8 +-
...ly-Use-full-path-for-the-dylib-id-instead.patch | 10 +-
...ly-Don-t-embed-the-deployment-target-in-t.patch | 8 +-
...nly-Skip-checking-for-python-in-configure.patch | 8 +-
...-override-of-raise-abort-and-__assert_rtn.patch | 8 +-
...-CMake-s-default-RPATH-for-the-unit-tests.patch | 45 +++++++
...rpath-construction-for-out-of-tree-builds.patch | 146 +++++++++++++++++++++
...CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch | 38 ++++++
.../0011-CMake-Fix-llvm_setup_rpath-function.patch | 70 ++++++++++
lang/llvm-3.9/Portfile | 28 ++--
...h-O-CPU-Subtype-to-ppc7400-when-targeting.patch | 15 ++-
...MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch | 17 +--
...ly-Don-t-embed-the-deployment-target-in-t.patch | 17 +--
...-CMake-s-default-RPATH-for-the-unit-tests.patch | 44 +++++++
...rpath-construction-for-out-of-tree-builds.patch | 145 ++++++++++++++++++++
...CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch | 37 ++++++
.../0007-CMake-Fix-llvm_setup_rpath-function.patch | 69 ++++++++++
20 files changed, 689 insertions(+), 67 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.8/Portfile b/lang/llvm-3.8/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index c4b57f1..617f089 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.8/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.8/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -12,8 +12,8 @@ PortGroup cmake 1.0
</span> set llvm_version 3.8
set llvm_version_no_dot 38
name llvm-${llvm_version}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-subport clang-${llvm_version} { revision 6 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+subport clang-${llvm_version} { revision 7 }
</span> set suffix mp-${llvm_version}
set sub_prefix ${prefix}/libexec/llvm-${llvm_version}
dist_subdir llvm
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -122,6 +122,10 @@ patchfiles \
</span> 0005-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch \
0006-MacPorts-Only-Skip-checking-for-python-in-configure.patch \
0007-Remove-override-of-raise-abort-and-__assert_rtn.patch \
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0008-CMake-Use-CMake-s-default-RPATH-for-the-unit-tests.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0009-CMake-Fix-rpath-construction-for-out-of-tree-builds.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0010-CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0011-CMake-Fix-llvm_setup_rpath-function.patch \
</span> llvm-skip-unittests.patch
if {${subport} eq "clang-${llvm_version}"} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -178,11 +182,20 @@ configure.post_args ../${worksrcdir}
</span> default configure.dir {${workpath}/build}
default build.dir {${workpath}/build}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# https://llvm.org/bugs/show_bug.cgi?id=25664
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-configure.ldflags-append -Wl,-rpath,@loader_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+cmake.install_prefix ${sub_prefix}
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# https://trac.macports.org/ticket/51542
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-configure.ldflags-append -Wl,-rpath,@loader_path/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Adjust this once cmake-1.0.tcl is fixed:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://github.com/macports/macports-ports/pull/103
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Also see:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://llvm.org/bugs/show_bug.cgi?id=31425
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+configure.args-delete \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_INSTALL_RPATH=${prefix}/lib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_SYSTEM_PREFIX_PATH="${prefix}\;/usr"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+configure.args-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_INSTALL_NAME_DIR=${cmake.install_prefix}/lib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_INSTALL_RPATH=${cmake.install_prefix}/lib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_SYSTEM_PREFIX_PATH="${cmake.install_prefix}\;${prefix}\;/usr"
</span>
configure.args-append \
-DLLVM_LINK_LLVM_DYLIB=ON \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.8/files/0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch b/lang/llvm-3.8/files/0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index c7871d2..a983557 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.8/files/0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.8/files/0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,7 +1,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From 6bba00c71e59ac9cd2db1e630fe4a94b7451a220 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 86d1c75748b926060477ddbf6180be724e804f85 Mon Sep 17 00:00:00 2001
</span> From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 17 Jan 2015 09:03:43 -0800
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 1/7] Set the Mach-O CPU Subtype to ppc7400 when targeting
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 01/11] Set the Mach-O CPU Subtype to ppc7400 when targeting
</span> Leopard
http://llvm.org/bugs/show_bug.cgi?id=18463
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -12,7 +12,7 @@ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
</span> 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git llvm_release_38/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp macports_release_38/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index b6dd595..11a7953 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index b6dd595ffb0..11a7953a634 100644
</span> --- llvm_release_38/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
+++ macports_release_38/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
@@ -201,16 +201,23 @@ public:
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -51,5 +51,5 @@ index b6dd595..11a7953 100644
</span> uint8_t OSABI = MCELFObjectTargetWriter::getOSABI(TT.getOS());
bool IsLittleEndian = TT.getArch() == Triple::ppc64le;
--
<span style='display:block; white-space:pre;background:#ffe0e0;'>-2.7.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.8/files/0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch b/lang/llvm-3.8/files/0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index 8162b9d..169cec3 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.8/files/0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.8/files/0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,8 +1,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From 1c7867cfc6dd0ebf1450001d634a7e7e0a313e6a Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 2d3b42ca895e411fc57fce07e9dcf8a1cbbe276f Mon Sep 17 00:00:00 2001
</span> From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sun, 18 Jan 2015 11:18:13 -0800
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 2/7] Define EXC_MASK_CRASH and MACH_EXCEPTION_CODES if they're
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- not defined in the SDK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 02/11] Define EXC_MASK_CRASH and MACH_EXCEPTION_CODES if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ they're not defined in the SDK
</span>
The 10.4 SDK does not define these macros
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -12,7 +12,7 @@ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
</span> 1 file changed, 9 insertions(+)
diff --git llvm_release_38/lib/Support/Unix/Signals.inc macports_release_38/lib/Support/Unix/Signals.inc
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 061cdb3..4d687b3 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 061cdb3da21..4d687b304cc 100644
</span> --- llvm_release_38/lib/Support/Unix/Signals.inc
+++ macports_release_38/lib/Support/Unix/Signals.inc
@@ -387,6 +387,15 @@ void llvm::sys::PrintStackTraceOnErrorSignal(bool DisableCrashReporting) {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -32,5 +32,5 @@ index 061cdb3..4d687b3 100644
</span> if (DisableCrashReporting || getenv("LLVM_DISABLE_CRASH_REPORT")) {
mach_port_t self = mach_task_self();
--
<span style='display:block; white-space:pre;background:#ffe0e0;'>-2.7.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.8/files/0003-MacPorts-Only-Update-install-targets-for-clang-subpo.patch b/lang/llvm-3.8/files/0003-MacPorts-Only-Update-install-targets-for-clang-subpo.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index 064be7d..0e489ec 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.8/files/0003-MacPorts-Only-Update-install-targets-for-clang-subpo.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.8/files/0003-MacPorts-Only-Update-install-targets-for-clang-subpo.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,7 +1,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From 6719d80f133381ed543e73ef853ab326e0445657 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 87af0e6e5584b579e252f7e2b8e37f3c5e1b0c98 Mon Sep 17 00:00:00 2001
</span> From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 17 Jan 2015 16:33:09 -0800
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 3/7] MacPorts Only: Update install targets for clang subport
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 03/11] MacPorts Only: Update install targets for clang subport
</span>
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -9,7 +9,7 @@ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
</span> 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git llvm_release_38/Makefile macports_release_38/Makefile
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 2b9468a..19fbfdc 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 2b9468af205..19fbfdc7aa4 100644
</span> --- llvm_release_38/Makefile
+++ macports_release_38/Makefile
@@ -70,9 +70,11 @@ ifeq ($(MAKECMDGOALS),install-clang)
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -27,5 +27,5 @@ index 2b9468a..19fbfdc 100644
</span> NO_INSTALL = 1
endif
--
<span style='display:block; white-space:pre;background:#ffe0e0;'>-2.7.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.8/files/0004-MacPorts-Only-Use-full-path-for-the-dylib-id-instead.patch b/lang/llvm-3.8/files/0004-MacPorts-Only-Use-full-path-for-the-dylib-id-instead.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index bd2ca99..9a1a05c 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.8/files/0004-MacPorts-Only-Use-full-path-for-the-dylib-id-instead.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.8/files/0004-MacPorts-Only-Use-full-path-for-the-dylib-id-instead.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,8 +1,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From 23339e9b32d7456ec6a964f9cda01dac78f1128d Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 7ee8352634daf657f333a3ab1b98f843e19c919a Mon Sep 17 00:00:00 2001
</span> From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 17 Jan 2015 16:34:41 -0800
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 4/7] MacPorts Only: Use full path for the dylib id instead of
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- @rpath
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 04/11] MacPorts Only: Use full path for the dylib id instead
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ of @rpath
</span>
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -10,7 +10,7 @@ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
</span> 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git llvm_release_38/Makefile.rules macports_release_38/Makefile.rules
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index a67aef7..def94c0 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index a67aef7c97a..def94c0b340 100644
</span> --- llvm_release_38/Makefile.rules
+++ macports_release_38/Makefile.rules
@@ -600,7 +600,12 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -28,5 +28,5 @@ index a67aef7..def94c0 100644
</span> endif
endif
--
<span style='display:block; white-space:pre;background:#ffe0e0;'>-2.7.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.8/files/0005-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch b/lang/llvm-3.8/files/0005-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index 10056cd..8d9f47a 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.8/files/0005-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.8/files/0005-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,7 +1,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From 25522bcea0e4f092f32ed4ab05d34d37618623a8 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 477b2ea04081def781f4225c2076a52ef001e066 Mon Sep 17 00:00:00 2001
</span> From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 17 Jan 2015 16:41:30 -0800
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 5/7] MacPorts Only: Don't embed the deployment target in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 05/11] MacPorts Only: Don't embed the deployment target in the
</span> asm when using -fno-integrated-as
http://llvm.org/bugs/show_bug.cgi?id=21636
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -12,7 +12,7 @@ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
</span> 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git llvm_release_38/lib/CodeGen/AsmPrinter/AsmPrinter.cpp macports_release_38/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 5f67d3d..8824bd3 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 5f67d3daa97..8824bd313c5 100644
</span> --- llvm_release_38/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ macports_release_38/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -193,7 +193,7 @@ bool AsmPrinter::doInitialization(Module &M) {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -25,5 +25,5 @@ index 5f67d3d..8824bd3 100644
</span> MCVersionMinType VersionType;
if (TT.isWatchOS()) {
--
<span style='display:block; white-space:pre;background:#ffe0e0;'>-2.7.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.8/files/0006-MacPorts-Only-Skip-checking-for-python-in-configure.patch b/lang/llvm-3.8/files/0006-MacPorts-Only-Skip-checking-for-python-in-configure.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index 97fe0c9..070c71f 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.8/files/0006-MacPorts-Only-Skip-checking-for-python-in-configure.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.8/files/0006-MacPorts-Only-Skip-checking-for-python-in-configure.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,7 +1,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From bda46b8c958c6ad05fdfdb8baed181ac3d4a138f Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 8d4558d5fd15959fc816e663e3599a980f3b64b8 Mon Sep 17 00:00:00 2001
</span> From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 17 Jan 2015 16:43:00 -0800
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 6/7] MacPorts Only: Skip checking for python in configure
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 06/11] MacPorts Only: Skip checking for python in configure
</span>
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -9,7 +9,7 @@ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
</span> 1 file changed, 87 deletions(-)
diff --git llvm_release_38/configure macports_release_38/configure
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index c94fb13..0d01ba1 100755
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index c94fb134485..0d01ba14daa 100755
</span> --- llvm_release_38/configure
+++ macports_release_38/configure
@@ -8483,93 +8483,6 @@ CXXFLAGS="$llvm_cv_old_cxxflags"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -107,5 +107,5 @@ index c94fb13..0d01ba1 100755
</span> echo $ECHO_N "checking for sin in -lm... $ECHO_C" >&6; }
if test "${ac_cv_lib_m_sin+set}" = set; then
--
<span style='display:block; white-space:pre;background:#ffe0e0;'>-2.7.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.8/files/0007-Remove-override-of-raise-abort-and-__assert_rtn.patch b/lang/llvm-3.8/files/0007-Remove-override-of-raise-abort-and-__assert_rtn.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index 1b485d5..f06b098 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.8/files/0007-Remove-override-of-raise-abort-and-__assert_rtn.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.8/files/0007-Remove-override-of-raise-abort-and-__assert_rtn.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,7 +1,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From 51958b26c17d9d51ca5f7bb1ee52af34ef5f444b Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 4226b6ab382bab8f5669b2c0dc914bceed2cdc16 Mon Sep 17 00:00:00 2001
</span> From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 16 Jan 2016 10:19:07 -0800
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 7/7] Remove override of raise(), abort(), and __assert_rtn()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 07/11] Remove override of raise(), abort(), and __assert_rtn()
</span>
Lion (10.7) and newer versions of OS X implement abort() using pthread_kill().
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -11,7 +11,7 @@ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
</span> 1 file changed, 39 deletions(-)
diff --git llvm_release_38/lib/Support/Unix/Signals.inc macports_release_38/lib/Support/Unix/Signals.inc
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 4d687b3..f2797a0 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 4d687b304cc..f2797a028fb 100644
</span> --- llvm_release_38/lib/Support/Unix/Signals.inc
+++ macports_release_38/lib/Support/Unix/Signals.inc
@@ -411,42 +411,3 @@ void llvm::sys::PrintStackTraceOnErrorSignal(bool DisableCrashReporting) {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -58,5 +58,5 @@ index 4d687b3..f2797a0 100644
</span> -
-#endif
--
<span style='display:block; white-space:pre;background:#ffe0e0;'>-2.7.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.8/files/0008-CMake-Use-CMake-s-default-RPATH-for-the-unit-tests.patch b/lang/llvm-3.8/files/0008-CMake-Use-CMake-s-default-RPATH-for-the-unit-tests.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..c8f2249
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.8/files/0008-CMake-Use-CMake-s-default-RPATH-for-the-unit-tests.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,45 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 02917ad7dd891ae715d2dc274198239072357a6c Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Diana Picus <diana.picus@linaro.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Wed, 7 Sep 2016 08:37:15 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 08/11] [CMake] Use CMake's default RPATH for the unit tests
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+In the top-level CMakeLists.txt, we set CMAKE_BUILD_WITH_INSTALL_RPATH to ON,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+and then for the unit tests we set it to <test>/../../lib. This works for tests
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+that live in unittest/<whatever>, but not for those that live in subdirectories
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+e.g. unittest/Transforms/IPO or unittest/ExecutionEngine/Orc. When building
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+with BUILD_SHARED_LIBRARIES, such tests don't manage to find their libraries.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Since the tests are run from the build directory, it makes sense to set their
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+RPATH for the build tree, rather than the install tree. This is the default in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+CMake since 2.6, so all we have to do is set CMAKE_BUILD_WITH_INSTALL_RPATH to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+OFF for the unit tests.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280791 91177308-0d34-0410-b5e6-96231b3b80d8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 1317eef21cdf7989d233a6f08322283a217eeb20)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 245eb3018094f4c1f645283899d80c2b00e2c2d6)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ unittests/CMakeLists.txt | 8 +++-----
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 3 insertions(+), 5 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_38/unittests/CMakeLists.txt macports_release_38/unittests/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index e5befcec6e0..93a9c7b96dd 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_38/unittests/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_38/unittests/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,11 +1,9 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_custom_target(UnitTests)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set_target_properties(UnitTests PROPERTIES FOLDER "Tests")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-if (APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_INSTALL_RPATH "@executable_path/../../lib")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-else(UNIX)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_INSTALL_RPATH "\$ORIGIN/../../lib${LLVM_LIBDIR_SUFFIX}")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# People tend to run the tests _before_ installing, so we don't want the install
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# rpath here.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ function(add_llvm_unittest test_dirname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_unittest(UnitTests ${test_dirname} ${ARGN})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.8/files/0009-CMake-Fix-rpath-construction-for-out-of-tree-builds.patch b/lang/llvm-3.8/files/0009-CMake-Fix-rpath-construction-for-out-of-tree-builds.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..8f062af
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.8/files/0009-CMake-Fix-rpath-construction-for-out-of-tree-builds.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,146 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From c61e3a83823a7db9ef5dcb5022d7dc010fd18dfd Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Chris Bieneman <beanz@apple.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Tue, 1 Nov 2016 17:44:58 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 09/11] [CMake] Fix rpath construction for out-of-tree builds
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+MIME-Version: 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Content-Type: text/plain; charset=UTF-8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Content-Transfer-Encoding: 8bit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+This patch was produced in conjunction with Michał Górny. It should resolve the issues that were trying to be solved by D25304.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+This moves rpath handling into `llvm_add_library` and `add_llvm_executable` so that it is available to all projects using AddLLVM whether built in-tree or out-of-tree.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285714 91177308-0d34-0410-b5e6-96231b3b80d8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 3a876bdaec4dd8e43d21e0ce369f17db274431c0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285881 91177308-0d34-0410-b5e6-96231b3b80d8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 8186cc4fdc9cd8baab93701661fee48d9faf1b08)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 17b58adf673bc4339bfc910b5d2739ec11e7acdd)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CMakeLists.txt | 14 --------------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cmake/modules/AddLLVM.cmake | 43 +++++++++++++++++++++++++++++++++++++++++--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ unittests/CMakeLists.txt | 4 ----
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 3 files changed, 41 insertions(+), 20 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_38/CMakeLists.txt macports_release_38/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index be9f85019b1..5fe2b320292 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_38/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_38/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -558,20 +558,6 @@ set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-if (APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_INSTALL_NAME_DIR "@rpath")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-else(UNIX)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if(NOT DEFINED CMAKE_INSTALL_RPATH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,origin")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,origin")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- endif(NOT DEFINED CMAKE_INSTALL_RPATH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(APPLE AND DARWIN_LTO_LIBRARY)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(CMAKE_EXE_LINKER_FLAGS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "${CMAKE_EXE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_38/cmake/modules/AddLLVM.cmake macports_release_38/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index a829751eca8..b4eed385dcf 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_38/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_38/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -401,6 +401,9 @@ function(llvm_add_library name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elseif(ARG_SHARED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_windows_version_resource_file(ALL_FILES ${ALL_FILES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_library(${name} SHARED ${ALL_FILES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ llvm_setup_rpath(${name})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_library(${name} STATIC ${ALL_FILES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -606,7 +609,7 @@ endmacro(add_llvm_loadable_module name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ macro(add_llvm_executable name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cmake_parse_arguments(ARG "DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO" "" "" ${ARGN})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cmake_parse_arguments(ARG "DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO;NO_INSTALL_RPATH" "" "" ${ARGN})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ llvm_process_sources( ALL_FILES ${ARG_UNPARSED_ARGUMENTS} )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Generate objlib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -636,6 +639,10 @@ macro(add_llvm_executable name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_executable(${name} ${ALL_FILES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(NOT ARG_NO_INSTALL_RPATH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ llvm_setup_rpath(${name})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(DEFINED windows_resource_file)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set_windows_version_resource_properties(${name} ${windows_resource_file})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -886,7 +893,7 @@ function(add_unittest test_suite test_name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(LLVM_REQUIRES_RTTI OFF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ list(APPEND LLVM_LINK_COMPONENTS Support) # gtest needs it for raw_ostream
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- add_llvm_executable(${test_name} IGNORE_EXTERNALIZE_DEBUGINFO ${ARGN})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ add_llvm_executable(${test_name} IGNORE_EXTERNALIZE_DEBUGINFO NO_INSTALL_RPATH ${ARGN})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set_output_directory(${test_name} BINARY_DIR ${outdir} LIBRARY_DIR ${outdir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ target_link_libraries(${test_name} gtest_main gtest)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1201,3 +1208,35 @@ function(llvm_externalize_debuginfo name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ message(FATAL_ERROR "LLVM_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endfunction()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++function(llvm_setup_rpath name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(LLVM_INSTALL_PREFIX AND NOT (LLVM_INSTALL_PREFIX STREQUAL CMAKE_INSTALL_PREFIX))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(extra_libdir ${LLVM_LIBRARY_DIR})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elseif(LLVM_BUILD_LIBRARY_DIR)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(extra_libdir ${LLVM_LIBRARY_DIR})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(_install_name_dir INSTALL_NAME_DIR "@rpath")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(_install_rpath "@loader_path/../lib" ${extra_libdir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elseif(UNIX)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(NOT DEFINED CMAKE_INSTALL_RPATH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_property(TARGET ${name} APPEND_STRING PROPERTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LINK_FLAGS " -Wl,-z,origin ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT LLVM_LINKER_IS_GOLD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # $ORIGIN is not interpreted at link time by ld.bfd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_property(TARGET ${name} APPEND_STRING PROPERTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LINK_FLAGS " -Wl,-rpath-link,${LLVM_LIBRARY_OUTPUT_INTDIR} ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_target_properties(${name} PROPERTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ BUILD_WITH_INSTALL_RPATH On
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ INSTALL_RPATH "${_install_rpath}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ${_install_name_dir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++endfunction()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_38/unittests/CMakeLists.txt macports_release_38/unittests/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 93a9c7b96dd..2fac4a4d45a 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_38/unittests/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_38/unittests/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,10 +1,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_custom_target(UnitTests)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set_target_properties(UnitTests PROPERTIES FOLDER "Tests")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# People tend to run the tests _before_ installing, so we don't want the install
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# rpath here.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ function(add_llvm_unittest test_dirname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_unittest(UnitTests ${test_dirname} ${ARGN})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endfunction()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.8/files/0010-CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch b/lang/llvm-3.8/files/0010-CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..df6d825
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.8/files/0010-CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,38 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 5fc9b3c40d4e4a17ee8efc9ab31d9b907d92ebf4 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: John Brawn <john.brawn@arm.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Thu, 3 Nov 2016 13:55:04 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 10/11] [CMake] Make CMAKE_INSTALL_RPATH work again
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+r285714 made it so that when CMAKE_INSTALL_RPATH is set _install_rpath is not
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set, but that means INSTALL_RPATH gets set to an empty string which isn't what
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+we want. Fix this by setting INSTALL_RPATH only when _install_rpath is set.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285908 91177308-0d34-0410-b5e6-96231b3b80d8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit a0e0673b0f73cebabf73e8a7817e871ad54cb24f)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 3ed98f00a5294193a85f59f6b4a828292f53cab9)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cmake/modules/AddLLVM.cmake | 10 ++++++----
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 6 insertions(+), 4 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_38/cmake/modules/AddLLVM.cmake macports_release_38/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index b4eed385dcf..93edd25eead 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_38/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_38/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1235,8 +1235,10 @@ function(llvm_setup_rpath name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_target_properties(${name} PROPERTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- BUILD_WITH_INSTALL_RPATH On
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- INSTALL_RPATH "${_install_rpath}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ${_install_name_dir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(DEFINED _install_rpath)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_target_properties(${name} PROPERTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ BUILD_WITH_INSTALL_RPATH On
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ INSTALL_RPATH "${_install_rpath}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ${_install_name_dir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endfunction()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.8/files/0011-CMake-Fix-llvm_setup_rpath-function.patch b/lang/llvm-3.8/files/0011-CMake-Fix-llvm_setup_rpath-function.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..db11948
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.8/files/0011-CMake-Fix-llvm_setup_rpath-function.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,70 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 6a27224c1f53b40abb0afd248a8aba5e0efefd79 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Mandeep Singh Grang <mgrang@codeaurora.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Tue, 8 Nov 2016 00:45:05 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 11/11] [CMake] Fix llvm_setup_rpath function
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Summary:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Set _install_rpath to CMAKE_INSTALL_RPATH if it is defined, so that eventually
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+INSTALL_RPATH is set to CMAKE_INSTALL_RPATH.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+The "if(NOT DEFINED CMAKE_INSTALL_RPATH)" was missing a corresponding else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+clause.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+This also cleans up the fix made in r285908.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Patch by Azharuddin Mohammed
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Reviewers: john.brawn, sgundapa, beanz
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subscribers: chapuni, mgorny, llvm-commits
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Differential Revision: https://reviews.llvm.org/D26289
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286184 91177308-0d34-0410-b5e6-96231b3b80d8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit e7ffbb5a0ee6a7f07c507dc757cffc9bb57532e3)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 4f80b27f5ad321f10ddab6c924efb5fdb250232a)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cmake/modules/AddLLVM.cmake | 22 ++++++++++++----------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 12 insertions(+), 10 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_38/cmake/modules/AddLLVM.cmake macports_release_38/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 93edd25eead..f61786a1fbd 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_38/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_38/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1210,6 +1210,10 @@ function(llvm_externalize_debuginfo name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endfunction()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ function(llvm_setup_rpath name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(CMAKE_INSTALL_RPATH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(LLVM_INSTALL_PREFIX AND NOT (LLVM_INSTALL_PREFIX STREQUAL CMAKE_INSTALL_PREFIX))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(extra_libdir ${LLVM_LIBRARY_DIR})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elseif(LLVM_BUILD_LIBRARY_DIR)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1220,16 +1224,14 @@ function(llvm_setup_rpath name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(_install_name_dir INSTALL_NAME_DIR "@rpath")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(_install_rpath "@loader_path/../lib" ${extra_libdir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elseif(UNIX)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if(NOT DEFINED CMAKE_INSTALL_RPATH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_property(TARGET ${name} APPEND_STRING PROPERTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- LINK_FLAGS " -Wl,-z,origin ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT LLVM_LINKER_IS_GOLD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # $ORIGIN is not interpreted at link time by ld.bfd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_property(TARGET ${name} APPEND_STRING PROPERTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- LINK_FLAGS " -Wl,-rpath-link,${LLVM_LIBRARY_OUTPUT_INTDIR} ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_property(TARGET ${name} APPEND_STRING PROPERTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LINK_FLAGS " -Wl,-z,origin ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT LLVM_LINKER_IS_GOLD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # $ORIGIN is not interpreted at link time by ld.bfd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_property(TARGET ${name} APPEND_STRING PROPERTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LINK_FLAGS " -Wl,-rpath-link,${LLVM_LIBRARY_OUTPUT_INTDIR} ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.9/Portfile b/lang/llvm-3.9/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 08720cd..8e0fa3c 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.9/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.9/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -12,8 +12,8 @@ PortGroup cmake 1.0
</span> set llvm_version 3.9
set llvm_version_no_dot 39
name llvm-${llvm_version}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-subport clang-${llvm_version} { revision 1 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+subport clang-${llvm_version} { revision 2 }
</span> set suffix mp-${llvm_version}
set sub_prefix ${prefix}/libexec/llvm-${llvm_version}
dist_subdir llvm
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -116,7 +116,11 @@ patch.pre_args -p1
</span> patchfiles \
0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch \
0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- 0003-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0003-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0004-CMake-Use-CMake-s-default-RPATH-for-the-unit-tests.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0005-CMake-Fix-rpath-construction-for-out-of-tree-builds.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0006-CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0007-CMake-Fix-llvm_setup_rpath-function.patch \
</span>
if {${subport} eq "clang-${llvm_version}"} {
patchfiles-append \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -159,15 +163,23 @@ configure.post_args ../${worksrcdir}
</span> default configure.dir {${workpath}/build}
default build.dir {${workpath}/build}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# https://llvm.org/bugs/show_bug.cgi?id=25664
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-configure.ldflags-append -Wl,-rpath,@loader_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+cmake.install_prefix ${sub_prefix}
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# https://trac.macports.org/ticket/51542
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-configure.ldflags-append -Wl,-rpath,@loader_path/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Adjust this once cmake-1.0.tcl is fixed:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://github.com/macports/macports-ports/pull/103
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Also see:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://llvm.org/bugs/show_bug.cgi?id=31425
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+configure.args-delete \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_INSTALL_RPATH=${prefix}/lib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_SYSTEM_PREFIX_PATH="${prefix}\;/usr"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+configure.args-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_INSTALL_NAME_DIR=${cmake.install_prefix}/lib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_INSTALL_RPATH=${cmake.install_prefix}/lib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_SYSTEM_PREFIX_PATH="${cmake.install_prefix}\;${prefix}\;/usr"
</span>
configure.args-append \
-DLLVM_LINK_LLVM_DYLIB=ON \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- -DCMAKE_INSTALL_PREFIX="${sub_prefix}" \
</span> -DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_INCLUDE_TESTS=OFF \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.9/files/0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch b/lang/llvm-3.9/files/0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index cb96df4..712066d 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.9/files/0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.9/files/0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,20 +1,21 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From 7c7ac9a92497d52494a841bd1bcf6df07b0f4d13 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 92d88eee4f3aa03e5a88b558c58769f87cca1c1e Mon Sep 17 00:00:00 2001
</span> From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 17 Jan 2015 09:03:43 -0800
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 1/4] Set the Mach-O CPU Subtype to ppc7400 when targeting
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 1/7] Set the Mach-O CPU Subtype to ppc7400 when targeting
</span> Leopard
http://llvm.org/bugs/show_bug.cgi?id=18463
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
<span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit f2bd8ed3aaa9cd272e21a739705fee6afffba4b0)
</span> ---
lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
<span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm_master/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp macports_master/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index b6dd595..11a7953 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm_master/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ macports_master/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_39/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp macports_release_39/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 9100ecb4aa3..ac418f872bc 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_39/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_39/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
</span> @@ -201,16 +201,23 @@ public:
// FIXME: This should be in a separate file.
namespace {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -51,5 +52,5 @@ index b6dd595..11a7953 100644
</span> uint8_t OSABI = MCELFObjectTargetWriter::getOSABI(TT.getOS());
bool IsLittleEndian = TT.getArch() == Triple::ppc64le;
--
<span style='display:block; white-space:pre;background:#ffe0e0;'>-2.7.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.9/files/0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch b/lang/llvm-3.9/files/0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index 5ed85c5..73d8919 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.9/files/0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.9/files/0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,21 +1,22 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From 8600795c2b9d37dc8eb8aa18dc38e7abe8767a36 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 48faf64faafddad1d6126041596311ae5da6dcf9 Mon Sep 17 00:00:00 2001
</span> From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sun, 18 Jan 2015 11:18:13 -0800
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 2/4] Define EXC_MASK_CRASH and MACH_EXCEPTION_CODES if they're
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 2/7] Define EXC_MASK_CRASH and MACH_EXCEPTION_CODES if they're
</span> not defined in the SDK
The 10.4 SDK does not define these macros
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
<span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 58e0ca509dce8b37570b5e15243320fc07a5d6fa)
</span> ---
lib/Support/Unix/Signals.inc | 9 +++++++++
1 file changed, 9 insertions(+)
<span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm_master/lib/Support/Unix/Signals.inc macports_master/lib/Support/Unix/Signals.inc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 061cdb3..4d687b3 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm_master/lib/Support/Unix/Signals.inc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ macports_master/lib/Support/Unix/Signals.inc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -387,6 +387,15 @@ void llvm::sys::PrintStackTraceOnErrorSignal(bool DisableCrashReporting) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_39/lib/Support/Unix/Signals.inc macports_release_39/lib/Support/Unix/Signals.inc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 55fd76d375a..e39586c7f07 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_39/lib/Support/Unix/Signals.inc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_39/lib/Support/Unix/Signals.inc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -480,6 +480,15 @@ void llvm::sys::PrintStackTraceOnErrorSignal(StringRef Argv0,
</span> AddSignalHandler(PrintStackTraceSignalHandler, nullptr);
#if defined(__APPLE__) && defined(ENABLE_CRASH_OVERRIDES)
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -32,5 +33,5 @@ index 061cdb3..4d687b3 100644
</span> if (DisableCrashReporting || getenv("LLVM_DISABLE_CRASH_REPORT")) {
mach_port_t self = mach_task_self();
--
<span style='display:block; white-space:pre;background:#ffe0e0;'>-2.7.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.9/files/0003-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch b/lang/llvm-3.9/files/0003-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index e609583..47d7f96 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.9/files/0003-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.9/files/0003-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,21 +1,22 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From f37d1e0f822b626119ca4b8873bf54418734e75a Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 412343efb52b4b702d8b8641914dc932efaa5cb0 Mon Sep 17 00:00:00 2001
</span> From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 17 Jan 2015 16:41:30 -0800
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 3/4] MacPorts Only: Don't embed the deployment target in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 3/7] MacPorts Only: Don't embed the deployment target in the
</span> asm when using -fno-integrated-as
http://llvm.org/bugs/show_bug.cgi?id=21636
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
<span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 374ad0a4b557d2255183fc19883856261ee80a96)
</span> ---
lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
<span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git llvm_master/lib/CodeGen/AsmPrinter/AsmPrinter.cpp macports_master/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 4d945bd..5cbf88c 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- llvm_master/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ macports_master/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -193,7 +193,7 @@ bool AsmPrinter::doInitialization(Module &M) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_39/lib/CodeGen/AsmPrinter/AsmPrinter.cpp macports_release_39/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 272baceeed8..ca69cd99ca1 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_39/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_39/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -196,7 +196,7 @@ bool AsmPrinter::doInitialization(Module &M) {
</span> // anyway.
Triple TT(getTargetTriple());
// If there is a version specified, Major will be non-zero.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -25,5 +26,5 @@ index 4d945bd..5cbf88c 100644
</span> MCVersionMinType VersionType;
if (TT.isWatchOS()) {
--
<span style='display:block; white-space:pre;background:#ffe0e0;'>-2.7.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.9/files/0004-CMake-Use-CMake-s-default-RPATH-for-the-unit-tests.patch b/lang/llvm-3.9/files/0004-CMake-Use-CMake-s-default-RPATH-for-the-unit-tests.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..a37f11c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.9/files/0004-CMake-Use-CMake-s-default-RPATH-for-the-unit-tests.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,44 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 245eb3018094f4c1f645283899d80c2b00e2c2d6 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Diana Picus <diana.picus@linaro.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Wed, 7 Sep 2016 08:37:15 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 4/7] [CMake] Use CMake's default RPATH for the unit tests
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+In the top-level CMakeLists.txt, we set CMAKE_BUILD_WITH_INSTALL_RPATH to ON,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+and then for the unit tests we set it to <test>/../../lib. This works for tests
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+that live in unittest/<whatever>, but not for those that live in subdirectories
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+e.g. unittest/Transforms/IPO or unittest/ExecutionEngine/Orc. When building
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+with BUILD_SHARED_LIBRARIES, such tests don't manage to find their libraries.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Since the tests are run from the build directory, it makes sense to set their
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+RPATH for the build tree, rather than the install tree. This is the default in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+CMake since 2.6, so all we have to do is set CMAKE_BUILD_WITH_INSTALL_RPATH to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+OFF for the unit tests.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280791 91177308-0d34-0410-b5e6-96231b3b80d8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 1317eef21cdf7989d233a6f08322283a217eeb20)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ unittests/CMakeLists.txt | 8 +++-----
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 3 insertions(+), 5 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_39/unittests/CMakeLists.txt macports_release_39/unittests/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 49a9b31b60d..1758d2b2704 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_39/unittests/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_39/unittests/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,11 +1,9 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_custom_target(UnitTests)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set_target_properties(UnitTests PROPERTIES FOLDER "Tests")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-if (APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_INSTALL_RPATH "@executable_path/../../lib")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-else(UNIX)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_INSTALL_RPATH "\$ORIGIN/../../lib${LLVM_LIBDIR_SUFFIX}")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# People tend to run the tests _before_ installing, so we don't want the install
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# rpath here.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ function(add_llvm_unittest test_dirname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_unittest(UnitTests ${test_dirname} ${ARGN})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.9/files/0005-CMake-Fix-rpath-construction-for-out-of-tree-builds.patch b/lang/llvm-3.9/files/0005-CMake-Fix-rpath-construction-for-out-of-tree-builds.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..0b5eb64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.9/files/0005-CMake-Fix-rpath-construction-for-out-of-tree-builds.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,145 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 17b58adf673bc4339bfc910b5d2739ec11e7acdd Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Chris Bieneman <beanz@apple.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Tue, 1 Nov 2016 17:44:58 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 5/7] [CMake] Fix rpath construction for out-of-tree builds
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+MIME-Version: 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Content-Type: text/plain; charset=UTF-8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Content-Transfer-Encoding: 8bit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+This patch was produced in conjunction with Michał Górny. It should resolve the issues that were trying to be solved by D25304.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+This moves rpath handling into `llvm_add_library` and `add_llvm_executable` so that it is available to all projects using AddLLVM whether built in-tree or out-of-tree.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285714 91177308-0d34-0410-b5e6-96231b3b80d8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 3a876bdaec4dd8e43d21e0ce369f17db274431c0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285881 91177308-0d34-0410-b5e6-96231b3b80d8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 8186cc4fdc9cd8baab93701661fee48d9faf1b08)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CMakeLists.txt | 14 --------------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cmake/modules/AddLLVM.cmake | 43 +++++++++++++++++++++++++++++++++++++++++--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ unittests/CMakeLists.txt | 4 ----
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 3 files changed, 41 insertions(+), 20 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_39/CMakeLists.txt macports_release_39/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index b38f45d1268..2255d585df9 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_39/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_39/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -616,20 +616,6 @@ set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-if (APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_INSTALL_NAME_DIR "@rpath")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-else(UNIX)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if(NOT DEFINED CMAKE_INSTALL_RPATH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,origin")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,origin")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- endif(NOT DEFINED CMAKE_INSTALL_RPATH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(APPLE AND DARWIN_LTO_LIBRARY)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(CMAKE_EXE_LINKER_FLAGS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "${CMAKE_EXE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_39/cmake/modules/AddLLVM.cmake macports_release_39/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 26e43960014..3b42ee53050 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_39/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_39/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -407,6 +407,9 @@ function(llvm_add_library name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elseif(ARG_SHARED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_windows_version_resource_file(ALL_FILES ${ALL_FILES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_library(${name} SHARED ${ALL_FILES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ llvm_setup_rpath(${name})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_library(${name} STATIC ${ALL_FILES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -606,7 +609,7 @@ endmacro(add_llvm_loadable_module name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ macro(add_llvm_executable name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cmake_parse_arguments(ARG "DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO" "" "" ${ARGN})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cmake_parse_arguments(ARG "DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO;NO_INSTALL_RPATH" "" "" ${ARGN})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ llvm_process_sources( ALL_FILES ${ARG_UNPARSED_ARGUMENTS} )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Generate objlib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -636,6 +639,10 @@ macro(add_llvm_executable name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_executable(${name} ${ALL_FILES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(NOT ARG_NO_INSTALL_RPATH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ llvm_setup_rpath(${name})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(DEFINED windows_resource_file)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set_windows_version_resource_properties(${name} ${windows_resource_file})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -963,7 +970,7 @@ function(add_unittest test_suite test_name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(LLVM_REQUIRES_RTTI OFF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ list(APPEND LLVM_LINK_COMPONENTS Support) # gtest needs it for raw_ostream
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- add_llvm_executable(${test_name} IGNORE_EXTERNALIZE_DEBUGINFO ${ARGN})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ add_llvm_executable(${test_name} IGNORE_EXTERNALIZE_DEBUGINFO NO_INSTALL_RPATH ${ARGN})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set_output_directory(${test_name} BINARY_DIR ${outdir} LIBRARY_DIR ${outdir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # libpthreads overrides some standard library symbols, so main
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1289,3 +1296,35 @@ function(llvm_externalize_debuginfo name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ message(FATAL_ERROR "LLVM_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endfunction()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++function(llvm_setup_rpath name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(LLVM_INSTALL_PREFIX AND NOT (LLVM_INSTALL_PREFIX STREQUAL CMAKE_INSTALL_PREFIX))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(extra_libdir ${LLVM_LIBRARY_DIR})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elseif(LLVM_BUILD_LIBRARY_DIR)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(extra_libdir ${LLVM_LIBRARY_DIR})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(_install_name_dir INSTALL_NAME_DIR "@rpath")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(_install_rpath "@loader_path/../lib" ${extra_libdir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elseif(UNIX)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(NOT DEFINED CMAKE_INSTALL_RPATH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_property(TARGET ${name} APPEND_STRING PROPERTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LINK_FLAGS " -Wl,-z,origin ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT LLVM_LINKER_IS_GOLD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # $ORIGIN is not interpreted at link time by ld.bfd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_property(TARGET ${name} APPEND_STRING PROPERTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LINK_FLAGS " -Wl,-rpath-link,${LLVM_LIBRARY_OUTPUT_INTDIR} ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_target_properties(${name} PROPERTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ BUILD_WITH_INSTALL_RPATH On
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ INSTALL_RPATH "${_install_rpath}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ${_install_name_dir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++endfunction()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_39/unittests/CMakeLists.txt macports_release_39/unittests/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 1758d2b2704..75de7c8f0a2 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_39/unittests/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_39/unittests/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,10 +1,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_custom_target(UnitTests)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set_target_properties(UnitTests PROPERTIES FOLDER "Tests")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# People tend to run the tests _before_ installing, so we don't want the install
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# rpath here.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ function(add_llvm_unittest test_dirname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_unittest(UnitTests ${test_dirname} ${ARGN})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endfunction()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.9/files/0006-CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch b/lang/llvm-3.9/files/0006-CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..f93c42c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.9/files/0006-CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,37 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 3ed98f00a5294193a85f59f6b4a828292f53cab9 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: John Brawn <john.brawn@arm.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Thu, 3 Nov 2016 13:55:04 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 6/7] [CMake] Make CMAKE_INSTALL_RPATH work again
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+r285714 made it so that when CMAKE_INSTALL_RPATH is set _install_rpath is not
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set, but that means INSTALL_RPATH gets set to an empty string which isn't what
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+we want. Fix this by setting INSTALL_RPATH only when _install_rpath is set.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285908 91177308-0d34-0410-b5e6-96231b3b80d8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit a0e0673b0f73cebabf73e8a7817e871ad54cb24f)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cmake/modules/AddLLVM.cmake | 10 ++++++----
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 6 insertions(+), 4 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_39/cmake/modules/AddLLVM.cmake macports_release_39/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 3b42ee53050..bb614c3a7bc 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_39/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_39/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1323,8 +1323,10 @@ function(llvm_setup_rpath name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_target_properties(${name} PROPERTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- BUILD_WITH_INSTALL_RPATH On
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- INSTALL_RPATH "${_install_rpath}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ${_install_name_dir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(DEFINED _install_rpath)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_target_properties(${name} PROPERTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ BUILD_WITH_INSTALL_RPATH On
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ INSTALL_RPATH "${_install_rpath}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ${_install_name_dir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endfunction()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.9/files/0007-CMake-Fix-llvm_setup_rpath-function.patch b/lang/llvm-3.9/files/0007-CMake-Fix-llvm_setup_rpath-function.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..adc6e8f
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-3.9/files/0007-CMake-Fix-llvm_setup_rpath-function.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,69 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 4f80b27f5ad321f10ddab6c924efb5fdb250232a Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Mandeep Singh Grang <mgrang@codeaurora.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Tue, 8 Nov 2016 00:45:05 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 7/7] [CMake] Fix llvm_setup_rpath function
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Summary:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Set _install_rpath to CMAKE_INSTALL_RPATH if it is defined, so that eventually
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+INSTALL_RPATH is set to CMAKE_INSTALL_RPATH.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+The "if(NOT DEFINED CMAKE_INSTALL_RPATH)" was missing a corresponding else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+clause.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+This also cleans up the fix made in r285908.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Patch by Azharuddin Mohammed
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Reviewers: john.brawn, sgundapa, beanz
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subscribers: chapuni, mgorny, llvm-commits
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Differential Revision: https://reviews.llvm.org/D26289
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286184 91177308-0d34-0410-b5e6-96231b3b80d8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit e7ffbb5a0ee6a7f07c507dc757cffc9bb57532e3)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cmake/modules/AddLLVM.cmake | 22 ++++++++++++----------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 12 insertions(+), 10 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_39/cmake/modules/AddLLVM.cmake macports_release_39/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index bb614c3a7bc..12e8b60bafd 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_39/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_39/cmake/modules/AddLLVM.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1298,6 +1298,10 @@ function(llvm_externalize_debuginfo name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endfunction()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ function(llvm_setup_rpath name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(CMAKE_INSTALL_RPATH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(LLVM_INSTALL_PREFIX AND NOT (LLVM_INSTALL_PREFIX STREQUAL CMAKE_INSTALL_PREFIX))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(extra_libdir ${LLVM_LIBRARY_DIR})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elseif(LLVM_BUILD_LIBRARY_DIR)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1308,16 +1312,14 @@ function(llvm_setup_rpath name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(_install_name_dir INSTALL_NAME_DIR "@rpath")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(_install_rpath "@loader_path/../lib" ${extra_libdir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elseif(UNIX)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if(NOT DEFINED CMAKE_INSTALL_RPATH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_property(TARGET ${name} APPEND_STRING PROPERTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- LINK_FLAGS " -Wl,-z,origin ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT LLVM_LINKER_IS_GOLD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # $ORIGIN is not interpreted at link time by ld.bfd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_property(TARGET ${name} APPEND_STRING PROPERTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- LINK_FLAGS " -Wl,-rpath-link,${LLVM_LIBRARY_OUTPUT_INTDIR} ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_property(TARGET ${name} APPEND_STRING PROPERTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LINK_FLAGS " -Wl,-z,origin ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT LLVM_LINKER_IS_GOLD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # $ORIGIN is not interpreted at link time by ld.bfd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_property(TARGET ${name} APPEND_STRING PROPERTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LINK_FLAGS " -Wl,-rpath-link,${LLVM_LIBRARY_OUTPUT_INTDIR} ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.11.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span></pre><pre style='margin:0'>
</pre>