wok-current rev 8181
imported patch toolchain/gcc.patch
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Thu Jan 27 00:20:49 2011 +0100 (2011-01-27) |
parents | a74236fa5e55 |
children | 3b10cfcc3474 |
files | gcc/receipt gcc/stuff/gcc-4.5.2-startfiles_fix-1.patch |
line diff
1.1 --- a/gcc/receipt Thu Jan 27 00:20:49 2011 +0100 1.2 +++ b/gcc/receipt Thu Jan 27 00:20:49 2011 +0100 1.3 @@ -1,54 +1,143 @@ 1.4 # SliTaz package receipt. 1.5 1.6 PACKAGE="gcc" 1.7 -VERSION="4.5.1" 1.8 +VERSION="4.5.2" 1.9 CATEGORY="development" 1.10 SHORT_DESC="The the GNU Compiler Collection." 1.11 MAINTAINER="pankso@slitaz.org" 1.12 -DEPENDS="libgomp gmp mpfr gcc-lib-base mpc-library elfutils" 1.13 -BUILD_DEPENDS="glibc-dev gawk flex gmp gmp-dev mpfr mpfr-dev mpc-library \ 1.14 -elfutils elfutils-dev" 1.15 +DEPENDS="libgomp gcc-lib-base mpc-library elfutils" 1.16 +BUILD_DEPENDS="elfutils mpc-library" 1.17 TARBALL="$PACKAGE-$VERSION.tar.bz2" 1.18 WEB_SITE="http://gcc.gnu.org/" 1.19 WGET_URL="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$VERSION/$TARBALL" 1.20 1.21 +# Rules to compile & install the temporary toolchain. 1.22 +precook_tmp_toolchain() 1.23 +{ 1.24 + report open-bloc 1.25 + cd $src 1.26 + 1.27 + # GCC requires the GMP, MPFR and MPC packages. 1.28 + tazwok get-src mpfr --target=$PWD/mpfr 1.29 + tazwok get-src gmp --target=$PWD/gmp 1.30 + tazwok get-src mpc-library --target=$PWD/mpc 1.31 + 1.32 + report step "Running compilation" 1.33 + 1.34 + # Build it in a separate directory. 1.35 + mkdir ../gcc-build 1.36 + cd ../gcc-build 1.37 + 1.38 + { $src/configure \ 1.39 + --target=$BUILD_HOST \ 1.40 + --disable-nls --disable-shared --disable-multilib \ 1.41 + --disable-decimal-float --disable-threads \ 1.42 + --disable-libmudflap --disable-libssp \ 1.43 + --disable-libgomp --enable-languages=c \ 1.44 + --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs \ 1.45 + --without-ppl --without-cloog && 1.46 + make && 1.47 + make install 1.48 + } || return 1 1.49 + 1.50 + # See LFS for more detais about this. 1.51 + ln -s libgcc.a `$BUILD_HOST-gcc -print-libgcc-file-name | \ 1.52 + sed 's/libgcc/&_eh/'` 1.53 + report close-bloc 1.54 +} 1.55 + 1.56 +cook_tmp_toolchain() 1.57 +{ 1.58 + report open-bloc 1.59 + cd $src 1.60 + patch -Np1 -i ../stuff/gcc-$VERSION-startfiles_fix-1.patch 1.61 + 1.62 + # Details about theses lines are in LFS book. 1.63 + sed 's@\./fixinc\.sh@-c true@' -i gcc/Makefile.in 1.64 + sed 's/^T_CFLAGS =$/& -fomit-frame-pointer/' -i gcc/Makefile.in 1.65 + for file in \ 1.66 + $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h) 1.67 + do 1.68 + sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \ 1.69 + -e 's@/usr@/tools@g' -i $file 1.70 + echo ' 1.71 +#undef STANDARD_INCLUDE_DIR 1.72 +#define STANDARD_INCLUDE_DIR 0 1.73 +#define STANDARD_STARTFILE_PREFIX_1 "" 1.74 +#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file 1.75 + done 1.76 + 1.77 + if [ "$ARCH" = x86_64 ]; then 1.78 + for file in $(find gcc/config -name t-linux64) ; do 1.79 + sed '/MULTILIB_OSDIRNAMES/d' -i $file 1.80 + done 1.81 + fi 1.82 + 1.83 + # GCC requires the GMP, MPFR and MPC packages. 1.84 + tazwok get-src mpfr --target=$PWD/mpfr 1.85 + tazwok get-src gmp --target=$PWD/gmp 1.86 + tazwok get-src mpc-library --target=$PWD/mpc 1.87 + 1.88 + report step "Running compilation" 1.89 + 1.90 + # Build it in a separate directory. 1.91 + mkdir ../gcc-build 1.92 + cd ../gcc-build 1.93 + 1.94 + { CC="$BUILD_HOST-gcc -B/tools/lib/" \ 1.95 + AR=$BUILD_HOST-ar RANLIB=$BUILD_HOST-ranlib \ 1.96 + $src/configure \ 1.97 + --with-local-prefix=/tools --enable-clocale=gnu \ 1.98 + --enable-shared --enable-threads=posix \ 1.99 + --enable-__cxa_atexit --enable-languages=c,c++ \ 1.100 + --disable-libstdcxx-pch --disable-multilib \ 1.101 + --disable-bootstrap --disable-libgomp \ 1.102 + --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs \ 1.103 + --without-ppl --without-cloog && 1.104 + make && 1.105 + make install 1.106 + } || return 1 1.107 + ln -s gcc /tools/bin/cc 1.108 + report close-bloc 1.109 +} 1.110 + 1.111 # Rules to configure and make the package. 1.112 compile_rules() 1.113 { 1.114 # Use libiberty.a from binutils. 1.115 sed -i 's/install_to_$(INSTALL_DEST) //' \ 1.116 $PACKAGE-$VERSION/libiberty/Makefile.in || exit 1 1.117 - mkdir -p gcc-build && cd gcc-build 1.118 - ../$PACKAGE-$VERSION/configure --prefix=/usr --libexecdir=/usr/lib \ 1.119 - --infodir=/usr/share/info --mandir=/usr/share/man --enable-nls \ 1.120 - --enable-languages=c,c++,objc,fortran --enable-shared --with-system-zlib \ 1.121 - --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit \ 1.122 - --enable-lto \ 1.123 - --enable-threads=posix --with-tune=i486 i486-pc-linux-gnu && 1.124 - make -j 4 bootstrap && 1.125 - # Make install in the source tree to help creating derivated pkgs 1.126 - # and keep $_pkg variable set for genpkg. 1.127 - make -j 4 DESTDIR=$src/_pkg install 1.128 + mkdir -p gcc-build && cd gcc-build 1.129 + $src/configure --enable-nls \ 1.130 + --enable-languages=c,c++,objc,fortran --enable-shared --with-system-zlib \ 1.131 + --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit \ 1.132 + --enable-lto --disable-bootstrap libexecdir=/usr/lib \ 1.133 + --enable-threads=posix --with-tune=$ARCH $BUILD_HOST && 1.134 + make && 1.135 + make install 1.136 } 1.137 1.138 # Rules to gen a SliTaz package suitable for Tazpkg. 1.139 genpkg_rules() 1.140 { 1.141 mkdir -p $fs/usr/share 1.142 - cp -a $_pkg/usr/bin $fs/usr 1.143 - # Copy all libs. Remove libgcc_s.so and libstdc++.so 1.144 - # they goes in gcc-lib-base-$VERSION package. 1.145 - cp -a $_pkg/usr/lib $fs/usr 1.146 - rm $fs/usr/lib/libgcc_s.so* 1.147 - rm $fs/usr/lib/libstdc++.so* 1.148 - rm $fs/usr/lib/libgomp.so* 1.149 - # Include files. 1.150 - cp -a $_pkg/usr/include $fs/usr 1.151 - # Gfortran goes in gfortran-$VERSION package. 1.152 - rm -f $fs/usr/bin/*gfortran 1.153 - rm -f $fs/usr/lib/libgfortran* 1.154 - rm -f $fs/usr/lib/gcc/*/$VERSION/libgfortran* 1.155 - rm -rf $fs/usr/lib/gcc/*/$VERSION/f* 1.156 + cp -a $_pkg/usr/bin $fs/usr 1.157 + # Copy all libs. Remove libgcc_s.so and libstdc++.so 1.158 + # they goes in gcc-lib-base-$VERSION package. 1.159 + cp -a $_pkg/usr/lib $fs/usr 1.160 + rm $fs/usr/lib/libgcc_s.so* 1.161 + rm $fs/usr/lib/libstdc++.so* 1.162 + rm $fs/usr/lib/libgomp.so* 1.163 + # Include files. 1.164 + cp -a $_pkg/usr/include $fs/usr 1.165 + # Gfortran goes in gfortran-$VERSION package. 1.166 + rm -f $fs/usr/bin/*gfortran 1.167 + rm -f $fs/usr/lib/libgfortran* 1.168 + rm -f $fs/usr/lib/gcc/*/$VERSION/libgfortran* 1.169 + rm -rf $fs/usr/lib/gcc/*/$VERSION/f* 1.170 + 1.171 + # Remove build directory. 1.172 + rm -r $WOK/$PACKAGE/$PACKAGE-build 1.173 } 1.174 1.175 # Post install commands for Tazpkg.
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/gcc/stuff/gcc-4.5.2-startfiles_fix-1.patch Thu Jan 27 00:20:49 2011 +0100 2.3 @@ -0,0 +1,33 @@ 2.4 +Submitted By: Jeremy Huntwork (jhuntwork AT linuxfromscratch DOT org) 2.5 +Date: 2008-12-05 2.6 +Initial Package Version: 4.3.2 2.7 +Upstream Status: See below. 2.8 +Origin: DIY Linux, See below. 2.9 +Description: Original patch follows: 2.10 + 2.11 +# DIY Linux Patch 2.12 +Date: 2008-09-09 2.13 +Author: Refer Origin. 2.14 +Origin: Partial revert of http://gcc.gnu.org/ml/gcc-cvs/2006-11/msg00416.html 2.15 +Maker: Greg Schafer <gschafer@zip.com.au> 2.16 +Upstream Status: Not applicable. Tweak only for Temptools phase GCC-Pass2. 2.17 +Description: Partially revert GCC driver to pre-GCC-4.3 state to allow startfiles to be 2.18 + found in $prefix when GCC is configured for a non-standard prefix eg: /temptools. Full 2.19 + background info in thread starting here: http://gcc.gnu.org/ml/gcc/2008-03/msg00095.html 2.20 + and GCC bugzilla here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35532 2.21 + 2.22 +diff -Naur gcc-4.3.0-RC-20080222.orig/gcc/gcc.c gcc-4.3.0-RC-20080222/gcc/gcc.c 2.23 +--- gcc-4.3.0-RC-20080222.orig/gcc/gcc.c 2008-01-24 18:57:12.000000000 +0000 2.24 ++++ gcc-4.3.0-RC-20080222/gcc/gcc.c 2008-03-02 06:07:36.000000000 +0000 2.25 +@@ -6370,6 +6370,11 @@ 2.26 + machine_suffix, 2.27 + standard_startfile_prefix, NULL), 2.28 + NULL, PREFIX_PRIORITY_LAST, 0, 1); 2.29 ++ add_prefix (&startfile_prefixes, 2.30 ++ concat (standard_exec_prefix, 2.31 ++ machine_suffix, 2.32 ++ standard_startfile_prefix, NULL), 2.33 ++ NULL, PREFIX_PRIORITY_LAST, 0, 1); 2.34 + } 2.35 + 2.36 + /* Sysrooted prefixes are relocated because target_system_root is