wok-next annotate glibc/receipt @ rev 20439
glibc: try to fix it again
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Feb 22 16:14:21 2018 +0200 (2018-02-22) |
parents | 2b85adc52ed3 |
children | 6c73b944e8dd |
rev | line source |
---|---|
al@19743 | 1 # SliTaz package receipt v2. |
pankso@9 | 2 |
pankso@9 | 3 PACKAGE="glibc" |
al@20436 | 4 VERSION="2.26" |
pankso@3475 | 5 CATEGORY="meta" |
al@19743 | 6 SHORT_DESC="The GNU C libraries" |
pankso@9 | 7 MAINTAINER="pankso@slitaz.org" |
pascal@15000 | 8 LICENSE="GPL2" |
al@19561 | 9 WEB_SITE="http://www.gnu.org/software/libc/" |
al@20436 | 10 LFS="http://www.linuxfromscratch.org/lfs/view/stable/chapter06/glibc.html" |
al@19561 | 11 |
pankso@9 | 12 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pankso@9 | 13 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL" |
pankso@9713 | 14 |
al@20436 | 15 BUILD_DEPENDS="linux-api-headers autoconf bash gawk gettext bison texinfo" |
al@19743 | 16 # slitaz-i18n should present in wok |
al@19743 | 17 SPLIT="glibc-base glibc-locale nscd glibc-dev" |
al@19743 | 18 |
al@19743 | 19 # Locales include to glibc-base package by default, other locales are in: locale-** and glibc-locale |
al@19743 | 20 DEFAULT_LOCALE="en_US en_GB" |
al@19743 | 21 |
al@19743 | 22 # Handle multiarch compilation. |
al@19743 | 23 case "$ARCH" in |
al@20436 | 24 arm*) VERSION="2.13";; |
al@19743 | 25 esac |
al@19743 | 26 |
al@19743 | 27 # Handle multiarch installation. |
al@19743 | 28 case "$SLITAZ_ARCH" in |
al@20436 | 29 arm*) VERSION="2.13";; |
al@19743 | 30 esac |
al@19743 | 31 |
al@18922 | 32 |
gokhlayeh@8189 | 33 # Rules to compile & install the temporary toolchain. |
al@20436 | 34 cook_tmp_toolchain() { |
slaxemulator@10420 | 35 unset CFLAGS CXXFLAGS |
al@20436 | 36 case $ARCH in |
al@20436 | 37 i386) Arch='i486';; |
al@20436 | 38 x86_64) Arch='nocona';; |
al@20436 | 39 *) Arch="$ARCH";; |
al@20436 | 40 esac |
al@20436 | 41 echo "CFLAGS += -O2 -march=$Arch -mtune=$Arch" > configparms |
gokhlayeh@8189 | 42 |
al@20436 | 43 # Build in a separate directory. |
al@20436 | 44 mkdir build |
al@20436 | 45 cd build |
al@19561 | 46 |
al@20436 | 47 ../configure \ |
al@20436 | 48 --host=$HOST_SYSTEM \ |
al@20436 | 49 --build=$($src/scripts/config.guess) \ |
al@20436 | 50 --disable-profile \ |
al@20436 | 51 --enable-add-ons \ |
al@20436 | 52 --enable-kernel=3.2 \ |
al@20436 | 53 --with-headers=/tools/include \ |
al@20436 | 54 libc_cv_forced_unwind=yes \ |
al@20436 | 55 libc_cv_c_cleanup=yes && |
al@20436 | 56 make -j1 && |
al@20436 | 57 make install || return 1 |
gokhlayeh@8189 | 58 |
gokhlayeh@8189 | 59 # Link compiler to this new glibc. |
al@19577 | 60 SPECS=$(dirname $($HOST_SYSTEM-gcc -print-libgcc-file-name))/specs |
al@20436 | 61 $HOST_SYSTEM-gcc -dumpspecs \ |
al@20436 | 62 | sed \ |
gokhlayeh@8189 | 63 -e 's@/lib\(64\)\?/ld@/tools&@g' \ |
al@19577 | 64 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS |
gokhlayeh@8189 | 65 unset SPECS |
gokhlayeh@8189 | 66 } |
pankso@9 | 67 |
pankso@9 | 68 # Rules to configure and make the package. |
al@20436 | 69 compile_rules() { |
pankso@10031 | 70 # Glibc needs ld.so.conf in the install destdir. |
al@19743 | 71 mkdir -p $install/etc |
al@19743 | 72 touch $install/etc/ld.so.conf |
al@19561 | 73 |
al@19743 | 74 # Read the INSTALL file in glibc. Also Glibc don't build with -Os flag. |
pankso@10031 | 75 unset CFLAGS CXXFLAGS |
al@20436 | 76 case $ARCH in |
al@20439 | 77 i?86) Arch='i486'; ARCH_ARGS='-m32';; |
al@20439 | 78 x86_64) Arch='nocona'; ARCH_ARGS='-m64';; |
al@20439 | 79 *) Arch="$ARCH"; ARCH_ARGS='';; |
al@20436 | 80 esac |
al@20436 | 81 echo "CFLAGS += -O2 -march=$Arch -mtune=$Arch" > configparms |
al@19561 | 82 |
al@20436 | 83 # Remove a file that may be left over from a previous build attempt |
al@20436 | 84 rm -f /usr/include/limits.h 2>/dev/null |
al@20436 | 85 |
al@20436 | 86 mkdir build |
al@20436 | 87 cd build |
al@20436 | 88 # --enale-kernel: please respect Kernel version of the build host, |
al@20436 | 89 # put the exact or lower numbers. From Glibc INSTALL: |
al@20436 | 90 # > The higher the VERSION number is, the less compatibility code is |
al@20436 | 91 # > added, and the faster the code gets. |
al@20439 | 92 CC="gcc $ARCH_ARGS -isystem /usr/lib/gcc/$BUILD_SYSTEM/$(. $WOK/gcc/receipt; echo $VERSION)/include \ |
al@20436 | 93 -isystem /usr/include" \ |
al@20436 | 94 ../configure \ |
al@20436 | 95 --disable-werror \ |
al@20436 | 96 --enable-kernel=3.2 \ |
al@20436 | 97 --enable-stack-protector=strong \ |
al@20436 | 98 libc_cv_slibdir=/lib \ |
al@20438 | 99 $CONFIGURE_ARGS && |
al@20436 | 100 make -j1 && |
al@20436 | 101 touch $install/etc/ld.so.conf && |
al@20436 | 102 sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile && |
al@20436 | 103 make install_root=$install install || return 1 |
al@19561 | 104 |
al@19743 | 105 # nscd |
al@20436 | 106 cp ../nscd/nscd.conf $install/etc/nscd.conf |
al@20436 | 107 mkdir -p $install/var/cache/nscd $install/var/db |
al@20436 | 108 install -Dm755 $stuff/nscd $install/etc/init.d/nscd |
al@19743 | 109 |
al@19743 | 110 # nsswitch.conf |
al@19743 | 111 cp $stuff/nsswitch.conf $install/etc |
gokhlayeh@8189 | 112 |
al@20436 | 113 # ld.so.conf |
al@20436 | 114 install -Dm644 $stuff/ld.so.conf $install/etc/ld.so.conf |
al@20436 | 115 |
pankso@10031 | 116 # If temporary toolchain was previously used, switch to regular toolchain. |
al@19578 | 117 if [ -d /tools ]; then |
al@19577 | 118 mv /tools/bin/ld /tools/bin/ld-old |
al@19577 | 119 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old |
al@19577 | 120 mv /tools/bin/ld-new /tools/bin/ld |
al@19577 | 121 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld |
al@20436 | 122 gcc -dumpspecs \ |
al@20436 | 123 | sed -e 's@/tools@@g' \ |
al@19577 | 124 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \ |
al@19577 | 125 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \ |
al@19577 | 126 $(dirname $(gcc --print-libgcc-file-name))/specs |
al@19577 | 127 fi |
pankso@9 | 128 |
al@20436 | 129 # Create symlinks to the dynamic loader for LSB compliance. |
al@20436 | 130 case $ARCH in |
al@20436 | 131 i?86) |
al@20436 | 132 ln -sf ld-linux.so.2 $install/lib/ld-lsb.so.3 |
al@20436 | 133 ;; |
al@20436 | 134 x86_64) |
al@20436 | 135 mkdir -p $install/lib64 |
al@20436 | 136 ln -sf ../lib/ld-$VERSION.so $install/lib64/ld-linux-x86-64.so.2 |
al@20436 | 137 ln -sf ../lib/ld-$VERSION.so $install/lib64/ld-lsb-x86-64.so.3 |
al@20436 | 138 ;; |
al@20436 | 139 esac |
al@20436 | 140 |
al@20436 | 141 # Place the debugging symbols for selected libraries in separate files. |
al@20436 | 142 # This debugging information is needed if running regression tests that use valgrind or gdb. |
al@20436 | 143 # http://www.linuxfromscratch.org/lfs/view/stable/chapter06/strippingagain.html |
al@20436 | 144 |
al@20436 | 145 for i in ld-$VERSION.so libc-$VERSION.so libpthread-$VERSION.so libthread_db-1.0.so; do |
al@20436 | 146 cd $install/lib/ |
al@20436 | 147 objcopy --only-keep-debug $i $i.dbg |
al@20436 | 148 strip --strip-unneeded $i |
al@20436 | 149 objcopy --add-gnu-debuglink=$i.dbg $i |
al@19743 | 150 done |
al@19743 | 151 } |
al@19743 | 152 |
al@20436 | 153 genpkg_rules() { |
al@19743 | 154 case $PACKAGE in |
al@19743 | 155 glibc) |
al@19743 | 156 LOCALE="" |
al@19790 | 157 CAT="meta|meta-package" |
al@19790 | 158 DEPENDS="glibc-base glibc-locale glibc-dev" |
al@20436 | 159 TAGS="LFS" |
al@19743 | 160 ;; |
al@19743 | 161 glibc-base) |
al@19743 | 162 case "$ARCH" in |
al@19743 | 163 arm*) |
al@19743 | 164 # Eglibc is cross compiled by cross to have a toolchain so we can |
al@19743 | 165 # use these files instead of recooking it. ARM use Eglibc |
al@19743 | 166 echo "Using cross compiled Eglibc..." |
al@19743 | 167 install="/cross/$ARCH/sysroot" |
al@19743 | 168 copy libc_nonshared.a libpthread_nonshared.a |
al@19743 | 169 ;; |
al@19743 | 170 esac |
al@19743 | 171 copy \ |
al@19743 | 172 ld-*.so* ld.so* \ |
al@19743 | 173 libanl-*.so* libanl.so* \ |
al@19743 | 174 libc-*.so* libc.so* \ |
al@19743 | 175 libcrypt-*.so* libcrypt.so* \ |
al@19743 | 176 libdl-*.so* libdl.so* \ |
al@19743 | 177 libm-*.so* libm.so* \ |
al@19743 | 178 libnsl-*.so* libnsl.so* \ |
al@19743 | 179 libnss_compat-*.so* libnss_compat.so* \ |
al@19743 | 180 libnss_dns-*.so* libnss_dns.so* \ |
al@19743 | 181 libnss_files-*.so* libnss_files.so* \ |
al@19743 | 182 libpthread-*.so* libpthread.so* \ |
al@19743 | 183 libresolv-*.so* libresolv.so* \ |
al@19743 | 184 librt-*.so* librt.so* \ |
al@19743 | 185 libthread_db-*.so* libthread_db.so* \ |
al@19743 | 186 libutil-*.so* libutil.so* \ |
al@19743 | 187 \ |
al@19743 | 188 UNICODE.so gconv-modules ANSI_X3.110.so ISO8859-1.so \ |
al@19743 | 189 ISO8859-15.so UTF-16.so CP1252.so IBM437.so IBM850.so \ |
al@19743 | 190 \ |
al@19743 | 191 i18n iso14651_t1 iso14651_t1_common \ |
al@19743 | 192 translit_neutral translit_combining translit_circle \ |
al@19743 | 193 translit_cjk_compat translit_compat translit_font \ |
al@19743 | 194 translit_fraction translit_narrow translit_small \ |
al@19743 | 195 translit_wide \ |
al@19743 | 196 \ |
al@19743 | 197 locale localedef locale.alias UTF-8.gz UTC rpc \ |
al@19743 | 198 nsswitch.conf \ |
al@19743 | 199 $DEFAULT_LOCALE |
gokhlayeh@8189 | 200 |
al@20436 | 201 find $fs -type f -name '*.so.dbg' -delete |
al@20436 | 202 |
al@19743 | 203 CAT="base-system|minimal libraries and UTF-8 support for SliTaz" |
al@19790 | 204 DEPENDS=" " |
al@19743 | 205 ;; |
al@19743 | 206 glibc-locale) |
al@20436 | 207 copy gconv/ locale/ i18n/ iconv tzselect @rm # Remove glibc-base files |
al@19743 | 208 |
al@19743 | 209 # Remove files provided by locale-pack. |
al@19743 | 210 . $WOK/slitaz-i18n/stuff/locale-pack.conf |
al@19743 | 211 echo -n "Removing locale: " |
al@19743 | 212 for i in $LOCALE_PACK; do |
al@19743 | 213 echo -n "$i " |
al@19743 | 214 rm -rf $fs/usr/share/locale/$i |
al@19743 | 215 done |
al@19743 | 216 status |
al@19790 | 217 CAT="system-tools|misc. locale files and utilities" |
al@19743 | 218 DEPENDS="glibc-base" |
al@19743 | 219 ;; |
al@19743 | 220 nscd) |
al@20436 | 221 copy /var/db/ /var/cache/nscd/ nscd getent nscd.conf |
al@19743 | 222 CAT="base-system|name-server caching daemon" |
al@19790 | 223 DEPENDS=" " |
al@19743 | 224 ;; |
al@19743 | 225 glibc-dev) |
al@20436 | 226 copy @std @dev @rm |
al@19743 | 227 DEPENDS="glibc-base" |
al@19743 | 228 ;; |
al@19743 | 229 esac |
pankso@9 | 230 } |