<pre style='margin:0'>
Andrea D'Amore (anddam) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/b9031fa3d215bab2f29095337d4f351508eab50f">https://github.com/macports/macports-ports/commit/b9031fa3d215bab2f29095337d4f351508eab50f</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit b9031fa3d215bab2f29095337d4f351508eab50f
</span>Author: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
AuthorDate: Tue Dec 20 12:57:36 2016 -0800
<span style='display:block; white-space:pre;color:#404040;'> llvm-{3.9,devel}: Provide implementation of strnlen for pre-Lion
</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/51520
</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.9/Portfile | 15 ++--
...h-O-CPU-Subtype-to-ppc7400-when-targeting.patch | 2 +-
...MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch | 2 +-
...ly-Don-t-embed-the-deployment-target-in-t.patch | 2 +-
...-CMake-s-default-RPATH-for-the-unit-tests.patch | 2 +-
...rpath-construction-for-out-of-tree-builds.patch | 2 +-
...CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch | 2 +-
.../0007-CMake-Fix-llvm_setup_rpath-function.patch | 2 +-
...ssues-pre-Lion-due-to-missing-a-strnlen-d.patch | 97 ++++++++++++++++++++++
lang/llvm-devel/Portfile | 7 +-
...h-O-CPU-Subtype-to-ppc7400-when-targeting.patch | 8 +-
...MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch | 8 +-
...ly-Don-t-embed-the-deployment-target-in-t.patch | 10 +--
...ssues-pre-Lion-due-to-missing-a-strnlen-d.patch | 96 +++++++++++++++++++++
14 files changed, 225 insertions(+), 30 deletions(-)
<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 48861b1..f493ffd 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;'>@@ -114,13 +114,14 @@ checksums llvm-3.9.0.src.tar.xz \
</span>
patch.pre_args -p1
patchfiles \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- 0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch \
</span><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:#ffe0e0;'>- 0004-CMake-Use-CMake-s-default-RPATH-for-the-unit-tests.patch \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 0005-CMake-Fix-rpath-construction-for-out-of-tree-builds.patch \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 0006-CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 0007-CMake-Fix-llvm_setup_rpath-function.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.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><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0008-Fix-build-issues-pre-Lion-due-to-missing-a-strnlen-d.patch
</span>
if {${subport} eq "clang-${llvm_version}"} {
patchfiles-append \
<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 712066d..f834b19 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,7 +1,7 @@
</span> From 92d88eee4f3aa03e5a88b558c58769f87cca1c1e Mon Sep 17 00:00:00 2001
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 1/8] 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;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 73d8919..7b53f70 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,7 +1,7 @@
</span> From 48faf64faafddad1d6126041596311ae5da6dcf9 Mon Sep 17 00:00:00 2001
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:#e0ffe0;'>+Subject: [PATCH 2/8] 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
<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 47d7f96..a1348b7 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,7 +1,7 @@
</span> From 412343efb52b4b702d8b8641914dc932efaa5cb0 Mon Sep 17 00:00:00 2001
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/7] MacPorts Only: Don't embed the deployment target in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 3/8] 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;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><span style='display:block; white-space:pre;color:#808080;'>index a37f11c..a6e1299 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/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:#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;'>@@ -1,7 +1,7 @@
</span> From 245eb3018094f4c1f645283899d80c2b00e2c2d6 Mon Sep 17 00:00:00 2001
From: Diana Picus <diana.picus@linaro.org>
Date: Wed, 7 Sep 2016 08:37:15 +0000
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 4/7] [CMake] Use CMake's default RPATH for the unit tests
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 4/8] [CMake] Use CMake's default RPATH for the unit tests
</span>
In the top-level CMakeLists.txt, we set CMAKE_BUILD_WITH_INSTALL_RPATH to ON,
and then for the unit tests we set it to <test>/../../lib. This works for tests
<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><span style='display:block; white-space:pre;color:#808080;'>index 0b5eb64..a77cd22 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/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:#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;'>@@ -1,7 +1,7 @@
</span> From 17b58adf673bc4339bfc910b5d2739ec11e7acdd Mon Sep 17 00:00:00 2001
From: Chris Bieneman <beanz@apple.com>
Date: Tue, 1 Nov 2016 17:44:58 +0000
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 5/7] [CMake] Fix rpath construction for out-of-tree builds
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 5/8] [CMake] Fix rpath construction for out-of-tree builds
</span> MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
<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><span style='display:block; white-space:pre;color:#808080;'>index f93c42c..29d8a88 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.9/files/0006-CMake-Make-CMAKE_INSTALL_RPATH-work-again.patch
</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;'>@@ -1,7 +1,7 @@
</span> From 3ed98f00a5294193a85f59f6b4a828292f53cab9 Mon Sep 17 00:00:00 2001
From: John Brawn <john.brawn@arm.com>
Date: Thu, 3 Nov 2016 13:55:04 +0000
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 6/7] [CMake] Make CMAKE_INSTALL_RPATH work again
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 6/8] [CMake] Make CMAKE_INSTALL_RPATH work again
</span>
r285714 made it so that when CMAKE_INSTALL_RPATH is set _install_rpath is not
set, but that means INSTALL_RPATH gets set to an empty string which isn't what
<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><span style='display:block; white-space:pre;color:#808080;'>index adc6e8f..672561c 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-3.9/files/0007-CMake-Fix-llvm_setup_rpath-function.patch
</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;'>@@ -1,7 +1,7 @@
</span> From 4f80b27f5ad321f10ddab6c924efb5fdb250232a Mon Sep 17 00:00:00 2001
From: Mandeep Singh Grang <mgrang@codeaurora.org>
Date: Tue, 8 Nov 2016 00:45:05 +0000
<span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH 7/7] [CMake] Fix llvm_setup_rpath function
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 7/8] [CMake] Fix llvm_setup_rpath function
</span>
Summary:
Set _install_rpath to CMAKE_INSTALL_RPATH if it is defined, so that eventually
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-3.9/files/0008-Fix-build-issues-pre-Lion-due-to-missing-a-strnlen-d.patch b/lang/llvm-3.9/files/0008-Fix-build-issues-pre-Lion-due-to-missing-a-strnlen-d.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..f67ba2f
</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/0008-Fix-build-issues-pre-Lion-due-to-missing-a-strnlen-d.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,97 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From f0c525c4cc42066ffcdf5c182d0335ccf7b0b4f9 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Tue, 20 Dec 2016 12:41:21 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 8/8] Fix build issues pre-Lion due to missing a strnlen
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ definition
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://trac.macports.org/ticket/51520
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://llvm.org/bugs/show_bug.cgi?id=27714
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(cherry picked from commit 72752ce2c259fdbc1a7d6a6e098e6a215233b823)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lib/ObjectYAML/MachOYAML.cpp | 14 ++++++++++++++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tools/llvm-pdbdump/LLVMOutputStyle.cpp | 14 ++++++++++++++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tools/obj2yaml/macho2yaml.cpp | 16 +++++++++++++++-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 3 files changed, 43 insertions(+), 1 deletion(-)
</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/lib/ObjectYAML/MachOYAML.cpp macports_release_39/lib/ObjectYAML/MachOYAML.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index d819e80836c..4b88a5032bb 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_39/lib/ObjectYAML/MachOYAML.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_39/lib/ObjectYAML/MachOYAML.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -18,6 +18,20 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <string.h> // For memcpy, memset and strnlen.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <Availability.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static size_t strnlen(const char *s, size_t maxlen) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size_t l = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (l < maxlen && *s) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ l++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return l;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</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;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ namespace llvm {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MachOYAML::LoadCommand::~LoadCommand() {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_39/tools/llvm-pdbdump/LLVMOutputStyle.cpp macports_release_39/tools/llvm-pdbdump/LLVMOutputStyle.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 6d94295d126..0b558115497 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_39/tools/llvm-pdbdump/LLVMOutputStyle.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_39/tools/llvm-pdbdump/LLVMOutputStyle.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -29,6 +29,20 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <unordered_map>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <Availability.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static size_t strnlen(const char *s, size_t maxlen) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size_t l = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (l < maxlen && *s) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ l++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return l;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</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;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ using namespace llvm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ using namespace llvm::codeview;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ using namespace llvm::pdb;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_release_39/tools/obj2yaml/macho2yaml.cpp macports_release_39/tools/obj2yaml/macho2yaml.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index c9a1385f173..22029f21588 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_release_39/tools/obj2yaml/macho2yaml.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_release_39/tools/obj2yaml/macho2yaml.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -14,7 +14,21 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "llvm/Support/ErrorHandling.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "llvm/Support/LEB128.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <string.h> // for memcpy
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <string.h> // for memcpy abd strnlen
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <Availability.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static size_t strnlen(const char *s, size_t maxlen) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size_t l = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (l < maxlen && *s) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ l++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return l;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</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;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ using namespace llvm;
</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;'>+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-devel/Portfile b/lang/llvm-devel/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 2cb283c..e7c31db 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-devel/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-devel/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -114,9 +114,10 @@ if {${distfiles} ne ""} {
</span>
patch.pre_args -p1
patchfiles \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- 0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch \
</span><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;'>+ 0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.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-Fix-build-issues-pre-Lion-due-to-missing-a-strnlen-d.patch
</span>
if {${subport} eq "clang-${llvm_version}"} {
patchfiles-append \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-devel/files/0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch b/lang/llvm-devel/files/0001-Set-the-Mach-O-CPU-Subtype-to-ppc7400-when-targeting.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index 69949fa..2ac6966 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-devel/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-devel/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 f2bd8ed3aaa9cd272e21a739705fee6afffba4b0 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From a0c10070b02b587bc667059b2418d1561000d3cd 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/3] Set the Mach-O CPU Subtype to ppc7400 when targeting
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 1/4] 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_master/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp macports_master/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 5847b3a..8ada854 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 5847b3a52bf..8ada8541744 100644
</span> --- llvm_master/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
+++ macports_master/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 5847b3a..8ada854 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.10.1
</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-devel/files/0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch b/lang/llvm-devel/files/0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index 5ae2afa..14befa3 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-devel/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-devel/files/0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.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 58e0ca509dce8b37570b5e15243320fc07a5d6fa Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From b8098da2d225e031a92e8bd9d85261415aed5f93 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/3] Define EXC_MASK_CRASH and MACH_EXCEPTION_CODES if they're
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 2/4] 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
<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_master/lib/Support/Unix/Signals.inc macports_master/lib/Support/Unix/Signals.inc
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 9752b70..52607ca 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 3750d7f4c09..7b163161988 100644
</span> --- llvm_master/lib/Support/Unix/Signals.inc
+++ macports_master/lib/Support/Unix/Signals.inc
@@ -476,6 +476,15 @@ void llvm::sys::PrintStackTraceOnErrorSignal(StringRef Argv0,
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -32,5 +32,5 @@ index 9752b70..52607ca 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.10.1
</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-devel/files/0003-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch b/lang/llvm-devel/files/0003-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index 9aad748..f658643 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-devel/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-devel/files/0003-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 374ad0a4b557d2255183fc19883856261ee80a96 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 62bfda50e50245543b00ad7f8ccd80fb95b1d217 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/3] MacPorts Only: Don't embed the deployment target in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 3/4] 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,10 +12,10 @@ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
</span> 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git llvm_master/lib/CodeGen/AsmPrinter/AsmPrinter.cpp macports_master/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index da5fca8..dd725ba 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 7adac4cbf94..fb47d6079a4 100644
</span> --- llvm_master/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ macports_master/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -188,7 +188,7 @@ bool AsmPrinter::doInitialization(Module &M) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -193,7 +193,7 @@ bool AsmPrinter::doInitialization(Module &M) {
</span> // anyway.
const Triple &TT = TM.getTargetTriple();
// If there is a version specified, Major will be non-zero.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -25,5 +25,5 @@ index da5fca8..dd725ba 100644
</span> MCVersionMinType VersionType;
if (TT.isWatchOS()) {
--
<span style='display:block; white-space:pre;background:#ffe0e0;'>-2.10.1
</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-devel/files/0004-Fix-build-issues-pre-Lion-due-to-missing-a-strnlen-d.patch b/lang/llvm-devel/files/0004-Fix-build-issues-pre-Lion-due-to-missing-a-strnlen-d.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..939326d
</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-devel/files/0004-Fix-build-issues-pre-Lion-due-to-missing-a-strnlen-d.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,96 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From adc969d25c40b21c469bad38d6ac3460b0ebd885 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Tue, 20 Dec 2016 12:41:21 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 4/4] Fix build issues pre-Lion due to missing a strnlen
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ definition
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://trac.macports.org/ticket/51520
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://llvm.org/bugs/show_bug.cgi?id=27714
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lib/ObjectYAML/MachOYAML.cpp | 11 +++++++++++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tools/llvm-pdbdump/LLVMOutputStyle.cpp | 11 +++++++++++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tools/obj2yaml/macho2yaml.cpp | 13 ++++++++++++-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 3 files changed, 34 insertions(+), 1 deletion(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git llvm_master/lib/ObjectYAML/MachOYAML.cpp macports_master/lib/ObjectYAML/MachOYAML.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 7ebb1bed088..a9f37a3a442 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- llvm_master/lib/ObjectYAML/MachOYAML.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ macports_master/lib/ObjectYAML/MachOYAML.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -18,6 +18,20 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <string.h> // For memcpy, memset and strnlen.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <Availability.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static size_t strnlen(const char *s, size_t maxlen) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size_t l = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (l < maxlen && *s) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ l++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return l;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</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;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ namespace llvm {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MachOYAML::LoadCommand::~LoadCommand() {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/tools/llvm-pdbdump/LLVMOutputStyle.cpp b/tools/llvm-pdbdump/LLVMOutputStyle.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 98c67ec9ef3..90f9129d5f1 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/tools/llvm-pdbdump/LLVMOutputStyle.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/tools/llvm-pdbdump/LLVMOutputStyle.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -31,6 +31,20 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <unordered_map>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <Availability.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static size_t strnlen(const char *s, size_t maxlen) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size_t l = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (l < maxlen && *s) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ l++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return l;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</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;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ using namespace llvm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ using namespace llvm::codeview;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ using namespace llvm::msf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/tools/obj2yaml/macho2yaml.cpp b/tools/obj2yaml/macho2yaml.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 9cd05463edc..02678123d76 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/tools/obj2yaml/macho2yaml.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/tools/obj2yaml/macho2yaml.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -15,7 +15,21 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "llvm/Support/ErrorHandling.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "llvm/Support/LEB128.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <string.h> // for memcpy
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <string.h> // for memcpy abd strnlen
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <Availability.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static size_t strnlen(const char *s, size_t maxlen) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size_t l = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (l < maxlen && *s) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ l++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return l;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</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;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ using namespace llvm;
</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;'>+2.11.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span></pre><pre style='margin:0'>
</pre>