![](https://secure.gravatar.com/avatar/df8330968b6df8cd1c1942c5fb4b720c.jpg?s=120&d=mm&r=g)
Author: jue Date: 2006-03-15 20:00:12 +0100 (Wed, 15 Mar 2006) New Revision: 942 Added: crux-2.2/ports/core/gcc/gcc-4.0.3-latentbug-addrefvars.patch Modified: crux-2.2/ports/core/gcc/.md5sum crux-2.2/ports/core/gcc/Pkgfile Log: gcc: added patch to fix http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21304. Thanks Daniel. Modified: crux-2.2/ports/core/gcc/.md5sum =================================================================== --- crux-2.2/ports/core/gcc/.md5sum 2006-03-15 17:41:16 UTC (rev 941) +++ crux-2.2/ports/core/gcc/.md5sum 2006-03-15 19:00:12 UTC (rev 942) @@ -1 +1,2 @@ +31e541f9ac2c8613bc92b91db453f0a9 gcc-4.0.3-latentbug-addrefvars.patch 6ff1af12c53cbb3f79b27f2d6a9a3d50 gcc-4.0.3.tar.bz2 Modified: crux-2.2/ports/core/gcc/Pkgfile =================================================================== --- crux-2.2/ports/core/gcc/Pkgfile 2006-03-15 17:41:16 UTC (rev 941) +++ crux-2.2/ports/core/gcc/Pkgfile 2006-03-15 19:00:12 UTC (rev 942) @@ -4,10 +4,15 @@ name=gcc version=4.0.3 -release=1 -source=(ftp://sources.redhat.com/pub/gcc/releases/$name-$version/$name-$version.tar.bz2) - +release=2 +source=(ftp://sources.redhat.com/pub/gcc/releases/$name-$version/$name-$version.tar.bz2 \ + $name-$version-latentbug-addrefvars.patch) + build() { + cd $name-$version + patch -p1 < $SRC/$name-$version-latentbug-addrefvars.patch + cd .. + mkdir build cd build ../$name-$version/configure --prefix=/usr \ @@ -19,9 +24,11 @@ --enable-shared \ --disable-nls \ --with-x=no + make bootstrap - make check | tee ~/gcc-${version}_make_test_resul + make check make DESTDIR=$PKG install + mkdir $PKG/lib ln -sf ../usr/bin/cpp $PKG/lib/cpp ln -sf gcc $PKG/usr/bin/cc Added: crux-2.2/ports/core/gcc/gcc-4.0.3-latentbug-addrefvars.patch =================================================================== --- crux-2.2/ports/core/gcc/gcc-4.0.3-latentbug-addrefvars.patch 2006-03-15 17:41:16 UTC (rev 941) +++ crux-2.2/ports/core/gcc/gcc-4.0.3-latentbug-addrefvars.patch 2006-03-15 19:00:12 UTC (rev 942) @@ -0,0 +1,25 @@ +diff -Nru gcc-4.0.3-old/gcc/tree-dfa.c gcc-4.0.3/gcc/tree-dfa.c +--- gcc-4.0.3-old/gcc/tree-dfa.c 2006-03-14 03:13:30.000000000 +0100 ++++ gcc-4.0.3/gcc/tree-dfa.c 2006-03-14 03:16:56.000000000 +0100 +@@ -898,10 +898,18 @@ + if (is_global_var (var)) + mark_call_clobbered (var); + ++ + /* Scan DECL_INITIAL for pointer variables as they may contain +- address arithmetic referencing the address of other +- variables. */ +- if (DECL_INITIAL (var)) ++ address arithmetic referencing the address of other ++ variables. */ ++ if (DECL_INITIAL (var) ++ /* Initializers of external variables are not useful to the ++ optimizers. */ ++ && !DECL_EXTERNAL (var) ++ /* It's not necessary to walk the initial value of non-constant ++ variables because it cannot be propagated by the ++ optimizers. */ ++ && (TREE_CONSTANT (var) || TREE_READONLY (var))) + walk_tree (&DECL_INITIAL (var), find_vars_r, walk_state, 0); + } + }