[119154] trunk/dports/lang/llvm-3.3

jeremyhu at macports.org jeremyhu at macports.org
Fri Apr 18 01:49:01 PDT 2014


Revision: 119154
          https://trac.macports.org/changeset/119154
Author:   jeremyhu at macports.org
Date:     2014-04-18 01:49:01 -0700 (Fri, 18 Apr 2014)
Log Message:
-----------
clang-3.3: Fix -export_dynamic link issue and disable ubsan_osx on Leopard (#43353)

Modified Paths:
--------------
    trunk/dports/lang/llvm-3.3/Portfile
    trunk/dports/lang/llvm-3.3/files/leopard-no-asan.patch

Added Paths:
-----------
    trunk/dports/lang/llvm-3.3/files/export_dynamic.patch

Modified: trunk/dports/lang/llvm-3.3/Portfile
===================================================================
--- trunk/dports/lang/llvm-3.3/Portfile	2014-04-18 08:36:35 UTC (rev 119153)
+++ trunk/dports/lang/llvm-3.3/Portfile	2014-04-18 08:49:01 UTC (rev 119154)
@@ -6,7 +6,7 @@
 set llvm_version        3.3
 revision                1
 name                    llvm-${llvm_version}
-subport                 clang-${llvm_version} { revision 2 }
+subport                 clang-${llvm_version} { revision 3 }
 set suffix              mp-${llvm_version}
 set sub_prefix          ${prefix}/libexec/llvm-${llvm_version}
 dist_subdir             llvm
@@ -95,7 +95,8 @@
     patchfiles-append    tiger-shlib-clang.patch tiger-libclang.patch scan-build-PR-35006.patch \
                          0001-Comment-out-SL-cctools-workaround.patch \
                          mavericks-libc++.patch \
-                         snowleopard-cmath.patch
+                         snowleopard-cmath.patch \
+                         export_dynamic.patch
 
     build.target        clang-only
     destroot.target     install-clang

Added: trunk/dports/lang/llvm-3.3/files/export_dynamic.patch
===================================================================
--- trunk/dports/lang/llvm-3.3/files/export_dynamic.patch	                        (rev 0)
+++ trunk/dports/lang/llvm-3.3/files/export_dynamic.patch	2014-04-18 08:49:01 UTC (rev 119154)
@@ -0,0 +1,56 @@
+commit bd77c59acc58e797756b0fcc6739319587e95d85
+Author: Bob Wilson <bob.wilson at apple.com>
+Date:   Fri Aug 2 22:25:34 2013 +0000
+
+    Only use the Darwin linker's -export_dynamic option with supported versions.
+    
+    Related to <rdar://problem/14578094>.
+    
+    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187680 91177308-0d34-0410-b5e6-96231b3b80d8
+
+diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
+index 33e2803..dfaffaa 100644
+--- a/tools/clang/lib/Driver/Tools.cpp
++++ b/tools/clang/lib/Driver/Tools.cpp
+@@ -4517,6 +4517,9 @@ void darwin::Link::AddLinkArgs(Compilation &C,
+       CmdArgs.push_back("-demangle");
+   }
+ 
++  if (Args.hasArg(options::OPT_rdynamic) && Version[0] >= 137)
++    CmdArgs.push_back("-export_dynamic");
++
+   // If we are using LTO, then automatically create a temporary file path for
+   // the linker to use, so that it's lifetime will extend past a possible
+   // dsymutil step.
+@@ -4724,9 +4727,6 @@ void darwin::Link::ConstructJob(Compilation &C, const JobAction &JA,
+   if (Args.hasArg(options::OPT_ObjC) || Args.hasArg(options::OPT_ObjCXX))
+     CmdArgs.push_back("-ObjC");
+ 
+-  if (Args.hasArg(options::OPT_rdynamic))
+-    CmdArgs.push_back("-export_dynamic");
+-
+   CmdArgs.push_back("-o");
+   CmdArgs.push_back(Output.getFilename());
+ 
+diff --git a/test/Driver/darwin-ld.c b/test/Driver/darwin-ld.c
+index cd511e0..d6c5170 100644
+--- a/tools/clang/test/Driver/darwin-ld.c
++++ b/tools/clang/test/Driver/darwin-ld.c
+@@ -130,3 +130,17 @@
+ // RUN: FileCheck -check-prefix=LINK_PG %s < %t.log
+ // LINK_PG: -lgcrt1.o
+ // LINK_PG: -no_new_main
++
++// RUN: %clang -target x86_64-apple-darwin12 -rdynamic -### %t.o \
++// RUN:   -mlinker-version=100 2> %t.log
++// RUN: FileCheck -check-prefix=LINK_NO_EXPORT_DYNAMIC %s < %t.log
++// LINK_NO_EXPORT_DYNAMIC: {{ld(.exe)?"}}
++// LINK_NO_EXPORT_DYNAMIC-NOT: "-export_dynamic"
++
++// RUN: %clang -target x86_64-apple-darwin12 -rdynamic -### %t.o \
++// RUN:   -mlinker-version=137 2> %t.log
++// RUN: FileCheck -check-prefix=LINK_EXPORT_DYNAMIC %s < %t.log
++// LINK_EXPORT_DYNAMIC: {{ld(.exe)?"}}
++// LINK_EXPORT_DYNAMIC: "-export_dynamic"
++
++

Modified: trunk/dports/lang/llvm-3.3/files/leopard-no-asan.patch
===================================================================
--- trunk/dports/lang/llvm-3.3/files/leopard-no-asan.patch	2014-04-18 08:36:35 UTC (rev 119153)
+++ trunk/dports/lang/llvm-3.3/files/leopard-no-asan.patch	2014-04-18 08:49:01 UTC (rev 119154)
@@ -17,18 +17,23 @@
 -Configs += asan_osx_dynamic
 -UniversalArchs.asan_osx_dynamic := $(call CheckArches,i386 x86_64,asan_osx_dynamic)
 -
- Configs += ubsan_osx
- UniversalArchs.ubsan_osx := $(call CheckArches,i386 x86_64,ubsan_osx)
+-Configs += ubsan_osx
+-UniversalArchs.ubsan_osx := $(call CheckArches,i386 x86_64,ubsan_osx)
++#Configs += ubsan_osx
++#UniversalArchs.ubsan_osx := $(call CheckArches,i386 x86_64,ubsan_osx)
  
 Index: llvm-3.3/tools/clang/runtime/compiler-rt/Makefile
 ===================================================================
---- llvm-3.3/tools/clang/runtime/compiler-rt/Makefile	(revision 185755)
-+++ llvm-3.3/tools/clang/runtime/compiler-rt/Makefile	(working copy)
-@@ -75,7 +75,6 @@
- RuntimeDirs += darwin
+--- a/tools/clang/runtime/compiler-rt/Makefile.orig	2013-11-15 15:12:44.000000000 -0800
++++ a/tools/clang/runtime/compiler-rt/Makefile	2014-04-17 22:18:44.000000000 -0700
+@@ -81,9 +81,7 @@ ifeq ($(OS),Darwin)
+ RuntimeDirs += darwin darwin_embedded
  RuntimeLibrary.darwin.Configs := \
  	eprintf.a 10.4.a osx.a ios.a cc_kext.a cc_kext_ios5.a \
--	asan_osx.a asan_osx_dynamic.dylib \
- 	profile_osx.a profile_ios.a \
- 	ubsan_osx.a
- endif
+-	asan_osx_dynamic.dylib \
+-	profile_osx.a profile_ios.a \
+-	ubsan_osx.a
++	profile_osx.a profile_ios.a
+ RuntimeLibrary.darwin_embedded.Configs := \
+ 	soft_static.a hard_static.a soft_pic.a hard_pic.a
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140418/cc10a382/attachment.html>


More information about the macports-changes mailing list