diff options
author | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2016-01-14 20:24:01 -0300 |
---|---|---|
committer | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2016-01-14 20:26:47 -0300 |
commit | 6266fd7804dd3bd1134c2228a307d3838ebbb651 (patch) | |
tree | 4a993a5d3408460774d1dbb54e8a9cca80569ffa /libre/glibc-static/PKGBUILD | |
parent | eb7e0b1ba93b9835c7adb65327c59599af99d07a (diff) | |
download | abslibre-6266fd7804dd3bd1134c2228a307d3838ebbb651.tar.gz abslibre-6266fd7804dd3bd1134c2228a307d3838ebbb651.tar.bz2 abslibre-6266fd7804dd3bd1134c2228a307d3838ebbb651.zip |
glibc-static: add pkg to [libre] repo
Diffstat (limited to 'libre/glibc-static/PKGBUILD')
-rw-r--r-- | libre/glibc-static/PKGBUILD | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/libre/glibc-static/PKGBUILD b/libre/glibc-static/PKGBUILD new file mode 100644 index 000000000..dc2cd3233 --- /dev/null +++ b/libre/glibc-static/PKGBUILD @@ -0,0 +1,92 @@ +# Maintainer: Márcio Silva <coadde@parabola.nu> +# based of glibc + +_pkgname=glibc +pkgname=glibc-static +pkgver=2.22 +pkgrel=4 +pkgdesc="GNU C Library (static libraries only)" +arch=('i686' 'x86_64' 'armv7h') +url="http://www.gnu.org/software/libc" +license=('GPL' 'LGPL') +depends=('glibc') +makedepends=('gcc>=5.2') +options=('!strip' '!docs' 'staticlibs' '!emptydirs') +source=(http://ftp.gnu.org/gnu/libc/${_pkgname}-${pkgver}.tar.xz{,.sig} + glibc-2.22-roundup.patch) +md5sums=('e51e02bf552a0a1fbbdc948fb2f5e83c' + 'SKIP' + '8476d7f2bceaacde30ea2b9d4afb4bd1') +validpgpkeys=('F37CDAB708E65EA183FD1AF625EF0A436C2A4AFF') # Carlos O'Donell + +prepare() { + cd ${srcdir}/glibc-${pkgver} + + # glibc-2.21..g2b529a8 + patch -p1 -i $srcdir/glibc-2.22-roundup.patch + + mkdir ${srcdir}/glibc-build +} + +build() { + cd ${srcdir}/glibc-build + + if [[ ${CARCH} = "i686" ]]; then + # Hack to fix NPTL issues with Xen, only required on 32bit platforms + # TODO: make separate glibc-xen package for i686 + export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs" + fi + + echo "slibdir=/usr/lib" >> configparms + echo "rtlddir=/usr/lib" >> configparms + + # remove hardening options for building libraries + CFLAGS=${CFLAGS/-fstack-protector-strong/} + CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/} + + ${srcdir}/${_pkgname}-${pkgver}/configure --prefix=/usr \ + --libdir=/usr/lib \ + --with-headers=/usr/include \ + --with-bugurl=https://labs.parabola.no/ \ + --enable-add-ons \ + --enable-obsolete-rpc \ + --enable-kernel=2.6.32 \ + --enable-bind-now --disable-profile \ + --enable-stackguard-randomization \ + --enable-lock-elision \ + --enable-multi-arch \ + --disable-werror + + # 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-strong -D_FORTIFY_SOURCE=2" >> configparms + echo "CXX += -fstack-protector-strong -D_FORTIFY_SOURCE=2" >> configparms + make + + # remove harding in preparation to run test-suite + sed -i '5,7d' configparms +} + +check() { + cd ${srcdir}/glibc-build + + # some failures are "expected" + make check || true +} + +package() { + cd ${srcdir}/glibc-build + + make install_root=${pkgdir} install + + rm -vr ${pkgdir}/{etc,sbin,usr/{bin,lib/{audit,gconv},include,libexec,share,sbin},var} + rm -v ${pkgdir}/usr/lib/*.o + rm -v ${pkgdir}/usr/lib/*.so* + rm -v ${pkgdir}/usr/lib/lib{c{,_nonshared},crypt,dl,g,ieee,m,mcheck,pthread{,_nonshared},rpcsvc}.a + + strip $STRIP_STATIC ${pkgdir}/usr/lib/*.a +} |