lib32/lib32-glibc/PKGBUILD

262 lines
10 KiB
Bash
Raw Normal View History

# Lib32 Packages for Chakra, part of chakra-project.org
#
2012-04-22 05:37:11 +08:00
# maintainer: Giuseppe Calà <jiveaxe@gmail.com>
# maintainer: Anke Boersma <abveritas[at]chakra-project[dot]org>
# maintainer: Manuel Tortosa <manutortoas<61>@chakra-project.org>
2012-04-22 05:37:11 +08:00
# toolchain build order:
# lib32-glibc > binutils-multilib > gcc-multilib > binutils-multilib > lib32-glibc
2011-10-09 03:13:49 +08:00
_pkgname=glibc
pkgname=lib32-$_pkgname
2012-04-22 05:37:11 +08:00
pkgver=2.15
2011-10-09 02:35:19 +08:00
pkgrel=1
2012-04-22 05:37:11 +08:00
_glibcdate=20120419
pkgdesc="GNU C Library for multilib"
arch=('x86_64')
url="http://www.gnu.org/software/libc"
license=('GPL' 'LGPL')
depends=("glibc>=$pkgver")
2011-10-09 02:35:19 +08:00
#makedepends=('gcc-multilib>=4.6')
makedepends=('gcc-multilib')
options=('!strip' '!emptydirs')
source=(http://chakra.sourceforge.net/sources/${_pkgname}/${_pkgname}-${pkgver}_${_glibcdate}.tar.xz
2012-04-22 05:37:11 +08:00
glibc-2.15-do-not-install-timezone-files.patch
glibc-2.15-do-not-install-timezone-files-2.patch
glibc-__i686.patch
2011-10-09 02:35:19 +08:00
glibc-2.12.2-ignore-origin-of-privileged-program.patch
glibc-2.14-libdl-crash.patch
glibc-2.14-reexport-rpc-interface.patch
glibc-2.14-reinstall-nis-rpc-headers.patch
2012-04-22 05:37:11 +08:00
glibc-2.15-fix-res_query-assert.patch
glibc-2.15-lddebug-scopes.patch
glibc-2.15-revert-c5a0802a.patch
glibc-2.15-scanf.patch
glibc-2.15-ifunc.patch
glibc-2.15-avx.patch
glibc-2.15-strcasecmp-disable-avx.patch
glibc-2.15-gb18030.patch
glibc-2.15-revert-netlink-cache.patch
glibc-2.15-arena.patch
glibc-2.15-negative-result-cache.patch
glibc-2.15-multiarch-x86-strcmp.patch
glibc-2.15-vdso.patch
glibc-2.15-feraiseexcept-plt.patch
glibc-2.15-vfprintf-nargs.patch
glibc-2.15-__libc_res_nquerydomain-out-of-bounds.patch
glibc-2.15-fmtmsg-locking.patch
glibc-2.15-non-signalling-comparisons.patch
glibc-2.15-rintf-rounding.patch
glibc-2.15-nearbyintf-rounding.patch
glibc-2.15-confstr-local-buffer-extent.patch
lib32-glibc.conf)
2012-04-22 05:37:11 +08:00
md5sums=('c0487f4e83db1b9b30d7989fc47dbead'
'349227bcedb19cea008fbcb2c7e1a582'
'880439de2c608177ed1d749722d26820'
'40cd342e21f71f5e49e32622b25acc52'
2011-10-09 02:35:19 +08:00
'b042647ea7d6f22ad319e12e796bd13e'
2012-04-22 05:37:11 +08:00
'6970bcfeb3bf88913436d5112d16f588'
2011-10-09 02:35:19 +08:00
'c5de2a946215d647c8af5432ec4b0da0'
'55febbb72139ac7b65757df085024b83'
2012-04-22 05:37:11 +08:00
'684073467137906fb9411f4c7f00db10'
'207483814b5034d9841ad090c75bedf4'
'62288103a28f5f779da4ee64621d81d1'
'34baaa90a8fcd500adfbe8c609ed81f1'
'66898e99bf9279db25f1d9b058116c2e'
'92e797af8fb7d24c856916e04c382e6c'
'fccb89f6628f59752278e125c35941f8'
'5022c0c96c770fdaf5225aa44297f13c'
'f65fa79b4bd2b5e7ed5563a3d1beadd3'
'3eae060bc0eac2a85c07956d2b799f15'
'a55eadc2ed4ce869a1e193f0bfb72444'
'a0219bb48baf56b3085c118b6db2c1a6'
'3d9ca85e0e8507830b3fb67cdee0c04b'
'3168364ac51cc7ad479eb6390a5897ff'
'de9399a35a9c14f793c66f1230674d67'
'9ea0f925e508b58042f9c1f83871be6a'
'56e51cd17aa23af99cba46dfadedde38'
'f59bd7c9dd6330bfacb3334b09ef73db'
'104300a586580bb340bb70162a196c80'
'50dc7006874cbd86ee436044752f5228'
'4ed0bb09c3851cd9cb5e39c946a8a334'
'6e052f1cb693d5d3203f50f9d4e8c33b')
build() {
cd ${srcdir}/glibc
# timezone data is in separate package (tzdata)
2012-04-22 05:37:11 +08:00
# http://sourceware.org/git/?p=glibc.git;a=commit;h=482ff4da
patch -p1 -i ${srcdir}/glibc-2.15-do-not-install-timezone-files.patch
# http://sourceware.org/git/?p=glibc.git;a=commit;h=a458e7fe
patch -p1 -i ${srcdir}/glibc-2.15-do-not-install-timezone-files-2.patch
2012-04-22 05:37:11 +08:00
# undefine __i686
# http://sourceware.org/glibc/wiki/Release/2.15#Build_Failures
patch -p1 -i ${srcdir}/glibc-__i686.patch
# http://www.exploit-db.com/exploits/15274/
2012-04-22 05:37:11 +08:00
# http://sourceware.org/git/?p=glibc.git;a=patch;h=d14e6b09 (fedora branch)
patch -p1 -i ${srcdir}/glibc-2.12.2-ignore-origin-of-privileged-program.patch
2011-10-09 02:35:19 +08:00
2012-04-22 05:37:11 +08:00
# http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=675155e9 (fedora branch)
2011-10-09 02:35:19 +08:00
# http://sourceware.org/ml/libc-alpha/2011-06/msg00006.html
2012-04-22 05:37:11 +08:00
patch -p1 -i ${srcdir}/glibc-2.14-libdl-crash.patch
2011-10-09 02:35:19 +08:00
# re-export RPC interface until libtirpc is ready as a replacement
2012-04-22 05:37:11 +08:00
# http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=acee4873 (fedora branch)
patch -p1 -i ${srcdir}/glibc-2.14-reexport-rpc-interface.patch
# http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=bdd816a3 (fedora branch)
patch -p1 -i ${srcdir}/glibc-2.14-reinstall-nis-rpc-headers.patch
# fix res_query assertion
# http://sourceware.org/bugzilla/show_bug.cgi?id=13013
patch -p1 -i ${srcdir}/glibc-2.15-fix-res_query-assert.patch
# propriety nvidia crash - https://bugzilla.redhat.com/show_bug.cgi?id=737223
# http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=0c95ab64 (fedora branch)
patch -p1 -i ${srcdir}/glibc-2.15-lddebug-scopes.patch
# revert commit c5a0802a - causes various hangs
# https://bugzilla.redhat.com/show_bug.cgi?id=769421
# Note: fedora may have actual fix (not submitted upstream yet...)
# http://pkgs.fedoraproject.org/gitweb/?p=glibc.git;a=blob_plain;f=glibc-rh552960-2.patch
patch -p1 -i ${srcdir}/glibc-2.15-revert-c5a0802a.patch
# fix realloc usage in vfscanf
# http://sourceware.org/git/?p=glibc.git;a=commit;h=20b38e03
patch -p1 -i ${srcdir}/glibc-2.15-scanf.patch
# fix ifunc relocations
# http://sourceware.org/git/?p=glibc.git;a=commit;h=6ee65ed6
patch -p1 -i ${srcdir}/glibc-2.15-ifunc.patch
# fix AVX detection
# http://sourceware.org/git/?p=glibc.git;a=commit;h=afc5ed09
# http://sourceware.org/git/?p=glibc.git;a=commit;h=08cf777f
patch -p1 -i ${srcdir}/glibc-2.15-avx.patch
# and "fix" strcasecmp
patch -p1 -i ${srcdir}/glibc-2.15-strcasecmp-disable-avx.patch
# fix GB18030 charmap
# http://sourceware.org/bugzilla/show_bug.cgi?id=11837
# http://sourceware.org/git/?p=glibc.git;a=commit;h=2a57bd79 (fedora branch)
# http://sourceware.org/git/?p=glibc.git;a=commit;h=3d828a61 (fedora branch)
patch -p1 -i ${srcdir}/glibc-2.15-gb18030.patch
# fix crash in __nscd_get_mapping if nscd not running
# http://sourceware.org/bugzilla/show_bug.cgi?id=13594 (potential "fix" in comment)
# reverts commit 3a2c0242 and other necessary following changes...
patch -p1 -i ${srcdir}/glibc-2.15-revert-netlink-cache.patch
# handle ARENA_TEST correctly
# http://sourceware.org/git/?p=glibc.git;a=commit;h=41b81892
patch -p1 -i ${srcdir}/glibc-2.15-arena.patch
# Do not cache negative results in nscd if these are transient
# http://sourceware.org/git/?p=glibc.git;a=commit;h=3e1aa84e
patch -p1 -i ${srcdir}/glibc-2.15-negative-result-cache.patch
# strcasecmp_l, strncasecmp_l act as strcmp for multiarch x86
# http://sourceware.org/git/?p=glibc.git;a=commit;h=0bab47b6
patch -p1 -i ${srcdir}/glibc-2.15-multiarch-x86-strcmp.patch
# always set l_used for vDSO.
# http://sourceware.org/git/?p=glibc.git;a=commit;h=1f393a11
patch -p1 -i ${srcdir}/glibc-2.15-vdso.patch
# fix x86 PLT slot usage for feraiseexcept
# http://sourceware.org/git/?p=glibc.git;a=commit;h=7c35ffed
patch -p1 -i ${srcdir}/glibc-2.15-feraiseexcept-plt.patch
# vfprintf nargs overflow - CVE-2012-0864
# http://sourceware.org/git/?p=glibc.git;a=commit;h=7c1f4834
patch -p1 -i ${srcdir}/glibc-2.15-vfprintf-nargs.patch
# avoid out ouf bounds read in __libc_res_nquerydomain
# http://sourceware.org/git/?p=glibc.git;a=commit;h=8fdceb2e
patch -p1 -i ${srcdir}/glibc-2.15-__libc_res_nquerydomain-out-of-bounds.patch
# make fmtmsg function thread-safe
# http://sourceware.org/git/?p=glibc.git;a=commit;h=7724defc
patch -p1 -i ${srcdir}/glibc-2.15-fmtmsg-locking.patch
# use non-signaling floating-point comparisons in math functions
# http://sourceware.org/git/?p=glibc.git;a=commit;h=92221550
patch -p1 -i ${srcdir}/glibc-2.15-non-signalling-comparisons.patch
# fix rintf rounding.
# http://sourceware.org/git/?p=glibc.git;a=commit;h=fe45ce09
patch -p1 -i ${srcdir}/glibc-2.15-rintf-rounding.patch
# fix nearbyintf rounding
# http://sourceware.org/git/?p=glibc.git;a=commit;h=6cbeae47
patch -p1 -i ${srcdir}/glibc-2.15-nearbyintf-rounding.patch
# fix varaible scope issue in confstr
# http://sourceware.org/git/?p=glibc.git;a=commit;h=ac4c54f0
# http://sourceware.org/git/?p=glibc.git;a=commit;h=d6a403f9
patch -p1 -i ${srcdir}/glibc-2.15-confstr-local-buffer-extent.patch
cd ${srcdir}
rm -vRf glibc-build
mkdir -p glibc-build
cd glibc-build
2011-10-09 02:35:19 +08:00
export CC="gcc -m32"
# Hack to fix NPTL issues with Xen, only required on 32bit platforms
export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs"
echo "slibdir=/usr/lib32" >> configparms
${srcdir}/glibc/configure --prefix=/usr \
--libdir=/usr/lib32 --libexecdir=/usr/lib32 \
--with-headers=/usr/include \
--enable-add-ons=nptl,libidn \
--enable-kernel=2.6.27 \
--with-tls --with-__thread \
--enable-bind-now --without-gd \
--without-cvs --disable-profile \
--enable-multi-arch i686-unknown-linux-gnu
2011-10-09 02:35:19 +08:00
make
}
check() {
cd ${srcdir}/glibc-build
# some errors are expected - manually check log files
make -k check || true
}
package() {
cd ${srcdir}/glibc-build
make install_root=${pkgdir} install
2012-04-22 05:37:11 +08:00
rm -rf ${pkgdir}/{etc,sbin,usr/{bin,sbin,share},var}
# We need one 32 bit specific header file
find ${pkgdir}/usr/include -type f -not -name stubs-32.h -delete
cd $pkgdir
strip $STRIP_BINARIES usr/lib32/getconf/*
2012-04-22 05:37:11 +08:00
strip $STRIP_STATIC usr/lib32/*.a
2012-04-22 05:37:11 +08:00
strip $STRIP_SHARED usr/lib32/{libanl,libBrokenLocale,libcidn,libcrypt}-${pkgver}.so \
usr/lib32/libnss_{compat,db,dns,files,hesiod,nis,nisplus}-${pkgver}.so \
usr/lib32/{libdl,libm,libnsl,libresolv,librt,libutil}-${pkgver}.so \
usr/lib32/{libmemusage,libpcprofile,libSegFault}.so \
2011-10-09 02:35:19 +08:00
usr/lib32/{pt_chown,{audit,gconv}/*.so}
# Dynamic linker
install -d -m755 ${pkgdir}/lib
ln -s ../usr/lib32/ld-linux.so.2 ${pkgdir}/lib/
# Add /usr/lib32 to the default library search path
install -Dm644 "$srcdir/lib32-glibc.conf" "$pkgdir/etc/ld.so.conf.d/lib32-glibc.conf"
# Symlink /usr/lib32/locale to /usr/lib/locale
ln -s ../lib/locale "$pkgdir/usr/lib32/locale"
}