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