[89851] trunk/dports/cross/avr-binutils

titus at macports.org titus at macports.org
Mon Feb 13 01:36:05 PST 2012


Revision: 89851
          http://trac.macports.org/changeset/89851
Author:   titus at macports.org
Date:     2012-02-13 01:36:04 -0800 (Mon, 13 Feb 2012)
Log Message:
-----------
ticket #33201 : update avr-binutils to 2.22

Modified Paths:
--------------
    trunk/dports/cross/avr-binutils/Portfile

Added Paths:
-----------
    trunk/dports/cross/avr-binutils/files/
    trunk/dports/cross/avr-binutils/files/pr12161.diff

Modified: trunk/dports/cross/avr-binutils/Portfile
===================================================================
--- trunk/dports/cross/avr-binutils/Portfile	2012-02-13 09:03:50 UTC (rev 89850)
+++ trunk/dports/cross/avr-binutils/Portfile	2012-02-13 09:36:04 UTC (rev 89851)
@@ -1,161 +1,164 @@
 # $Id$
 
-PortSystem			1.0
-name				avr-binutils
-version				2.20
-revision			1
+PortSystem          1.0
 
+name                avr-binutils
+version             2.22
+description         FSF Binutils for avr cross development
+long_description    Free Software Foundation development toolchain ("binutils") for \
+                    avr cross development.
+platforms           darwin
+categories          cross devel
+maintainers         nomaintainer
+homepage            http://www.gnu.org/software/binutils/binutils.html
+master_sites            gnu:binutils
+distname            binutils-${version}
+use_bzip2           yes
+checksums           md5     ee0f10756c84979622b992a4a61ea3f5         \
+                    sha1    65b304a0b9a53a686ce50a01173d1f40f8efe404 \
+                    rmd160  34cebe4cdca9480d5dc6f6b00b052c48c8ac30dc
+
 # Parameters for this port.
 set crossgcc-target avr
 
-description			FSF Binutils for avr cross development
-long_description	Free Software Foundation development toolchain ("binutils") for \
-					avr cross development.
-platforms			darwin
-categories			cross devel
-maintainers			nomaintainer
-homepage			http://www.gnu.org/software/binutils/binutils.html
-master_sites		gnu:binutils \
-					ftp://ftp.kernel.org/pub/linux/devel/binutils/ \
-					http://ftp.kernel.org/pub/linux/devel/binutils/
-distname			binutils-${version}
-use_bzip2			yes
-checksums			md5     ee2d3e996e9a2d669808713360fa96f8 \
-					sha1    747e7b4d94bce46587236dc5f428e5b412a590dc \
-					rmd160  284074e2453e517d036ffce2c0f3d56439e2e5c0
+depends_lib         port:gettext
 
-depends_lib		    port:gettext
-
 # All cross ports violate the mtree layout.
-destroot.violate_mtree	yes
+destroot.violate_mtree  yes
 
 # Download everything to binutils/
-dist_subdir			binutils
+dist_subdir         binutils
 
+# fix crash in ld when given --relax option.
+# see http://sourceware.org/bugzilla/show_bug.cgi?id=12161
+patchfiles-append   pr12161.diff
+
 # Build in a different directory, as advised in the README file.
-pre-configure   	{ system "cd ${workpath} && mkdir -p build"}
-configure.dir   	${workpath}/build
-configure.cmd   	${worksrcpath}/configure
-configure.cc	   	"cc -no-cpp-precomp"
+pre-configure       { system "cd ${workpath} && mkdir -p build"}
+configure.dir       ${workpath}/build
+configure.cmd       ${worksrcpath}/configure
+configure.cc        "cc -no-cpp-precomp"
 
-# using --disable-werror because of 
+# using --disable-werror because of
 # "strings.c:419: warning: 'stat64' is deprecated (declared at /usr/include/sys/stat.h:465)"
 # don't know how to fix this proper...
-configure.args  	--disable-werror \
-					--infodir='${prefix}/share/info' \
-					--disable-nls \
-					--target=${crossgcc-target} \
-					--program-prefix=${crossgcc-target}- \
-					--mandir='${prefix}/share/man' \
-					--enable-install-libiberty \
-					--enable-install-libbfd
+configure.args      --disable-werror                     \
+                    --infodir='${prefix}/share/info'     \
+                    --disable-nls                        \
+                    --target=${crossgcc-target}          \
+                    --program-prefix=${crossgcc-target}- \
+                    --mandir='${prefix}/share/man'       \
+                    --enable-install-libiberty           \
+                    --enable-install-libbfd
 
 
-if {$build_arch != "" && ${os.platform} == "darwin"} { 
-	configure.args-append --build=${build_arch}-apple-darwin${os.major} \
-						  --host=${build_arch}-apple-darwin${os.major} 
+if {$build_arch != "" && ${os.platform} == "darwin"} {
+    configure.args-append --build=${build_arch}-apple-darwin${os.major} \
+                          --host=${build_arch}-apple-darwin${os.major}
 }
 
-build.dir       	${workpath}/build
-					
+build.dir           ${workpath}/build
+
 # We don't want the etc module.
 post-extract {
-	system "rm -rf ${worksrcpath}/etc"
+    system "rm -rf ${worksrcpath}/etc"
 }
 
 post-patch {
-	namespace eval crossgcc {}
+    namespace eval crossgcc {}
 
     # Install avr-compatible libbfd/libiberty in the avr directory
     reinplace "s|bfdlibdir=.*|bfdlibdir='${prefix}/avr/host/lib'|g" \
-        ${worksrcpath}/bfd/configure \
+        ${worksrcpath}/bfd/configure                                \
         ${worksrcpath}/opcodes/configure
     reinplace "s|bfdincludedir=.*|bfdincludedir='${prefix}/avr/host/include'|g"  \
-        ${worksrcpath}/bfd/configure \
+        ${worksrcpath}/bfd/configure                                             \
         ${worksrcpath}/opcodes/configure
 
-    reinplace "s|libdir = .*|libdir = \"${prefix}/avr/host/lib\"|g"  \
+    reinplace "s|libdir = .*|libdir = \"${prefix}/avr/host/lib\"|g" \
         ${worksrcpath}/libiberty/Makefile.in
-    reinplace "s|MULTIOSDIR = .*|MULTIOSDIR = |g"  \
+    reinplace "s|MULTIOSDIR = .*|MULTIOSDIR = |g" \
         ${worksrcpath}/libiberty/Makefile.in
 
-	# Fix the info pages and related stuff.
-	#	
-	# path: path to the doc directory (e.g. gas/doc/)
-	# makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
-	# name: name of the info page (e.g. as)
-	# suffix: suffix of the souce page (texinfo or texi)
-	proc crossgcc::fixinfo { path makefile name suffix } {
-		global crossgcc-target worksrcpath
+    # Fix the info pages and related stuff.
+    #
+    # path: path to the doc directory (e.g. gas/doc/)
+    # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
+    # name: name of the info page (e.g. as)
+    # suffix: suffix of the souce page (texinfo or texi)
+    proc crossgcc::fixinfo { path makefile name suffix } {
+        global crossgcc-target worksrcpath
 
-		# Fix the source
-		reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
-			${worksrcpath}/${path}/${name}.${suffix}
-		reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
-			${worksrcpath}/${path}/${name}.${suffix}
-		reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
-			${worksrcpath}/${path}/${name}.${suffix}
-		
-		# Fix the Makefile
-		reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
-			${worksrcpath}/${makefile}
-		reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
-			${worksrcpath}/${makefile}
-		
-		# Rename the source
-		file rename ${worksrcpath}/${path}/${name}.${suffix} \
-			${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
-		
-		# Fix install-info's dir.
-		# (note: this may be effectless if there was no info dir to be fixed)
-		reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-dir|g" \
-			"${worksrcpath}/${makefile}"
-	}
+        # Fix the source
+        reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
+            ${worksrcpath}/${path}/${name}.${suffix}
+        reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
+            ${worksrcpath}/${path}/${name}.${suffix}
+        reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
+            ${worksrcpath}/${path}/${name}.${suffix}
 
-	# Fix the gettext files and related stuff.
-	#	
-	# module: name of the module (e.g. gas)
-	proc crossgcc::fixgettext { module } {
-		global crossgcc-target worksrcpath
+        # Fix the Makefile
+        reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
+            ${worksrcpath}/${makefile}
+        reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
+            ${worksrcpath}/${makefile}
 
-		if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
-			reinplace "s|@PACKAGE@|${crossgcc-target}- at PACKAGE@|g" \
-				"${worksrcpath}/${module}/Makefile.in"
-		}
-		if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
-			reinplace "s|@PACKAGE@|${crossgcc-target}- at PACKAGE@|g" \
-				"${worksrcpath}/${module}/doc/Makefile.in"
-		}
-		if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
-			reinplace "s|@PACKAGE@|${crossgcc-target}- at PACKAGE@|g" \
-				"${worksrcpath}/${module}/po/Make-in"
-		}
-	}
+        # Rename the source
+        file rename ${worksrcpath}/${path}/${name}.${suffix} \
+            ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
 
-	# gas/doc/as.texinfo
-	crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
+        # Fix install-info's dir.
+        # (note: this may be effectless if there was no info dir to be fixed)
+        reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-dir|g" \
+            "${worksrcpath}/${makefile}"
+    }
 
-	# bfd/doc/bfd.texinfo
-	crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
+    # Fix the gettext files and related stuff.
+    #
+    # module: name of the module (e.g. gas)
+    proc crossgcc::fixgettext { module } {
+        global crossgcc-target worksrcpath
 
-	# binutils/doc/binutils.texi
-	crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
+        if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
+            reinplace "s|@PACKAGE@|${crossgcc-target}- at PACKAGE@|g" \
+                "${worksrcpath}/${module}/Makefile.in"
+        }
+        if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
+            reinplace "s|@PACKAGE@|${crossgcc-target}- at PACKAGE@|g" \
+                "${worksrcpath}/${module}/doc/Makefile.in"
+        }
+        if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
+            reinplace "s|@PACKAGE@|${crossgcc-target}- at PACKAGE@|g" \
+                "${worksrcpath}/${module}/po/Make-in"
+        }
+    }
 
-	# gprof/gprof.texi
-	crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
+    # gas/doc/as.texinfo
+    crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
 
-	# ld/ld.texinfo
-	crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
-	
-	# gettext stuff.
-	crossgcc::fixgettext bfd
-	crossgcc::fixgettext binutils
-	crossgcc::fixgettext gas
-	crossgcc::fixgettext gprof
-	crossgcc::fixgettext ld
-	crossgcc::fixgettext opcodes
+    # bfd/doc/bfd.texinfo
+    crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
+
+    # binutils/doc/binutils.texi
+    crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
+
+    # gprof/gprof.texi
+    crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
+
+    # ld/ld.texinfo
+    crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
+
+    # gettext stuff.
+    crossgcc::fixgettext bfd
+    crossgcc::fixgettext binutils
+    crossgcc::fixgettext gas
+    crossgcc::fixgettext gprof
+    crossgcc::fixgettext ld
+    crossgcc::fixgettext opcodes
 }
 
 post-destroot {
     file rename "${destroot}/${prefix}/lib/libiberty.a" "${destroot}/${prefix}/avr/host/lib/"
+# For LTO optimization: With LTO enabled, collect2 searches for avr-ld
+    ln -sf "${prefix}/avr/bin/ld" "${destroot}/${prefix}/avr/bin/avr-ld"
 }

Added: trunk/dports/cross/avr-binutils/files/pr12161.diff
===================================================================
--- trunk/dports/cross/avr-binutils/files/pr12161.diff	                        (rev 0)
+++ trunk/dports/cross/avr-binutils/files/pr12161.diff	2012-02-13 09:36:04 UTC (rev 89851)
@@ -0,0 +1,32 @@
+--- bfd/elf32-avr.c.orig	2012-02-10 14:13:47.000000000 +0100
++++ bfd/elf32-avr.c	2012-02-10 14:13:51.000000000 +0100
+@@ -1503,11 +1503,17 @@
+        bfd_vma symval;
+        bfd_vma shrinked_insn_address;
+ 
++       if (isec->reloc_count == 0)
++	 continue;
++
+        shrinked_insn_address = (sec->output_section->vma
+                                 + sec->output_offset + addr - count);
+ 
+-       irelend = elf_section_data (isec)->relocs + isec->reloc_count;
+-       for (irel = elf_section_data (isec)->relocs;
++       irel = elf_section_data (isec)->relocs;
++       if (irel == NULL)
++	 irel = _bfd_elf_link_read_relocs (abfd, isec, NULL, NULL, FALSE);
++
++       for (irelend = irel + isec->reloc_count;
+             irel < irelend;
+             irel++)
+          {
+@@ -1564,6 +1570,9 @@
+ 	   /* else...Reference symbol is extern.  No need for adjusting
+ 	      the addend.  */
+ 	 }
++
++       if (elf_section_data (isec)->relocs == NULL)
++	 free (irelend - isec->reloc_count);
+      }
+   }
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120213/6e9fa3fa/attachment.html>


More information about the macports-changes mailing list