wok-4.x view glibc/receipt @ rev 12477
Up openssl 1.1.1n (bump packages curl, git, wget, python), up cherokee 1.2.104 and bdeps (automake, openldap, cyrus-sasl)
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Sun Apr 02 14:34:44 2023 +0000 (22 months ago) |
parents | d97d1f60fc46 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="glibc"
4 VERSION="2.22"
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 # Apply glibc patches CVE
19 apply_cve_patchs()
20 {
21 while read file; do
22 [ -f done.$file ] && continue
23 echo "Apply $file..."
24 patch -p1 < $stuff/patches/$PACKAGE-$VERSION-CVE-$file || return 1
25 touch done.$file
26 done <<EOT
27 2014-9761.patch
28 2015-5180.patch
29 2015-7547-getaddrinfo-stack-based-buffer-overflow.patch
30 2015-8776.patch
31 2015-8777.patch
32 2015-8778.patch
33 2015-8779.patch
34 2016-1234.patch
35 2016-3075.patch
36 2016-3706.patch
37 2016-4429.patch
38 2016-5417.patch
39 2016-6323.patch
40 2017-1000366.patch
41 2017-12133.patch
42 2017-15670.patch
43 2017-15671.patch
44 2017-15804.patch
45 2017-16997.patch
46 2017-18269.patch
47 2018-1000001.patch
48 2018-11236.patch
49 2018-6485.patch
50 EOT
51 }
53 # Rules to compile & install the temporary toolchain.
54 cook_tmp_toolchain()
55 {
56 cd $src
58 # Build in a separate directory.
59 mkdir ../glibc-build && cd ../glibc-build
61 # glibc no longer support i386, so use -march=i486 for better compatibility.
62 # If i686 ???
63 unset CFLAGS CXXFLAGS
64 case $ARCH in
65 i386|i486)
66 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
67 *)
68 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
69 esac
71 { $src/configure \
72 --host=$HOST_SYSTEM \
73 --build=$($src/scripts/config.guess) \
74 --disable-profile --enable-add-ons \
75 --enable-kernel=2.6.30 --with-headers=/tools/include \
76 libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes &&
77 make &&
78 make install
79 } || return 1
81 # Link compiler to this new glibc.
82 SPECS=`dirname $($HOST_SYSTEM-gcc -print-libgcc-file-name)`/specs
83 $HOST_SYSTEM-gcc -dumpspecs | sed \
84 -e 's@/lib\(64\)\?/ld@/tools&@g' \
85 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
86 unset SPECS
87 }
89 # Rules to configure and make the package.
90 compile_rules()
91 {
92 cd $src
94 apply_cve_patchs
96 # SliTaz is a Busybox based OS, why we so small and fast. Using gawk by
97 # default to build package will not ensure package work with Busybox awk
98 # and so should NOT be use to cook.
99 if [ -x /usr/bin/cook ]; then
100 [ -d "/var/lib/tazpkg/installed/gawk" ] || tazpkg get-install gawk
101 fi
103 # Fixes and patches from LFS, Redhat
104 sed -i -e 's/"db1"/& \&\& $name ne "nss_test1"/' scripts/test-installation.pl
105 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
107 # Glibc misc Bug Fixes
108 # fix for {linux,sys}/xattr.h incompatibility - commit fdbe8eae
109 #patch -p1 -i $stuff/glibc-2.19-xattr_header.patch
111 # fix issues in sin/cos slow path calculation - commit ffe768a9
112 #patch -p1 -i $stuff/glibc-2.19-fix-sign-in-bsloww1-input.patch
114 # fix tzselect with missing TZDIR - commit 893b4f37/c72399fb
115 #patch -p1 -i $stuff/glibc-2.19-tzselect-default.patch
117 # Revert commit causing issues with crappy DNS servers
118 #patch -Np1 -i $stuff/glibc-2.14-revert-4768ae77.patch
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 --enable-obsolete-rpc \
146 --libexecdir=/usr/lib/glibc \
147 --build=$HOST_SYSTEM \
148 --host=$HOST_SYSTEM &&
149 make && make install_root=$DESTDIR install
150 } || return 1
152 # If temporary toolchain was previously used, switch to regular toolchain.
153 [ -d /tools ] || return
154 mv /tools/bin/ld /tools/bin/ld-old
155 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
156 mv /tools/bin/ld-new /tools/bin/ld
157 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
158 gcc -dumpspecs | sed -e 's@/tools@@g' \
159 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
160 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
161 `dirname $(gcc --print-libgcc-file-name)`/specs
162 }
164 # Rules to gen a SliTaz package suitable for Tazpkg.
165 genpkg_rules()
166 {
167 LOCALE=""
168 mkdir -p $fs/var
170 # Remove build directory.
171 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
172 rm -rf $WOK/$PACKAGE/$PACKAGE-build
173 }