wok-6.x view glibc/receipt @ rev 25563

New toolchain GCC 4.9.2, Glibc 2.19, Binutils 2.37
author Stanislas Leduc <shann@slitaz.org>
date Fri May 05 18:12:18 2023 +0200 (12 months ago)
parents 324b3fa82b76
children 3e8af413f00c
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 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.gnu.org/software/libc/"
11 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
13 DEPENDS="glibc-base glibc-locale glibc-dev"
14 BUILD_DEPENDS="linux-api-headers autoconf bash advancecomp"
16 # Genpkg order for tazwok.
17 COOK_OPT="genpkg=glibc-base:glib-locale:glibc-dev"
19 current_version()
20 {
21 wget -O - $(dirname $WGET_URL) 2>/dev/null | \
22 sed '/href="glibc-[0-9]/!d;/tar/!d;s|.*>glibc-||;s|.tar.*||' | \
23 sort -Vr | sed q
24 }
26 # Rules to compile & install the temporary toolchain.
27 cook_tmp_toolchain()
28 {
29 cd $src
31 # Glibc Bug Fixes Patch from LFS
32 patch -Np1 -i $stuff/glibc-2.14.1-fixes-1.patch
33 # Glibc Bug Sort Relocatable Objects Patch
34 patch -Np1 -i $stuff/glibc-2.14.1-sort-1.patch
35 # Fix a bug that prevents Glibc from building with GCC-4.6.2
36 patch -Np1 -i $stuff/glibc-2.14.1-gcc_fix-1.patch
37 # GHOST
38 patch -Np1 -i $stuff/glibc-2.14.1-CVE-2015-0235.patch
40 # Build in a separate directory.
41 mkdir ../glibc-build && cd ../glibc-build
43 # glibc no longer support i386, so use -march=i486 for better compatibility.
44 # If i686 ???
45 unset CFLAGS CXXFLAGS
46 case $ARCH in
47 i386|i486)
48 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
49 *)
50 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
51 esac
53 { $src/configure \
54 --host=$HOST_SYSTEM \
55 --build=$($src/scripts/config.guess) \
56 --disable-profile --enable-add-ons \
57 --enable-kernel=2.6.30 --with-headers=/tools/include \
58 libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes &&
59 make -j1 &&
60 make -j1 install
61 } || return 1
63 # Link compiler to this new glibc.
64 SPECS=`dirname $($HOST_SYSTEM-gcc -print-libgcc-file-name)`/specs
65 $HOST_SYSTEM-gcc -dumpspecs | sed \
66 -e 's@/lib\(64\)\?/ld@/tools&@g' \
67 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
68 unset SPECS
69 }
71 # Rules to configure and make the package.
72 compile_rules()
73 {
74 # SliTaz is a Busybox based OS, why we so small and fast. Using gawk by
75 # default to build package will not ensure package work with Busybox awk
76 # and so should NOT be use to cook.
77 if [ -x /usr/bin/cook ]; then
78 [ -d "/var/lib/tazpkg/installed/gawk" ] || tazpkg get-install gawk
79 fi
81 # Make 4.x support...
82 sed -i 's/3\.79/4.* | &/' configure*
83 # Fixes and patches from LFS, Redhat
84 sed -i -e 's/"db1"/& \&\& $name ne "nss_test1"/' scripts/test-installation.pl
85 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
87 # Glibc misc Bug Fixes
88 # fix for {linux,sys}/xattr.h incompatibility - commit fdbe8eae
89 patch -p1 -i $stuff/glibc-2.19-xattr_header.patch
91 # fix issues in sin/cos slow path calculation - commit ffe768a9
92 patch -p1 -i $stuff/glibc-2.19-fix-sign-in-bsloww1-input.patch
94 # fix tzselect with missing TZDIR - commit 893b4f37/c72399fb
95 patch -p1 -i $stuff/glibc-2.19-tzselect-default.patch
97 # Glibc misc Bug Fixes
98 #patch -Np1 -i $stuff/glibc-2.14.1-fixes-1.patch
100 # Glibc Bug Sort Relocatable Objects Patch
101 #patch -Np1 -i $stuff/glibc-2.14.1-sort-1.patch
103 # Fix a bug that prevents Glibc from building with GCC-4.6.2
104 #patch -Np1 -i $stuff/glibc-2.14.1-gcc_fix-1.patch
106 # Revert commit causing issues with crappy DNS servers
107 patch -Np1 -i $stuff/glibc-2.14-revert-4768ae77.patch
109 # re-export RPC interface until libtirpc is ready as a replacement
110 # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=acee4873 (only fedora branch...)
111 #patch -Np1 -i $stuff/glibc-2.14-reexport-rpc-interface.patch
112 # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=bdd816a3 (only fedora branch...)
113 #patch -Np1 -i $stuff/glibc-2.14-reinstall-nis-rpc-headers.patch
114 # GHOST
115 #patch -Np1 -i $stuff/glibc-2.14.1-CVE-2015-0235.patch
117 # Update for binutils 2.29, see https://sourceware.org/bugzilla/show_bug.cgi?id=21661
118 sed -i 's|obstack_compat;|obstack_compat __attribute__ ((nocommon));|' malloc/obstack.c
120 # Fix a stack imbalance that occurs under some conditions:
121 #sed -i '195,213 s/PRIVATE_FUTEX/FUTEX_CLOCK_REALTIME/' \
122 # nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S \
123 # nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
125 # Glibc needs ld.so.conf in the install destdir.
126 mkdir -p $WOK/$PACKAGE/install/etc
127 touch $WOK/$PACKAGE/install/etc/ld.so.conf
128 mkdir ../glibc-build && cd ../glibc-build
130 # Read the INSTALL file in glibc. Also Glibc dont build with -Os flag.
131 # --enale-kernel use latest SliTaz Kernel version. From Glibc INSTALL:
132 # "The higher the VERSION number is, the less compatibility code is
133 # added, and the faster the code gets."
134 unset CFLAGS CXXFLAGS
135 case "$ARCH" in
136 i386|i486)
137 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
138 *)
139 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
140 esac
141 { $src/configure \
142 --disable-profile \
143 --enable-add-ons \
144 --enable-kernel=2.6.30 \
145 --libexecdir=/usr/lib/glibc \
146 --build=$HOST_SYSTEM \
147 --host=$HOST_SYSTEM \
148 --target=$BUILD_SYSTEM &&
149 make -j1 && make install_root=$DESTDIR install
150 } || return 1
151 for i in $DESTDIR/usr/share/i18n/charmaps/*.gz ; do
152 advdef -z4 $i
153 done
155 # If temporary toolchain was previously used, switch to regular toolchain.
156 [ -d /tools ] || return
157 mv /tools/bin/ld /tools/bin/ld-old
158 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
159 mv /tools/bin/ld-new /tools/bin/ld
160 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
161 gcc -dumpspecs | sed -e 's@/tools@@g' \
162 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
163 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
164 `dirname $(gcc --print-libgcc-file-name)`/specs
165 }
167 # Rules to gen a SliTaz package suitable for Tazpkg.
168 genpkg_rules()
169 {
170 LOCALE=""
171 mkdir -p $fs/var
173 # Remove build directory.
174 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
175 rm -rf $WOK/$PACKAGE/$PACKAGE-build
177 # check install
178 ls $install/lib/
179 }