core/glibc to 2.25-1

This commit is contained in:
Kevin Mihelich 2017-03-11 03:35:26 +00:00
parent 84fd8f0b37
commit 6a92e17aa3

View file

@ -1,4 +1,4 @@
# $Id: PKGBUILD 163008 2012-07-05 13:48:19Z allan $ # $Id$
# Maintainer: Allan McRae <allan@archlinux.org> # Maintainer: Allan McRae <allan@archlinux.org>
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc # toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
@ -13,15 +13,15 @@
noautobuild=1 noautobuild=1
pkgname=glibc pkgname=glibc
pkgver=2.24 pkgver=2.25
pkgrel=2 pkgrel=1
_commit=fdfc9260 _commit=69e0a87cc4c570e3b7218392fc3e743b5bddcce2
pkgdesc="GNU C Library" pkgdesc="GNU C Library"
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="http://www.gnu.org/software/libc" url="http://www.gnu.org/software/libc"
license=('GPL' 'LGPL') license=('GPL' 'LGPL')
groups=('base') groups=('base')
depends=('linux-api-headers>=4.7' 'tzdata' 'filesystem') depends=('linux-api-headers>=4.10' 'tzdata' 'filesystem')
makedepends=('gcc>=6' 'git') makedepends=('gcc>=6' 'git')
backup=(etc/gai.conf backup=(etc/gai.conf
etc/locale.gen etc/locale.gen
@ -37,11 +37,23 @@ md5sums=('SKIP'
prepare() { prepare() {
mkdir glibc-build mkdir glibc-build
cd glibc
# avoid crashes on i686 memchr-sse2.S
# https://sourceware.org/bugzilla/show_bug.cgi?id=21182
_revert_commit="23d27709a423aec32821e9a5198a10267107bae2"
_revert_file="sysdeps/i386/i686/multiarch/memchr-sse2.S"
git show ${_revert_commit} -- ${_revert_file} | git apply -R
} }
build() { build() {
cd glibc-build cd glibc-build
if [[ ${CARCH} = "i686" ]]; then
# Hack to fix NPTL issues with Xen, only required on 32bit platforms
export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs"
fi
# ALARM: Specify build host types # ALARM: Specify build host types
[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=armv5tel-unknown-linux-gnueabi --build=armv5tel-unknown-linux-gnueabi" [[ $CARCH == "arm" ]] && CONFIGFLAG="--host=armv5tel-unknown-linux-gnueabi --build=armv5tel-unknown-linux-gnueabi"
[[ $CARCH == "armv6h" ]] && CONFIGFLAG="--host=armv6l-unknown-linux-gnueabihf --build=armv6l-unknown-linux-gnueabihf" [[ $CARCH == "armv6h" ]] && CONFIGFLAG="--host=armv6l-unknown-linux-gnueabihf --build=armv6l-unknown-linux-gnueabihf"
@ -53,44 +65,45 @@ build() {
echo "sbindir=/usr/bin" >> configparms echo "sbindir=/usr/bin" >> configparms
echo "rootsbindir=/usr/bin" >> configparms echo "rootsbindir=/usr/bin" >> configparms
# remove hardening options for building libraries # remove fortify for building libraries
CFLAGS=${CFLAGS/-fstack-protector/}
CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/} CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
# enable unwinding tables so that gdb can unwind the standard functions ../${pkgname}/configure \
CFLAGS+=" -funwind-tables" --prefix=/usr \
--libdir=/usr/lib \
../${pkgname}/configure --prefix=/usr \ --libexecdir=/usr/lib \
--libdir=/usr/lib --libexecdir=/usr/lib \
--with-headers=/usr/include \ --with-headers=/usr/include \
--with-bugurl=https://github.com/archlinuxarm/PKGBUILDs/issues \ --with-bugurl=https://github.com/archlinuxarm/PKGBUILDs/issues \
--enable-add-ons \ --enable-add-ons \
--enable-obsolete-rpc \ --enable-obsolete-rpc \
--enable-kernel=2.6.32 \ --enable-kernel=2.6.32 \
--enable-bind-now --disable-profile \ --enable-bind-now \
--disable-profile \
--enable-stackguard-randomization \ --enable-stackguard-randomization \
--enable-stack-protector=strong \
--enable-lock-elision \ --enable-lock-elision \
--disable-multi-arch \ --disable-multi-arch \
--disable-werror \ --disable-werror \
$CONFIGFLAG $CONFIGFLAG
# build libraries with hardening disabled # build libraries with fortify disabled
echo "build-programs=no" >> configparms echo "build-programs=no" >> configparms
make make
# re-enable hardening for programs # re-enable fortify for programs
sed -i "/build-programs=/s#no#yes#" configparms 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
make
# remove harding in preparation to run test-suite echo "CC += -D_FORTIFY_SOURCE=2" >> configparms
sed -i '/FORTIFY/d' configparms echo "CXX += -D_FORTIFY_SOURCE=2" >> configparms
make
} }
check() { check() {
cd glibc-build cd glibc-build
# remove fortify in preparation to run test-suite
sed -i '/FORTIFY/d' configparms
# some failures are "expected" # some failures are "expected"
make check || true make check || true
} }
@ -139,14 +152,22 @@ package() {
strip $STRIP_BINARIES usr/bin/lddlibc4 strip $STRIP_BINARIES usr/bin/lddlibc4
fi fi
strip $STRIP_STATIC usr/lib/*.a strip $STRIP_STATIC usr/lib/lib{anl,BrokenLocale,c{,_nonshared},crypt}.a \
usr/lib/lib{dl,g,ieee,mcheck,nsl,pthread{,_nonshared}}.a \
usr/lib/lib{resolv,rpcsvc,rt,util}.a
strip $STRIP_SHARED usr/lib/lib{anl,BrokenLocale,cidn,crypt}-*.so \ strip $STRIP_SHARED usr/lib/lib{anl,BrokenLocale,cidn,crypt}-${pkgver}.so \
usr/lib/libnss_{compat,db,dns,files,hesiod,nis,nisplus}-*.so \ usr/lib/libnss_{compat,db,dns,files,hesiod,nis,nisplus}-*.so \
usr/lib/lib{dl,m,nsl,resolv,rt,util}-*.so \ usr/lib/lib{dl,m,nsl,resolv,rt,util}-${pkgver}.so \
usr/lib/lib{memusage,pcprofile,SegFault}.so \ usr/lib/lib{memusage,pcprofile,SegFault}.so \
usr/lib/{audit,gconv}/*.so || true usr/lib/{audit,gconv}/*.so || true
if [[ $CARCH = "x86_64" ]]; then if [[ $CARCH = "x86_64" ]]; then
strip $STRIP_STATIC usr/lib/lib{m-${pkgver},mvec{,_nonshared}}.a
strip $STRIP_SHARED usr/lib/libmvec-*.so strip $STRIP_SHARED usr/lib/libmvec-*.so
fi fi
if [[ $CARCH = "i686" ]]; then
strip $STRIP_STATIC usr/lib/libm.a
fi
} }