wok-4.x view glibc/receipt @ rev 12466

New toolchain GCC 4.9.2, Glibc 2.19, Binutils 2.23.1
author Stanislas Leduc <shann@slitaz.org>
date Wed Nov 09 15:12:00 2022 +0000 (2022-11-09)
parents 1c7b5ef9b071
children bb72317ca464
line source
1 # SliTaz package receipt.
3 PACKAGE="glibc"
4 VERSION="2.19"
5 CATEGORY="meta"
6 SHORT_DESC="The GNU C libraries. This package is used to compile the libc."
7 MAINTAINER="pankso@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.gnu.org/software/libc/"
10 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
12 DEPENDS="glibc-base glibc-locale glibc-dev"
13 BUILD_DEPENDS="linux-api-headers autoconf bash advancecomp"
15 # Genpkg order for tazwok.
16 COOK_OPT="genpkg=glibc-base:glibc-extra-samba:glib-locale:glibc-dev"
18 # Rules to compile & install the temporary toolchain.
19 cook_tmp_toolchain()
20 {
21 cd $src
23 # Build in a separate directory.
24 mkdir ../glibc-build && cd ../glibc-build
26 # glibc no longer support i386, so use -march=i486 for better compatibility.
27 # If i686 ???
28 unset CFLAGS CXXFLAGS
29 case $ARCH in
30 i386|i486)
31 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
32 *)
33 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
34 esac
36 { $src/configure \
37 --host=$HOST_SYSTEM \
38 --build=$($src/scripts/config.guess) \
39 --disable-profile --enable-add-ons \
40 --enable-kernel=2.6.30 --with-headers=/tools/include \
41 libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes &&
42 make &&
43 make install
44 } || return 1
46 # Link compiler to this new glibc.
47 SPECS=`dirname $($HOST_SYSTEM-gcc -print-libgcc-file-name)`/specs
48 $HOST_SYSTEM-gcc -dumpspecs | sed \
49 -e 's@/lib\(64\)\?/ld@/tools&@g' \
50 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
51 unset SPECS
52 }
54 # Rules to configure and make the package.
55 compile_rules()
56 {
57 cd $src
59 # SliTaz is a Busybox based OS, why we so small and fast. Using gawk by
60 # default to build package will not ensure package work with Busybox awk
61 # and so should NOT be use to cook.
62 if [ -x /usr/bin/cook ]; then
63 [ -d "/var/lib/tazpkg/installed/gawk" ] || tazpkg get-install gawk
64 fi
66 # Fixes and patches from LFS, Redhat
67 sed -i -e 's/"db1"/& \&\& $name ne "nss_test1"/' scripts/test-installation.pl
68 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
70 # Glibc misc Bug Fixes
71 # fix for {linux,sys}/xattr.h incompatibility - commit fdbe8eae
72 patch -p1 -i $stuff/glibc-2.19-xattr_header.patch
74 # fix issues in sin/cos slow path calculation - commit ffe768a9
75 patch -p1 -i $stuff/glibc-2.19-fix-sign-in-bsloww1-input.patch
77 # fix tzselect with missing TZDIR - commit 893b4f37/c72399fb
78 patch -p1 -i $stuff/glibc-2.19-tzselect-default.patch
80 # Revert commit causing issues with crappy DNS servers
81 patch -Np1 -i $stuff/glibc-2.14-revert-4768ae77.patch
83 # Fix a stack imbalance that occurs under some conditions:
84 sed -i '195,213 s/PRIVATE_FUTEX/FUTEX_CLOCK_REALTIME/' \
85 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S \
86 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
88 # Glibc needs ld.so.conf in the install destdir.
89 mkdir -p $WOK/$PACKAGE/install/etc
90 touch $WOK/$PACKAGE/install/etc/ld.so.conf
91 mkdir ../glibc-build && cd ../glibc-build
93 # Read the INSTALL file in glibc. Also Glibc dont build with -Os flag.
94 # --enale-kernel use latest SliTaz Kernel version. From Glibc INSTALL:
95 # "The higher the VERSION number is, the less compatibility code is
96 # added, and the faster the code gets."
97 unset CFLAGS CXXFLAGS
98 case "$ARCH" in
99 i386|i486)
100 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
101 *)
102 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
103 esac
104 { $src/configure \
105 --disable-profile \
106 --enable-add-ons \
107 --enable-kernel=2.6.30 \
108 --enable-obsolete-rpc \
109 --libexecdir=/usr/lib/glibc \
110 --build=$HOST_SYSTEM \
111 --host=$HOST_SYSTEM &&
112 make && make install_root=$DESTDIR install
113 } || return 1
115 # If temporary toolchain was previously used, switch to regular toolchain.
116 [ -d /tools ] || return
117 mv /tools/bin/ld /tools/bin/ld-old
118 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
119 mv /tools/bin/ld-new /tools/bin/ld
120 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
121 gcc -dumpspecs | sed -e 's@/tools@@g' \
122 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
123 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
124 `dirname $(gcc --print-libgcc-file-name)`/specs
125 }
127 # Rules to gen a SliTaz package suitable for Tazpkg.
128 genpkg_rules()
129 {
130 LOCALE=""
131 mkdir -p $fs/var
133 # Remove build directory.
134 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
135 rm -rf $WOK/$PACKAGE/$PACKAGE-build
136 }