2010-06-28 03:54:37 +08:00
|
|
|
#
|
2011-04-17 06:29:38 +08:00
|
|
|
# Core Packages for Chakra, part of chakra-project.org
|
2010-06-28 03:54:37 +08:00
|
|
|
#
|
2012-04-20 06:16:24 +08:00
|
|
|
# maintainer: Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
2010-09-09 03:53:22 +08:00
|
|
|
|
2010-04-04 22:20:41 +08:00
|
|
|
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
|
2011-10-26 17:30:58 +08:00
|
|
|
# NOTE: valgrind requires rebuilt with each major glibc version
|
2010-03-13 23:25:19 +08:00
|
|
|
|
|
|
|
pkgname=glibc
|
2013-04-25 06:22:36 +08:00
|
|
|
pkgver=2.17
|
|
|
|
pkgrel=1
|
2010-03-13 23:25:19 +08:00
|
|
|
pkgdesc="GNU C Library"
|
2013-04-25 06:22:36 +08:00
|
|
|
arch=('i686' 'x86_64')
|
2010-03-13 23:25:19 +08:00
|
|
|
url="http://www.gnu.org/software/libc"
|
|
|
|
license=('GPL' 'LGPL')
|
|
|
|
groups=('base')
|
2013-04-25 06:22:36 +08:00
|
|
|
depends=('linux-api-headers>=3.7.6' 'tzdata' 'filesystem>=2013.03')
|
2012-11-14 04:20:22 +08:00
|
|
|
makedepends=('gcc>=4.7')
|
2011-10-08 08:02:42 +08:00
|
|
|
backup=(etc/gai.conf
|
|
|
|
etc/locale.gen
|
2013-04-25 06:22:36 +08:00
|
|
|
etc/nscd.conf
|
|
|
|
glibc.conf)
|
2011-10-08 08:02:42 +08:00
|
|
|
options=('!strip')
|
2010-03-13 23:25:19 +08:00
|
|
|
install=glibc.install
|
2013-04-25 06:22:36 +08:00
|
|
|
source=(http://ftp.gnu.org/gnu/libc/${pkgname}-${pkgver}.tar.xz{,.sig}
|
|
|
|
glibc-2.17-sync-with-linux37.patch
|
|
|
|
glibc-2.17-getaddrinfo-stack-overflow.patch
|
|
|
|
glibc-2.17-regexp-matcher-overrun.patch
|
2012-11-11 03:09:39 +08:00
|
|
|
nscd.service
|
|
|
|
nscd.tmpfiles
|
2010-03-13 23:25:19 +08:00
|
|
|
locale.gen.txt
|
2013-04-25 06:22:36 +08:00
|
|
|
locale-gen)
|
|
|
|
md5sums=('87bf675c8ee523ebda4803e8e1cec638'
|
|
|
|
'6db4d1661cf34282755dc90330465f6d'
|
|
|
|
'fb99380d94598cc76d793deebf630022'
|
|
|
|
'56d5f2c09503a348281a20ae404b7de3'
|
|
|
|
'200acc05961b084ee00dde919e64f82d'
|
|
|
|
'c1e07c0bec0fe89791bfd9d13fc85edf'
|
2012-11-11 03:09:39 +08:00
|
|
|
'bccbe5619e75cf1d97312ec3681c605c'
|
2010-03-13 23:25:19 +08:00
|
|
|
'07ac979b6ab5eeb778d55f041529d623'
|
2013-04-25 06:22:36 +08:00
|
|
|
'476e9113489f93b348b21e144b6a8fcf')
|
2010-03-13 23:25:19 +08:00
|
|
|
|
2010-09-09 03:53:22 +08:00
|
|
|
|
2010-03-13 23:25:19 +08:00
|
|
|
build() {
|
2013-04-25 06:22:36 +08:00
|
|
|
cd ${srcdir}/${pkgname}-${pkgver}
|
2012-04-20 06:16:24 +08:00
|
|
|
|
2013-04-25 06:22:36 +08:00
|
|
|
# combination of upstream commits 318cd0b, b540704 and fc1abbe
|
|
|
|
patch -p1 -i ${srcdir}/glibc-2.17-sync-with-linux37.patch
|
2012-04-20 06:16:24 +08:00
|
|
|
|
2013-04-25 06:22:36 +08:00
|
|
|
# CVE-2013-1914 - upstream commit 1cef1b19
|
|
|
|
patch -p1 -i ${srcdir}/glibc-2.17-getaddrinfo-stack-overflow.patch
|
2012-04-20 06:16:24 +08:00
|
|
|
|
2013-04-25 06:22:36 +08:00
|
|
|
# CVE-2013-0242 - upstream commit a445af0b
|
|
|
|
patch -p1 -i ${srcdir}/glibc-2.17-regexp-matcher-overrun.patch
|
2011-05-08 20:34:12 +08:00
|
|
|
|
2011-04-12 02:22:13 +08:00
|
|
|
cd ${srcdir}
|
2011-10-26 17:30:58 +08:00
|
|
|
rm -vRf glibc-build
|
2010-10-17 09:17:39 +08:00
|
|
|
mkdir glibc-build
|
2010-03-13 23:25:19 +08:00
|
|
|
cd glibc-build
|
|
|
|
|
|
|
|
echo "slibdir=/lib" >> configparms
|
|
|
|
|
2013-04-25 06:22:36 +08:00
|
|
|
# remove hardening options for building libraries
|
|
|
|
CFLAGS=${CFLAGS/-fstack-protector/}
|
|
|
|
CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
|
|
|
|
|
|
|
|
${srcdir}/${pkgname}-${pkgver}/configure --prefix=/usr \
|
2011-04-12 02:22:13 +08:00
|
|
|
--libdir=/usr/lib --libexecdir=/usr/lib \
|
|
|
|
--with-headers=/usr/include \
|
2013-04-25 06:22:36 +08:00
|
|
|
--with-bugurl=http://chakra-project.org/bugs/ \
|
2011-04-12 02:22:13 +08:00
|
|
|
--enable-add-ons=nptl,libidn \
|
2012-12-16 09:07:23 +08:00
|
|
|
--enable-obsolete-rpc \
|
2012-11-14 05:58:35 +08:00
|
|
|
--enable-kernel=2.6.32 \
|
2013-04-25 06:22:36 +08:00
|
|
|
--enable-bind-now --disable-profile \
|
|
|
|
--enable-stackguard-randomization \
|
2011-10-26 17:30:58 +08:00
|
|
|
--enable-multi-arch
|
2011-10-08 08:02:42 +08:00
|
|
|
|
2013-04-25 06:22:36 +08:00
|
|
|
# build libraries with hardening disabled
|
|
|
|
echo "build-programs=no" >> configparms
|
|
|
|
make
|
|
|
|
|
|
|
|
# re-enable hardening for programs
|
|
|
|
sed -i "/build-programs=/s#no#yes#" configparms
|
|
|
|
echo "CC += -fstack-protector -D_FORTIFY_SOURCE=2" >> configparms
|
|
|
|
echo "CXX += -fstack-protector -D_FORTIFY_SOURCE=2" >> configparms
|
2010-09-06 06:54:18 +08:00
|
|
|
make
|
2013-04-25 06:22:36 +08:00
|
|
|
|
|
|
|
# remove harding in preparation to run test-suite
|
|
|
|
sed -i '2,4d' configparms
|
2011-10-08 08:02:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2013-04-25 06:22:36 +08:00
|
|
|
cd ${srcdir}/glibc-build
|
|
|
|
make -k check || true
|
2010-05-16 23:08:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2011-04-12 02:22:13 +08:00
|
|
|
cd ${srcdir}/glibc-build
|
2012-11-11 03:09:39 +08:00
|
|
|
|
|
|
|
install -dm755 ${pkgdir}/etc
|
|
|
|
touch ${pkgdir}/etc/ld.so.conf
|
|
|
|
|
2010-09-06 06:54:18 +08:00
|
|
|
make install_root=${pkgdir} install
|
2010-03-13 23:25:19 +08:00
|
|
|
|
2011-10-08 08:02:42 +08:00
|
|
|
rm -f ${pkgdir}/etc/ld.so.{cache,conf}
|
2010-03-13 23:25:19 +08:00
|
|
|
|
2012-11-14 05:58:35 +08:00
|
|
|
install -dm755 ${pkgdir}/{,usr/{sbin,lib/{,locale,systemd/system,tmpfiles.d}}}
|
2012-11-11 03:09:39 +08:00
|
|
|
|
2013-04-25 06:22:36 +08:00
|
|
|
install -m644 ${srcdir}/${pkgname}-${pkgver}/nscd/nscd.conf ${pkgdir}/etc/nscd.conf
|
2012-11-11 03:09:39 +08:00
|
|
|
install -m644 ${srcdir}/nscd.service ${pkgdir}/usr/lib/systemd/system
|
|
|
|
install -m644 ${srcdir}/nscd.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/nscd.conf
|
|
|
|
|
2013-04-25 06:22:36 +08:00
|
|
|
install -m644 ${srcdir}/${pkgname}-${pkgver}/posix/gai.conf ${pkgdir}/etc/gai.conf
|
|
|
|
|
|
|
|
install -m755 ${srcdir}/locale-gen ${pkgdir}/usr/bin
|
|
|
|
|
|
|
|
# temporary symlink
|
|
|
|
ln -s ../../sbin/ldconfig ${pkgdir}/usr/bin/ldconfig
|
2010-03-13 23:25:19 +08:00
|
|
|
|
|
|
|
# create /etc/locale.gen
|
|
|
|
install -m644 ${srcdir}/locale.gen.txt ${pkgdir}/etc/locale.gen
|
2013-04-25 06:22:36 +08:00
|
|
|
sed -e '1,3d' -e 's|/| |g' -e 's|\\| |g' -e 's|^|#|g' \
|
|
|
|
${srcdir}/glibc-${pkgver}/localedata/SUPPORTED >> ${pkgdir}/etc/locale.gen
|
2010-03-13 23:25:19 +08:00
|
|
|
|
2013-04-25 06:22:36 +08:00
|
|
|
# Do not strip the following files for improved debugging support
|
|
|
|
# ("improved" as in not breaking gdb and valgrind...):
|
|
|
|
# ld-${pkgver}.so
|
|
|
|
# libc-${pkgver}.so
|
|
|
|
# libpthread-${pkgver}.so
|
|
|
|
# libthread_db-1.0.so
|
2012-11-14 05:58:35 +08:00
|
|
|
|
2012-11-14 04:20:22 +08:00
|
|
|
cd ${pkgdir}
|
2010-09-10 21:00:23 +08:00
|
|
|
strip $STRIP_BINARIES sbin/{ldconfig,sln} \
|
|
|
|
usr/bin/{gencat,getconf,getent,iconv,locale} \
|
|
|
|
usr/bin/{localedef,pcprofiledump,rpcgen,sprof} \
|
|
|
|
usr/lib/getconf/* \
|
2011-10-08 08:02:42 +08:00
|
|
|
usr/sbin/{iconvconfig,nscd}
|
2010-09-10 21:00:23 +08:00
|
|
|
|
2013-02-21 02:48:17 +08:00
|
|
|
strip $STRIP_STATIC usr/lib/*.a
|
2010-09-10 21:00:23 +08:00
|
|
|
|
2013-02-21 02:48:17 +08:00
|
|
|
strip $STRIP_SHARED lib/{libanl,libBrokenLocale,libcidn,libcrypt}-${pkgver}.so \
|
2010-09-10 21:00:23 +08:00
|
|
|
lib/libnss_{compat,dns,files,hesiod,nis,nisplus}-${pkgver}.so \
|
|
|
|
lib/{libdl,libm,libnsl,libresolv,librt,libutil}-${pkgver}.so \
|
|
|
|
lib/{libmemusage,libpcprofile,libSegFault}.so \
|
2011-10-08 08:02:42 +08:00
|
|
|
usr/lib/{pt_chown,{audit,gconv}/*.so}
|
2012-11-14 07:52:44 +08:00
|
|
|
|
2013-04-25 06:22:36 +08:00
|
|
|
# Add /lib to the default library search path
|
2012-11-16 04:21:00 +08:00
|
|
|
install -Dm644 "$srcdir/glibc.conf" "$pkgdir/etc/ld.so.conf.d/glibc.conf"
|
2011-10-08 08:02:42 +08:00
|
|
|
}
|