wok-current view glibc/receipt @ rev 25598
Use default gcc 6.3 for libgtop
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Fri Sep 01 07:31:59 2023 +0000 (14 months ago) |
parents | 35db2ca0cb06 |
children | a23978bfa665 |
line source
1 # SliTaz package receipt.
3 PACKAGE="glibc"
4 VERSION="2.21"
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 # Update for binutils 2.29, see https://sourceware.org/bugzilla/show_bug.cgi?id=21661
127 sed -i 's|obstack_compat;|obstack_compat __attribute__ ((nocommon));|' malloc/obstack.c
129 # Fix unused const variable
130 sed -i 's|static const float one=1.0;|static const float __attribute__ ((unused)) one=1.0;|' \
131 sysdeps/ieee754/flt-32/s_cosf.c
132 sed -i 's|static const char rcsid\[\] =|static const char __attribute__ ((unused)) rcsid\[\] =|' \
133 resolv/base64.c
135 # Fix a stack imbalance that occurs under some conditions:
136 #sed -i '195,213 s/PRIVATE_FUTEX/FUTEX_CLOCK_REALTIME/' \
137 # nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S \
138 # nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
140 # Glibc needs ld.so.conf in the install destdir.
141 mkdir -p $WOK/$PACKAGE/install/etc
142 touch $WOK/$PACKAGE/install/etc/ld.so.conf
143 mkdir ../glibc-build && cd ../glibc-build
145 # Read the INSTALL file in glibc. Also Glibc dont build with -Os flag.
146 # --enale-kernel use latest SliTaz Kernel version. From Glibc INSTALL:
147 # "The higher the VERSION number is, the less compatibility code is
148 # added, and the faster the code gets."
149 unset CFLAGS CXXFLAGS
150 case "$ARCH" in
151 i386|i486)
152 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
153 *)
154 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
155 esac
156 { $src/configure \
157 --disable-profile \
158 --enable-add-ons \
159 --enable-kernel=2.6.30 \
160 --enable-obsolete-rpc \
161 --libexecdir=/usr/lib/glibc \
162 --build=$HOST_SYSTEM \
163 --host=$HOST_SYSTEM \
164 --target=$BUILD_SYSTEM &&
165 make -j1 && make install_root=$DESTDIR install
166 } || return 1
167 for i in $DESTDIR/usr/share/i18n/charmaps/*.gz ; do
168 advdef -z4 $i
169 done
171 # If temporary toolchain was previously used, switch to regular toolchain.
172 [ -d /tools ] || return
173 mv /tools/bin/ld /tools/bin/ld-old
174 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
175 mv /tools/bin/ld-new /tools/bin/ld
176 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
177 gcc -dumpspecs | sed -e 's@/tools@@g' \
178 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
179 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
180 `dirname $(gcc --print-libgcc-file-name)`/specs
181 }
183 # Rules to gen a SliTaz package suitable for Tazpkg.
184 genpkg_rules()
185 {
186 LOCALE=""
187 mkdir -p $fs/var
189 # Remove build directory.
190 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
191 rm -rf $WOK/$PACKAGE/$PACKAGE-build
193 # check install
194 ls $install/lib/
195 }