--- gcc.SlackBuild 2006-04-03 20:38:59.000000000 -0400 +++ gcc.SlackBuild.s390x 2009-05-19 04:28:57.000000000 -0400 @@ -50,7 +50,8 @@ CWD=`pwd` # Temporary build location. This should *NOT* be a directory # path a non-root user could create later... -TMP=/gcc-`mcookie` +#TMP=/gcc-`mcookie` +TMP=/root/gcc-$VERSION # This is the main DESTDIR target: PKG1=$TMP/package-gcc @@ -63,8 +64,10 @@ PKG7=$TMP/package-gcc-g++-gch # Clear the build locations: -if [ -d $TMP ]; then - rm -rf $TMP +if [ -e $TMP ]; then + rm -rf $TMP /tmp/gcc-$VERSION + mkdir /tmp/gcc-$VERSION + ln -s /tmp/gcc-$VERSION $TMP fi mkdir -p $PKG{1,2,3,4,5,6,7}/usr/doc/gcc-$VERSION @@ -72,6 +75,10 @@ tar xjvf $CWD/gcc-$VERSION.tar.bz2 # install docs ( cd gcc-$VERSION + # Fix a problem that keeps the kernel from building with gcc 3.4.x + # Taken from the version of the module that first contained the fix: + # http://gcc.gnu.org/cgi-bin/cvsweb.cgi/~checkout~/gcc/gcc/cgraphunit.c?rev=1.37.2.1 + # cat $CWD/cgraphunit.c.diff.new2 | patch -p1 --backup --suffix=.orig --verbose || exit 1 # Fix perms/owners chown -R root:root . find . -perm 777 -exec chmod 755 {} \; @@ -139,10 +146,15 @@ cp -a docs/html/faq/index.html $PKG2/usr/doc/gcc-${VERSION}/libstdc++-v3/faq.html ) ) +# This is to get around a problem caused by the GCC developers not wanting to use POSIX +# compliant calls to the head command (they use head -1 instead of head -n 1). The problem +# shows up in the "make check" as "FAIL: abi_check" for libstdc++ +export _POSIX2_VERSION=199209 + # build gcc ( mkdir gcc.build.lnx; cd gcc.build.lnx; - ../gcc-$VERSION/configure --prefix=/usr \ + $TMP/gcc-$VERSION/configure --prefix=/usr \ --enable-shared \ --enable-threads=posix \ --enable-__cxa_atexit \ @@ -153,7 +165,7 @@ --host=${TARGET} # Start the build: - make -j2 bootstrap + make -j2 bootstrap || exit 1 ( cd gcc #make gnatlib GNATLIBCFLAGS="-g -O2" @@ -174,10 +186,13 @@ # make install-gnatlib DESTDIR=$PKG1 make -i install-info DESTDIR=$PKG1 - chmod 755 $PKG1/usr/lib/libgcc_s.so.1 + chmod 755 $PKG1/usr/lib/libgcc_s.so.1 \ + $PKG1/usr/lib64/libgcc_s.so.1 # This is provided by binutils, so delete it here: - rm -f $PKG1/usr/lib/libiberty.a + rm -f $PKG1/usr/lib/libiberty.a \ + $PKG1/usr/lib/32/libiberty.a + rmdir $PKG1/usr/lib/32 # Strip out unneeded stuff from the libraries and binaries: ( cd $PKG1 @@ -211,6 +226,7 @@ ln -sf g++-gcc-$VERSION ${TARGET}-c++ ln -sf g++-gcc-$VERSION ${TARGET}-g++ ln -sf g77 f77 + chown root:bin * . ) ( cd $PKG1/usr/man gzip -9 */* @@ -246,10 +262,12 @@ ( cd $PKG2 mkdir -p usr/bin mv $PKG1/usr/bin/*++* usr/bin + chown -R root:bin usr/bin mkdir -p usr/include mv $PKG1/usr/include/c++ usr/include - mkdir -p usr/lib + mkdir -p usr/lib usr/lib64 mv $PKG1/usr/lib/*++* usr/lib + mv $PKG1/usr/lib64/*++* usr/lib64 mkdir -p usr/libexec/gcc/$TARGET/$VERSION mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/cc1plus usr/libexec/gcc/$TARGET/$VERSION/cc1plus mkdir -p usr/man/man1 @@ -260,11 +278,14 @@ ( cd $PKG3 mkdir -p usr/bin mv $PKG1/usr/bin/*77* usr/bin + chown -R root:bin usr/bin mkdir -p usr/info mv $PKG1/usr/info/g77* usr/info - mkdir -p usr/lib + mkdir -p usr/lib usr/lib64 mv $PKG1/usr/lib/libfrtbegin.a usr/lib + mv $PKG1/usr/lib64/libfrtbegin.a usr/lib64 mv $PKG1/usr/lib/libg2c* usr/lib + mv $PKG1/usr/lib64/libg2c* usr/lib64 mkdir -p usr/libexec/gcc/$TARGET/$VERSION mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/f771 usr/libexec/gcc/$TARGET/$VERSION/f771 mkdir -p usr/lib/gcc/$TARGET/$VERSION/include @@ -278,6 +299,7 @@ mkdir -p usr/bin mv $PKG1/usr/bin/gnat* usr/bin mv $PKG1/usr/bin/gpr* usr/bin + chown -R root:bin usr/bin mkdir -p usr/info mv $PKG1/usr/info/gnat* usr/info mkdir -p usr/share @@ -300,6 +322,7 @@ mv $PKG1/usr/bin/jcf-dump usr/bin mv $PKG1/usr/bin/jv-* usr/bin mv $PKG1/usr/bin/rmi* usr/bin + chown -R root:bin usr/bin mkdir -p usr/include mv $PKG1/usr/include/gcj usr/include mv $PKG1/usr/include/gnu usr/include @@ -311,10 +334,13 @@ mkdir -p usr/info mv $PKG1/usr/info/gcj.* usr/info mv $PKG1/usr/info/fastjar.* usr/info - mkdir -p usr/lib + mkdir -p usr/lib usr/lib64 mv $PKG1/usr/lib/libgcj* usr/lib - strip -g usr/lib/libgcj.a + mv $PKG1/usr/lib64/libgcj* usr/lib64 + strip -g usr/lib/libgcj.a \ + usr/lib64/libgcj.a mv $PKG1/usr/lib/lib-org* usr/lib + mv $PKG1/usr/lib64/lib-org* usr/lib64 mv $PKG1/usr/lib/security usr/lib mkdir -p usr/lib/pkgconfig mv $PKG1/usr/lib/pkgconfig/libgcj.pc usr/lib/pkgconfig @@ -339,8 +365,9 @@ # gcc-objc: ( cd $PKG6 - mkdir -p usr/lib + mkdir -p usr/lib usr/lib64 mv $PKG1/usr/lib/libobjc* usr/lib + mv $PKG1/usr/lib64/libobjc* usr/lib64 mkdir -p usr/libexec/gcc/$TARGET/$VERSION mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/cc1obj usr/libexec/gcc/$TARGET/$VERSION mkdir -p usr/lib/gcc/$TARGET/$VERSION/include @@ -358,7 +385,7 @@ # Filter all .la files (thanks much to Mark Post for the sed script): ( cd $TMP for file in `find . -type f -name "*.la"` ; do - cat $file | sed -e 's%-L/gcc-[[:graph:]]* % %g' > $TMP/tmp-la-file + cat $file | sed -e 's%-L/root/gcc-[[:graph:]]* % %g' > $TMP/tmp-la-file cat $TMP/tmp-la-file > $file done rm $TMP/tmp-la-file