wok-current view glibc/receipt @ rev 25629

Mass updates for current
author Stanislas Leduc <shann@slitaz.org>
date Wed Oct 11 18:45:46 2023 +0000 (11 months ago)
parents 22166ae1fc15
children 3ad63c8fc2f9
line source
1 # SliTaz package receipt.
3 PACKAGE="glibc"
4 VERSION="2.23"
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 # Fix a bug that prevents Glibc from building with GCC-6.3.0
88 # https://bugzilla.redhat.com/show_bug.cgi?id=1312963 (-Werror=parentheses)
89 # https://sourceware.org/pipermail/libc-alpha/2015-April/059886.html (array-bounds)
90 patch -p1 -i $stuff/glibc-2.21-gcc6_fix-1.patch
91 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68024 (patch for style-definition)
92 patch -p1 -i $stuff/glibc-2.21-gcc6_fix-2.patch
93 # https://gcc.gnu.org/legacy-ml/gcc-patches/2015-11/msg00105.html
94 patch -p1 -i $stuff/glibc-2.21-gcc6_fix-3.patch
96 # Glibc misc Bug Fixes
97 # fix for {linux,sys}/xattr.h incompatibility - commit fdbe8eae
98 #patch -p1 -i $stuff/glibc-2.19-xattr_header.patch
100 # fix issues in sin/cos slow path calculation - commit ffe768a9
101 #patch -p1 -i $stuff/glibc-2.19-fix-sign-in-bsloww1-input.patch
103 # fix tzselect with missing TZDIR - commit 893b4f37/c72399fb
104 #patch -p1 -i $stuff/glibc-2.19-tzselect-default.patch
106 # Glibc misc Bug Fixes
107 #patch -Np1 -i $stuff/glibc-2.14.1-fixes-1.patch
109 # Glibc Bug Sort Relocatable Objects Patch
110 #patch -Np1 -i $stuff/glibc-2.14.1-sort-1.patch
112 # Fix a bug that prevents Glibc from building with GCC-4.6.2
113 #patch -Np1 -i $stuff/glibc-2.14.1-gcc_fix-1.patch
115 # Revert commit causing issues with crappy DNS servers
116 #patch -Np1 -i $stuff/glibc-2.14-revert-4768ae77.patch
118 # re-export RPC interface until libtirpc is ready as a replacement
119 # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=acee4873 (only fedora branch...)
120 #patch -Np1 -i $stuff/glibc-2.14-reexport-rpc-interface.patch
121 # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=bdd816a3 (only fedora branch...)
122 #patch -Np1 -i $stuff/glibc-2.14-reinstall-nis-rpc-headers.patch
123 # GHOST
124 #patch -Np1 -i $stuff/glibc-2.14.1-CVE-2015-0235.patch
126 # https://sourceware.org/bugzilla/show_bug.cgi?id=21661
127 patch -p1 -i $stuff/glibc-2.23-gcc.patch
129 # Update for binutils 2.29, see https://sourceware.org/bugzilla/show_bug.cgi?id=21661
130 sed -i 's|obstack_compat;|obstack_compat __attribute__ ((nocommon));|' malloc/obstack.c
132 # Fix unused const variable
133 sed -i 's|static const float one=1.0;|static const float __attribute__ ((unused)) one=1.0;|' \
134 sysdeps/ieee754/flt-32/s_cosf.c
135 sed -i 's|static const char rcsid\[\] =|static const char __attribute__ ((unused)) rcsid\[\] =|' \
136 resolv/base64.c
138 # Fix a stack imbalance that occurs under some conditions:
139 #sed -i '195,213 s/PRIVATE_FUTEX/FUTEX_CLOCK_REALTIME/' \
140 # nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S \
141 # nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
143 # Glibc needs ld.so.conf in the install destdir.
144 mkdir -p $WOK/$PACKAGE/install/etc
145 touch $WOK/$PACKAGE/install/etc/ld.so.conf
146 mkdir ../glibc-build && cd ../glibc-build
148 # Read the INSTALL file in glibc. Also Glibc dont build with -Os flag.
149 # --enale-kernel use latest SliTaz Kernel version. From Glibc INSTALL:
150 # "The higher the VERSION number is, the less compatibility code is
151 # added, and the faster the code gets."
152 unset CFLAGS CXXFLAGS
153 case "$ARCH" in
154 i386|i486)
155 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
156 *)
157 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
158 esac
159 { $src/configure \
160 --disable-profile \
161 --enable-add-ons \
162 --enable-kernel=2.6.30 \
163 --enable-obsolete-rpc \
164 --libexecdir=/usr/lib/glibc \
165 --build=$HOST_SYSTEM \
166 --host=$HOST_SYSTEM \
167 --target=$BUILD_SYSTEM &&
168 make -j1 && make install_root=$DESTDIR install
169 } || return 1
170 for i in $DESTDIR/usr/share/i18n/charmaps/*.gz ; do
171 advdef -z4 $i
172 done
174 # If temporary toolchain was previously used, switch to regular toolchain.
175 [ -d /tools ] || return
176 mv /tools/bin/ld /tools/bin/ld-old
177 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
178 mv /tools/bin/ld-new /tools/bin/ld
179 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
180 gcc -dumpspecs | sed -e 's@/tools@@g' \
181 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
182 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
183 `dirname $(gcc --print-libgcc-file-name)`/specs
184 }
186 # Rules to gen a SliTaz package suitable for Tazpkg.
187 genpkg_rules()
188 {
189 LOCALE=""
190 mkdir -p $fs/var
192 # Remove build directory.
193 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
194 rm -rf $WOK/$PACKAGE/$PACKAGE-build
196 # check install
197 ls $install/lib/
198 }