# HG changeset patch # User Antoine Bodin # Date 1296084050 -3600 # Node ID c906b3acf8473e5dec97789922fabf46ceecc41d # Parent 85505c8dd53a9c6e3db9637c691915c3c4a1e15e imported patch toolchain/glibc.patch diff -r 85505c8dd53a -r c906b3acf847 glibc/receipt --- a/glibc/receipt Thu Jan 27 00:20:50 2011 +0100 +++ b/glibc/receipt Thu Jan 27 00:20:50 2011 +0100 @@ -1,39 +1,96 @@ # SliTaz package receipt. PACKAGE="glibc" -VERSION="2.11.2" +VERSION="2.12.2" CATEGORY="meta" SHORT_DESC="The GNU C libraries. This package is used to compile the libc." MAINTAINER="pankso@slitaz.org" DEPENDS="glibc-base glibc-locale glibc-dev" -BUILD_DEPENDS="slitaz-toolchain gawk perl" +BUILD_DEPENDS="linux-api-headers" TARBALL="$PACKAGE-$VERSION.tar.gz" WEB_SITE="http://www.gnu.org/software/libc/" WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL" +# Genpkg order: glibc-base, glibc-locale, glibc-dev. +COOK_OPT="genpkg=glibc-base:glib-locale:glibc-dev" + +# Rules to compile & install the temporary toolchain. +cook_tmp_toolchain() +{ + cd $src + + # Fix a bug that prevents Glibc from building with GCC-4.5.2: + patch -Np1 -i ../stuff/glibc-2.12.2-gcc_fix-1.patch + + # Build in a separate directory. + mkdir ../glibc-build && cd ../glibc-build + + # glibc no longer support i386, so use -march=i486 for better compatibility. + case $ARCH in + i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;; + esac + + { $src/configure \ + --host=$BUILD_HOST \ + --build=$($src/scripts/config.guess) \ + --disable-profile --enable-add-ons \ + --enable-kernel=2.6.22.5 --with-headers=/tools/include \ + libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes && + make && + make install + } || return 1 + + # Link compiler to this new glibc. + SPECS=`dirname $($BUILD_HOST-gcc -print-libgcc-file-name)`/specs + $BUILD_HOST-gcc -dumpspecs | sed \ + -e 's@/lib\(64\)\?/ld@/tools&@g' \ + -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS + unset SPECS +} # Rules to configure and make the package. -# -# Build order: glibc, glibc-base, glibc-locale, glibc-dev. -# compile_rules() { - mkdir glibc-build - cd glibc-build + # Some patch are needed to make things work correctly. + # Following patches and sed fixes comes from LFS development book : + # http://www.linuxfromscratch.org/lfs/view/development/chapter06/glibc.html + cd $src + DL=$(readelf -l /bin/sh | sed -n 's@.*interpret.*/tools\(.*\)]$@\1@p') + sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$DL -o|" \ + scripts/test-installation.pl + unset DL + sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in + + # Fix a bug that prevents Glibc from building with GCC-4.5.2: + patch -Np1 -i ../stuff/glibc-2.12.2-gcc_fix-1.patch + + mkdir ../glibc-build + cd ../glibc-build + # Install in the build tree and then move all files # to the source tree to keep $src and $_pkg for genpkg. - mkdir -p ../$PACKAGE-$VERSION/_pkg/etc - touch ../$PACKAGE-$VERSION/_pkg/etc/ld.so.conf - #echo "CFLAGS += -march=i486 -mtune=native -O3 -pipe" > configparms - ../$PACKAGE-$VERSION/configure \ - --prefix=/usr \ - --infodir=/usr/share/info \ + mkdir -p $WOK/$PACKAGE/install/etc + touch $WOK/$PACKAGE/install/etc/ld.so.conf + echo "CFLAGS += $CFLAGS" > configparms + { $src/configure \ --disable-profile \ --enable-add-ons \ - --enable-kernel=2.6.18 \ - --libexecdir=/usr/lib/glibc \ - $CONFIGURE_ARGS && - make -j 4 && - make install_root=$(cd ../$PACKAGE-$VERSION ; pwd)/_pkg install + --enable-kernel=2.6.22.5 \ + --libexecdir=/usr/lib/glibc && + make && + make install_root=$DESTDIR install + } || return 1 + + # If temporary toolchain was previously used, switch to + # regular toolchain. + [ -d /tools ] || return + mv /tools/bin/ld /tools/bin/ld-old + mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old + mv /tools/bin/ld-new /tools/bin/ld + ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld + gcc -dumpspecs | sed -e 's@/tools@@g' \ + -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \ + -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \ + `dirname $(gcc --print-libgcc-file-name)`/specs } # Rules to gen a SliTaz package suitable for Tazpkg. @@ -41,10 +98,7 @@ { LOCALE="" mkdir -p $fs/var - for i in $(grep -l '^WANTED="glibc"' $WOK/*/receipt); do - tazwok genpkg $(basename $(dirname $i)) - done - echo "" - echo "--> Install glibc-base, glibc-dev and cook busybox" - echo "" + + # Remove build directory. + rm -r $WOK/$PACKAGE/$PACKAGE-build } diff -r 85505c8dd53a -r c906b3acf847 glibc/stuff/glibc-2.12.2-gcc_fix-1.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glibc/stuff/glibc-2.12.2-gcc_fix-1.patch Thu Jan 27 00:20:50 2011 +0100 @@ -0,0 +1,49 @@ +Submitted By: Matt Burgess +Date: 2010-04-18 +Initial Package Version: 2.11.1 +Upstream Status: Not Submitted +Origin: http://www.eglibc.org/archives/patches/msg00073.html +Description: Fixes the following build problem with GCC-4.5.0: + +/mnt/lfs/sources/libc-build/math/s_frexp.os.dt -MT /mnt/lfs/sources/libc-build/math/s_frexp.os +./sysdeps/i386/fpu/s_frexp.S: Assembler messages: +./sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef" +./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' +./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' +./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' +./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `.' +./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' +./sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `' in .size directive +./sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if" +./sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after expression +make[2]: *** [/mnt/lfs/sources/libc-build/math/s_frexp.os] Error 1 + +diff -Naur glibc-2.11.1.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c +--- glibc-2.11.1.orig/nptl/sysdeps/pthread/pt-initfini.c 2009-12-08 20:10:20.000000000 +0000 ++++ glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c 2010-04-17 11:34:06.882681001 +0000 +@@ -45,6 +45,11 @@ + /* Embed an #include to pull in the alignment and .end directives. */ + asm ("\n#include \"defs.h\""); + ++asm ("\n#if defined __i686 && defined __ASSEMBLER__"); ++asm ("\n#undef __i686"); ++asm ("\n#define __i686 __i686"); ++asm ("\n#endif"); ++ + /* The initial common code ends here. */ + asm ("\n/*@HEADER_ENDS*/"); + +diff -Naur glibc-2.11.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h +--- glibc-2.11.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-12-08 20:10:20.000000000 +0000 ++++ glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-04-17 11:34:06.882681001 +0000 +@@ -29,6 +29,10 @@ + #include + #include + ++#if defined __i686 && defined __ASSEMBLER__ ++#undef __i686 ++#define __i686 __i686 ++#endif + + /* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h