[141848] trunk/dports/lang/llvm-3.7

jeremyhu at macports.org jeremyhu at macports.org
Sat Dec 12 03:15:55 PST 2015


Revision: 141848
          https://trac.macports.org/changeset/141848
Author:   jeremyhu at macports.org
Date:     2015-10-29 11:46:37 -0700 (Thu, 29 Oct 2015)
Log Message:
-----------
clang-3.7: Minor ASan cleanup

Modified Paths:
--------------
    trunk/dports/lang/llvm-3.7/Portfile
    trunk/dports/lang/llvm-3.7/files/2001-MacPorts-Only-Comment-out-SL-cctools-workaround.patch
    trunk/dports/lang/llvm-3.7/files/2002-Update-CheckArches-to-fallback-on-Intel-ppc-if-ld-v-.patch
    trunk/dports/lang/llvm-3.7/files/2003-Fall-back-on-xcodebuild-sdk-when-xcrun-sdk-is-not-su.patch
    trunk/dports/lang/llvm-3.7/files/2004-On-darwin-build-ppc-slices-of-the-compiler-runtime-i.patch
    trunk/dports/lang/llvm-3.7/files/2005-MacPorts-Only-Don-t-build-x86_64h-slice-of-compiler-.patch
    trunk/dports/lang/llvm-3.7/files/2006-Set-abort_on_error-to-true-by-default.patch

Added Paths:
-----------
    trunk/dports/lang/llvm-3.7/files/2007-cherry-pick-RemoveANSIEscapeSequencesFromString-from.patch
    trunk/dports/lang/llvm-3.7/files/2008-Save-the-ASan-report-in-the-OS-X-crash-log.patch

Removed Paths:
-------------
    trunk/dports/lang/llvm-3.7/files/2007-Save-the-ASan-report-in-the-OS-X-crash-log.patch

Modified: trunk/dports/lang/llvm-3.7/Portfile
===================================================================
--- trunk/dports/lang/llvm-3.7/Portfile	2015-10-29 18:22:20 UTC (rev 141847)
+++ trunk/dports/lang/llvm-3.7/Portfile	2015-10-29 18:46:37 UTC (rev 141848)
@@ -8,7 +8,7 @@
 set llvm_version        3.7
 set llvm_version_no_dot 37
 name                    llvm-${llvm_version}
-subport                 clang-${llvm_version} { revision 1 }
+subport                 clang-${llvm_version} { revision 2 }
 set suffix              mp-${llvm_version}
 set sub_prefix          ${prefix}/libexec/llvm-${llvm_version}
 dist_subdir             llvm
@@ -139,7 +139,8 @@
         2004-On-darwin-build-ppc-slices-of-the-compiler-runtime-i.patch \
         2005-MacPorts-Only-Don-t-build-x86_64h-slice-of-compiler-.patch \
         2006-Set-abort_on_error-to-true-by-default.patch \
-        2007-Save-the-ASan-report-in-the-OS-X-crash-log.patch \
+        2007-cherry-pick-RemoveANSIEscapeSequencesFromString-from.patch \
+        2008-Save-the-ASan-report-in-the-OS-X-crash-log.patch \
         3001-buildit-build-fix-for-Leopard.patch \
         3002-buildit-Set-compatibility-version-to-RC_ProjectSourc.patch \
         3003-Fix-local-and-iterator-when-building-with-Lion-and-n.patch \

Modified: trunk/dports/lang/llvm-3.7/files/2001-MacPorts-Only-Comment-out-SL-cctools-workaround.patch
===================================================================
--- trunk/dports/lang/llvm-3.7/files/2001-MacPorts-Only-Comment-out-SL-cctools-workaround.patch	2015-10-29 18:22:20 UTC (rev 141847)
+++ trunk/dports/lang/llvm-3.7/files/2001-MacPorts-Only-Comment-out-SL-cctools-workaround.patch	2015-10-29 18:46:37 UTC (rev 141848)
@@ -1,7 +1,7 @@
 From e2677a51632b1d9e4e100f6e39f320f29811544e Mon Sep 17 00:00:00 2001
 From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
 Date: Mon, 15 Apr 2013 22:38:18 -0700
-Subject: [PATCH 2001/2007] MacPorts Only: Comment out SL cctools workaround
+Subject: [PATCH 2001/2008] MacPorts Only: Comment out SL cctools workaround
 
 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
 ---

Modified: trunk/dports/lang/llvm-3.7/files/2002-Update-CheckArches-to-fallback-on-Intel-ppc-if-ld-v-.patch
===================================================================
--- trunk/dports/lang/llvm-3.7/files/2002-Update-CheckArches-to-fallback-on-Intel-ppc-if-ld-v-.patch	2015-10-29 18:22:20 UTC (rev 141847)
+++ trunk/dports/lang/llvm-3.7/files/2002-Update-CheckArches-to-fallback-on-Intel-ppc-if-ld-v-.patch	2015-10-29 18:46:37 UTC (rev 141848)
@@ -1,7 +1,7 @@
 From e9dbcc3e88810caf3e303e3f1b106574bb68b8d3 Mon Sep 17 00:00:00 2001
 From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
 Date: Sat, 10 Jan 2015 03:34:51 -0800
-Subject: [PATCH 2002/2007] Update CheckArches to fallback on Intel/ppc if ld
+Subject: [PATCH 2002/2008] Update CheckArches to fallback on Intel/ppc if ld
  -v doesn't report supported architectures
 
 Older versions of ld64 (eg: Xcode 3.x) do not report this.

Modified: trunk/dports/lang/llvm-3.7/files/2003-Fall-back-on-xcodebuild-sdk-when-xcrun-sdk-is-not-su.patch
===================================================================
--- trunk/dports/lang/llvm-3.7/files/2003-Fall-back-on-xcodebuild-sdk-when-xcrun-sdk-is-not-su.patch	2015-10-29 18:22:20 UTC (rev 141847)
+++ trunk/dports/lang/llvm-3.7/files/2003-Fall-back-on-xcodebuild-sdk-when-xcrun-sdk-is-not-su.patch	2015-10-29 18:46:37 UTC (rev 141848)
@@ -1,7 +1,7 @@
 From cd109000abbab497df2ee32a2a33035713009175 Mon Sep 17 00:00:00 2001
 From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
 Date: Sat, 17 Jan 2015 17:45:27 -0800
-Subject: [PATCH 2003/2007] Fall back on xcodebuild -sdk when xcrun --sdk is
+Subject: [PATCH 2003/2008] Fall back on xcodebuild -sdk when xcrun --sdk is
  not supported
 
 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

Modified: trunk/dports/lang/llvm-3.7/files/2004-On-darwin-build-ppc-slices-of-the-compiler-runtime-i.patch
===================================================================
--- trunk/dports/lang/llvm-3.7/files/2004-On-darwin-build-ppc-slices-of-the-compiler-runtime-i.patch	2015-10-29 18:22:20 UTC (rev 141847)
+++ trunk/dports/lang/llvm-3.7/files/2004-On-darwin-build-ppc-slices-of-the-compiler-runtime-i.patch	2015-10-29 18:46:37 UTC (rev 141848)
@@ -1,7 +1,7 @@
 From ad7e458c5ee6caf2f08658aa06414516cc5551b9 Mon Sep 17 00:00:00 2001
 From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
 Date: Sat, 17 Jan 2015 19:55:19 -0800
-Subject: [PATCH 2004/2007] On darwin, build ppc slices of the compiler runtime
+Subject: [PATCH 2004/2008] On darwin, build ppc slices of the compiler runtime
  if requested and supported by the SDK and toolchain
 
 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

Modified: trunk/dports/lang/llvm-3.7/files/2005-MacPorts-Only-Don-t-build-x86_64h-slice-of-compiler-.patch
===================================================================
--- trunk/dports/lang/llvm-3.7/files/2005-MacPorts-Only-Don-t-build-x86_64h-slice-of-compiler-.patch	2015-10-29 18:22:20 UTC (rev 141847)
+++ trunk/dports/lang/llvm-3.7/files/2005-MacPorts-Only-Don-t-build-x86_64h-slice-of-compiler-.patch	2015-10-29 18:46:37 UTC (rev 141848)
@@ -1,7 +1,7 @@
 From ed862ddb8c6511608592b4dc0a13f330385df233 Mon Sep 17 00:00:00 2001
 From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
 Date: Wed, 14 Jan 2015 19:55:19 -0800
-Subject: [PATCH 2005/2007] MacPorts Only: Don't build x86_64h slice of
+Subject: [PATCH 2005/2008] MacPorts Only: Don't build x86_64h slice of
  compiler-rt
 
 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

Modified: trunk/dports/lang/llvm-3.7/files/2006-Set-abort_on_error-to-true-by-default.patch
===================================================================
--- trunk/dports/lang/llvm-3.7/files/2006-Set-abort_on_error-to-true-by-default.patch	2015-10-29 18:22:20 UTC (rev 141847)
+++ trunk/dports/lang/llvm-3.7/files/2006-Set-abort_on_error-to-true-by-default.patch	2015-10-29 18:46:37 UTC (rev 141848)
@@ -1,7 +1,7 @@
 From 8046167ff764e7a500a406a970927bc24b688629 Mon Sep 17 00:00:00 2001
 From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
 Date: Sun, 25 Oct 2015 16:47:47 -0700
-Subject: [PATCH 2006/2007] Set abort_on_error to true by default
+Subject: [PATCH 2006/2008] Set abort_on_error to true by default
 
 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
 ---

Deleted: trunk/dports/lang/llvm-3.7/files/2007-Save-the-ASan-report-in-the-OS-X-crash-log.patch
===================================================================
--- trunk/dports/lang/llvm-3.7/files/2007-Save-the-ASan-report-in-the-OS-X-crash-log.patch	2015-10-29 18:22:20 UTC (rev 141847)
+++ trunk/dports/lang/llvm-3.7/files/2007-Save-the-ASan-report-in-the-OS-X-crash-log.patch	2015-10-29 18:46:37 UTC (rev 141848)
@@ -1,66 +0,0 @@
-From b82505f69186c22d06ea81ac59b2fe5608f8c02c Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
-Date: Sun, 25 Oct 2015 16:03:00 -0700
-Subject: [PATCH 2007/2007] Save the ASan report in the OS X crash log
-
-Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
-(cherry picked from commit c00bd67ad0f1dd933d8f962b9e4be1de1446465c)
----
- lib/asan/asan_report.cc | 27 +++++++++++++++++++++++++++
- 1 file changed, 27 insertions(+)
-
-diff --git llvm_release_37/projects/compiler-rt/lib/asan/asan_report.cc macports_release_37/projects/compiler-rt/lib/asan/asan_report.cc
-index c1681e6..b736df4 100644
---- llvm_release_37/projects/compiler-rt/lib/asan/asan_report.cc
-+++ macports_release_37/projects/compiler-rt/lib/asan/asan_report.cc
-@@ -23,6 +23,18 @@
- #include "sanitizer_common/sanitizer_stackdepot.h"
- #include "sanitizer_common/sanitizer_symbolizer.h"
- 
-+// Apple CrashReporter support.
-+#ifdef __APPLE__
-+extern "C" {
-+static char __crashreporter_info_buff__[1 << 16] = { 0 };
-+static const char *__crashreporter_info__ __attribute__((__used__)) = &__crashreporter_info_buff__[0];
-+asm (".desc ___crashreporter_info__, 0x10");
-+
-+#include <string.h>
-+#define CRSetCrashLogMessage(msg) strlcpy(__crashreporter_info_buff__, msg, sizeof(__crashreporter_info_buff__));
-+}
-+#endif
-+
- namespace __asan {
- 
- // -------------------- User-specified callbacks ----------------- {{{1
-@@ -45,6 +57,16 @@ static bool report_happened = false;
- static ReportData report_data = {};
- 
- void AppendToErrorMessageBuffer(const char *buffer) {
-+#if __APPLE__
-+  // For the Apple CrashReporter support: Always store reports into buffer.
-+  if (!error_message_buffer) {
-+    error_message_buffer_size = 1 << 16;
-+    error_message_buffer =
-+        (char*)MmapOrDie(error_message_buffer_size, __func__);
-+    error_message_buffer_pos = 0;
-+  }
-+#endif
-+
-   if (error_message_buffer) {
-     uptr length = internal_strlen(buffer);
-     CHECK_GE(error_message_buffer_size, error_message_buffer_pos);
-@@ -663,6 +685,11 @@ class ScopedInErrorReport {
-     // Print memory stats.
-     if (flags()->print_stats)
-       __asan_print_accumulated_stats();
-+
-+#ifdef __APPLE__
-+    CRSetCrashLogMessage(error_message_buffer);
-+#endif
-+
-     if (error_report_callback) {
-       error_report_callback(error_message_buffer);
-     }
--- 
-2.6.2
-

Added: trunk/dports/lang/llvm-3.7/files/2007-cherry-pick-RemoveANSIEscapeSequencesFromString-from.patch
===================================================================
--- trunk/dports/lang/llvm-3.7/files/2007-cherry-pick-RemoveANSIEscapeSequencesFromString-from.patch	                        (rev 0)
+++ trunk/dports/lang/llvm-3.7/files/2007-cherry-pick-RemoveANSIEscapeSequencesFromString-from.patch	2015-10-29 18:46:37 UTC (rev 141848)
@@ -0,0 +1,72 @@
+From 40a6da60a1a29ef72a2f89eb42ea9543b295bc81 Mon Sep 17 00:00:00 2001
+From: Anna Zaks <ganna at apple.com>
+Date: Thu, 29 Oct 2015 09:56:12 -0700
+Subject: [PATCH 2007/2008] cherry-pick RemoveANSIEscapeSequencesFromString
+ from master
+
+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+---
+ lib/sanitizer_common/sanitizer_common.cc | 34 ++++++++++++++++++++++++++++++++
+ lib/sanitizer_common/sanitizer_common.h  |  1 +
+ 2 files changed, 35 insertions(+)
+
+diff --git llvm_release_37/projects/compiler-rt/lib/sanitizer_common/sanitizer_common.cc macports_release_37/projects/compiler-rt/lib/sanitizer_common/sanitizer_common.cc
+index d14e988..bbc57e5 100644
+--- llvm_release_37/projects/compiler-rt/lib/sanitizer_common/sanitizer_common.cc
++++ macports_release_37/projects/compiler-rt/lib/sanitizer_common/sanitizer_common.cc
+@@ -255,6 +255,40 @@ void ReportErrorSummary(const char *error_type, const AddressInfo &info) {
+ }
+ #endif
+ 
++// Removes the ANSI escape sequences from the input string (in-place).
++void RemoveANSIEscapeSequencesFromString(char *str) {
++  if (!str)
++    return;
++
++  // We are going to remove the escape sequences in place.
++  char *s = str;
++  char *z = str;
++  while (*s != '\0') {
++    CHECK_GE(s, z);
++    // Skip over ANSI escape sequences with pointer 's'.
++    if (*s == '\033' && *(s + 1) == '[') {
++      s = internal_strchrnul(s, 'm');
++      if (*s == '\0') {
++        break;
++      }
++      s++;
++      continue;
++    }
++    // 's' now points at a character we want to keep. Copy over the buffer
++    // content if the escape sequence has been perviously skipped andadvance
++    // both pointers.
++    if (s != z)
++      *z = *s;
++
++    // If we have not seen an escape sequence, just advance both pointers.
++    z++;
++    s++;
++  }
++
++  // Null terminate the string.
++  *z = '\0';
++}
++
+ void LoadedModule::set(const char *module_name, uptr base_address) {
+   clear();
+   full_name_ = internal_strdup(module_name);
+diff --git llvm_release_37/projects/compiler-rt/lib/sanitizer_common/sanitizer_common.h macports_release_37/projects/compiler-rt/lib/sanitizer_common/sanitizer_common.h
+index 2c5a8db..7e7a6dc 100644
+--- llvm_release_37/projects/compiler-rt/lib/sanitizer_common/sanitizer_common.h
++++ macports_release_37/projects/compiler-rt/lib/sanitizer_common/sanitizer_common.h
+@@ -160,6 +160,7 @@ void SetLowLevelAllocateCallback(LowLevelAllocateCallback callback);
+ // IO
+ void RawWrite(const char *buffer);
+ bool ColorizeReports();
++void RemoveANSIEscapeSequencesFromString(char *buffer);
+ void Printf(const char *format, ...);
+ void Report(const char *format, ...);
+ void SetPrintfAndReportCallback(void (*callback)(const char *));
+-- 
+2.6.2
+

Added: trunk/dports/lang/llvm-3.7/files/2008-Save-the-ASan-report-in-the-OS-X-crash-log.patch
===================================================================
--- trunk/dports/lang/llvm-3.7/files/2008-Save-the-ASan-report-in-the-OS-X-crash-log.patch	                        (rev 0)
+++ trunk/dports/lang/llvm-3.7/files/2008-Save-the-ASan-report-in-the-OS-X-crash-log.patch	2015-10-29 18:46:37 UTC (rev 141848)
@@ -0,0 +1,64 @@
+From dd6e12b5701af38270949fc120223be6b56c1797 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+Date: Sun, 25 Oct 2015 16:03:00 -0700
+Subject: [PATCH 2008/2008] Save the ASan report in the OS X crash log
+
+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+---
+ lib/asan/asan_report.cc | 26 ++++++++++++++++++++++++++
+ 1 file changed, 26 insertions(+)
+
+diff --git llvm_release_37/projects/compiler-rt/lib/asan/asan_report.cc macports_release_37/projects/compiler-rt/lib/asan/asan_report.cc
+index c1681e6..6f859d5 100644
+--- llvm_release_37/projects/compiler-rt/lib/asan/asan_report.cc
++++ macports_release_37/projects/compiler-rt/lib/asan/asan_report.cc
+@@ -23,6 +23,14 @@
+ #include "sanitizer_common/sanitizer_stackdepot.h"
+ #include "sanitizer_common/sanitizer_symbolizer.h"
+ 
++// Apple CrashReporter support.
++#ifdef __APPLE__
++extern "C" {
++static char *__crashreporter_info__ __attribute__((__used__)) = 0;
++asm (".desc ___crashreporter_info__, 0x10");
++}
++#endif
++
+ namespace __asan {
+ 
+ // -------------------- User-specified callbacks ----------------- {{{1
+@@ -45,6 +53,16 @@ static bool report_happened = false;
+ static ReportData report_data = {};
+ 
+ void AppendToErrorMessageBuffer(const char *buffer) {
++#if __APPLE__
++  // For the Apple CrashReporter support: Always store reports into buffer.
++  if (!error_message_buffer) {
++    error_message_buffer_size = 1 << 16;
++    error_message_buffer =
++        (char*)MmapOrDie(error_message_buffer_size, __func__);
++    error_message_buffer_pos = 0;
++  }
++#endif
++
+   if (error_message_buffer) {
+     uptr length = internal_strlen(buffer);
+     CHECK_GE(error_message_buffer_size, error_message_buffer_pos);
+@@ -663,6 +681,14 @@ class ScopedInErrorReport {
+     // Print memory stats.
+     if (flags()->print_stats)
+       __asan_print_accumulated_stats();
++
++#ifdef __APPLE__
++    if (flags()->abort_on_error) {
++      __crashreporter_info__ = internal_strdup(error_message_buffer);
++      RemoveANSIEscapeSequencesFromString(__crashreporter_info__);
++    }
++#endif
++
+     if (error_report_callback) {
+       error_report_callback(error_message_buffer);
+     }
+-- 
+2.6.2
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151212/722584c4/attachment.html>


More information about the macports-changes mailing list