[131487] trunk/dports/devel/ld64

jeremyhu at macports.org jeremyhu at macports.org
Mon Jan 12 12:57:35 PST 2015


Revision: 131487
          https://trac.macports.org/changeset/131487
Author:   jeremyhu at macports.org
Date:     2015-01-12 12:57:35 -0800 (Mon, 12 Jan 2015)
Log Message:
-----------
ld64: Update ld64-127 to build on Leopard/ppc

Modified Paths:
--------------
    trunk/dports/devel/ld64/Portfile

Added Paths:
-----------
    trunk/dports/devel/ld64/files/ld64-127-ppc.patch

Modified: trunk/dports/devel/ld64/Portfile
===================================================================
--- trunk/dports/devel/ld64/Portfile	2015-01-12 20:43:13 UTC (rev 131486)
+++ trunk/dports/devel/ld64/Portfile	2015-01-12 20:57:35 UTC (rev 131487)
@@ -35,8 +35,7 @@
         default_variants +llvm34
     }
 
-    # Leopard/powerpc has the option to not be LTO
-    if {![variant_isset llvm34] && ![variant_isset llvm35] && ${os.arch} ne "powerpc" && ${os.major} >= 9} {
+    if {![variant_isset llvm34] && ![variant_isset llvm35] && ${os.major} >= 9} {
         ui_error "Your platform cannot be configured without LTO support in ld64.  Please enable one of the llvmXX variants, and try again."
         return -code error "Your platform cannot be configured without LTO support in ld64.  Please enable one of the llvmXX variants, and try again."
     }
@@ -77,9 +76,8 @@
     depends_build-append    path:include/libunwind.h:libunwind-headers
 }
 
-if {${os.arch} eq "powerpc" || ([variant_isset universal] && [lsearch ${universal_archs} ppc] != -1) || ${os.major} < 9} {
+if {${os.major} < 9} {
     # XCode 3.2.6
-    # 127.2 should work for powerpc, but it will require some build fixes.
     version             97.17
     revision            4
     checksums           rmd160  d52df7d7f741c8bedd29cbac73dbb9db992b4795 \
@@ -97,12 +95,12 @@
     revision            9
     checksums           rmd160  8ee709341549a1944732daef6ebab7ef1acfcc6e \
                         sha256  97b75547b2bd761306ab3e15ae297f01e7ab9760b922bc657f4ef72e4e052142
-    supported_archs     i386 x86_64
+    supported_archs     i386 x86_64 ppc
 
     set makefile	"Makefile-127"
 
     patchfiles-delete   ld64-133-no-CrashReporterClient.h.patch ld64-136-i386-badAddress.patch PR-16935960.patch PR-16936488.patch
-    patchfiles-append   ld64-127-any-cctools.patch ld64-127-long-branch-warn.patch ld64-127-cxx_initializer_order_and_sim.patch
+    patchfiles-append   ld64-127-any-cctools.patch ld64-127-long-branch-warn.patch ld64-127-cxx_initializer_order_and_sim.patch ld64-127-ppc.patch
 } elseif {${os.major} < 11} {
     # XCode 4.6
     # Until we figure out a way to better bootstrap ld64-236 on SnowLeopard or fix its build failure
@@ -111,7 +109,7 @@
     checksums           rmd160  4a2930ccdd398b63a108810e90293ab96dc154a0 \
                         sha256  99d6c4acb6d4cdf45772951dd2308222aa966763170137459a9d276674645d9e
  
-    supported_archs     i386 x86_64
+    supported_archs     i386 x86_64 ppc
 
     patchfiles-delete   PR-16935960.patch PR-16936488.patch
     patchfiles-append   ld64-136-hash_set.patch

Added: trunk/dports/devel/ld64/files/ld64-127-ppc.patch
===================================================================
--- trunk/dports/devel/ld64/files/ld64-127-ppc.patch	                        (rev 0)
+++ trunk/dports/devel/ld64/files/ld64-127-ppc.patch	2015-01-12 20:57:35 UTC (rev 131487)
@@ -0,0 +1,27 @@
+diff --git src/ld/HeaderAndLoadCommands.hpp src/ld/HeaderAndLoadCommands.hpp
+index 395fc99..ac2a0a5 100644
+--- src/ld/HeaderAndLoadCommands.hpp
++++ src/ld/HeaderAndLoadCommands.hpp
+@@ -1106,7 +1106,7 @@ uint8_t* HeaderAndLoadCommandsAtom<x86>::copyThreadsLoadCommand(uint8_t* p) cons
+ template <>
+ uint32_t HeaderAndLoadCommandsAtom<x86_64>::threadLoadCommandSize() const
+ {
+-	return this->alignedSize(16 + x86_THREAD_STATE64_COUNT * 4); 
++	return this->alignedSize(16 + 42*4);	// base size + x86_THREAD_STATE64_COUNT * 4
+ }
+ 
+ template <>
+@@ -1117,8 +1117,8 @@ uint8_t* HeaderAndLoadCommandsAtom<x86_64>::copyThreadsLoadCommand(uint8_t* p) c
+ 	macho_thread_command<P>* cmd = (macho_thread_command<P>*)p;
+ 	cmd->set_cmd(LC_UNIXTHREAD);
+ 	cmd->set_cmdsize(threadLoadCommandSize());
+-	cmd->set_flavor(x86_THREAD_STATE64);			
+-	cmd->set_count(x86_THREAD_STATE64_COUNT);	
++	cmd->set_flavor(4);				// x86_THREAD_STATE64
++	cmd->set_count(42);				// x86_THREAD_STATE64_COUNT
+ 	cmd->set_thread_register(16, start);		// rip 
+ 	if ( _options.hasCustomStack() )
+ 		cmd->set_thread_register(7, _options.customStackAddr());	// r1
+-- 
+2.2.1
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150112/51f8a05a/attachment.html>


More information about the macports-changes mailing list