From dda676825c6354841f8dc2bab38f89105f98628f Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Sun, 30 Jun 2013 15:55:23 -0300 Subject: xtensa-unknown-elf-gcc: add new package to libre repo --- libre/xtensa-unknown-elf-gcc/PKGBUILD | 158 ++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 libre/xtensa-unknown-elf-gcc/PKGBUILD (limited to 'libre/xtensa-unknown-elf-gcc/PKGBUILD') diff --git a/libre/xtensa-unknown-elf-gcc/PKGBUILD b/libre/xtensa-unknown-elf-gcc/PKGBUILD new file mode 100644 index 000000000..2ad6a9a7e --- /dev/null +++ b/libre/xtensa-unknown-elf-gcc/PKGBUILD @@ -0,0 +1,158 @@ +# $Id: PKGBUILD 186915 2013-05-31 23:25:14Z allan $ +# Maintainer: Allan McRae +# Maintainer (Parabola): André Silva +# Contributor (Parabola): Márcio Silva + +pkgname=xtensa-elf-gcc +pkgver=4.8.1 +pkgrel=1 +#_snapshot=4.8-20130502 +pkgdesc="The GNU Compiler Collection" +arch=('i686' 'x86_64' 'mips64el') +license=('GPL' 'LGPL' 'FDL' 'custom') +url="http://gcc.gnu.org" +makedepends=('xtensa-elf-binutils>=2.23' 'libmpc' 'cloog' 'gcc-ada' 'doxygen') +checkdepends=('dejagnu' 'inetutils') +options=('!libtool' '!emptydirs') +source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2) + #ftp://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-${_snapshot}.tar.bz2 +md5sums=('3b2386c114cd74185aa3754b58a79304') + + +if [ -n "${_snapshot}" ]; then + _basedir=gcc-${_snapshot} +else + _basedir=gcc-${pkgver} +fi + +prepare() { + cd ${srcdir}/${_basedir} + + # Do not run fixincludes + sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in + + # Parabola installs x86_64 libraries /lib + [[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64 + + echo ${pkgver} > gcc/BASE-VER + + # hack! - some configure tests for header files using "$CPP $CPPFLAGS" + sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure + + mkdir ${srcdir}/gcc-build +} + +build() { + cd ${srcdir}/gcc-build + + export LD_LIBRARY_PATH=/usr/lib + + # using -pipe causes spurious test-suite failures + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565 + CFLAGS=${CFLAGS/-pipe/} + CXXFLAGS=${CXXFLAGS/-pipe/} + + ${srcdir}/${_basedir}/configure --prefix=/usr \ + --libdir=/usr/lib --libexecdir=/usr/lib \ + --mandir=/usr/share/man --infodir=/usr/share/info \ + --with-bugurl=https://labs.parabola.nu/ \ + --enable-languages=c \ + --enable-shared --enable-threads=posix \ + --with-system-zlib --enable-__cxa_atexit \ + --disable-libunwind-exceptions --enable-clocale=gnu \ + --disable-libstdcxx-pch \ + --enable-gnu-unique-object --enable-linker-build-id \ + --enable-cloog-backend=isl --disable-cloog-version-check \ + --enable-lto --enable-gold --enable-ld=default \ + --enable-plugin --with-plugin-ld=ld.gold \ + --with-linker-hash-style=gnu --disable-install-libiberty \ + --disable-multilib --disable-libssp --disable-werror \ + --enable-checking=release \ + --program-prefix=xtensa-elf- \ + --target=xtensa-elf + make + + # make documentation + cd xtensa-elf/libstdc++-v3 + make doc-man-doxygen +} + +check() { + cd ${srcdir}/gcc-build + + # increase stack size to prevent test failures + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31827 + ulimit -s 32768 + + # do not abort on error as some are "expected" + make -k check || true + ${srcdir}/${_basedir}/contrib/test_summary +} + +package() +{ + pkgdesc="The GNU Compiler Collection" + depends=("gcc-libs=$pkgver-$pkgrel" 'xtensa-elf-binutils>=2.23' 'libmpc' 'cloog') + install=xtensa-elf-gcc.install + + cd ${srcdir}/gcc-build + + make -j1 DESTDIR=${pkgdir} install + + install -d $pkgdir/usr/share/gdb/auto-load/usr/lib + mv $pkgdir{,/usr/share/gdb/auto-load}/usr/lib/libstdc++.so.6.0.18-gdb.py + + # unfortunately it is much, much easier to install the lot and clean-up the mess... + rm $pkgdir/usr/bin/{{xtensa-elf-,}gfortran,{xtensa-elf-,}gccgo,gnat*} + rm $pkgdir/usr/lib/*.so* + rm $pkgdir/usr/lib/lib{atomic,gfortran,go{,begin},iberty,objc}.a + rm $pkgdir/usr/lib/libgfortran.spec + rm -r $pkgdir/usr/lib/gcc/xtensa-elf/${pkgver}/{ada{include,lib},finclude,include/objc} + rm $pkgdir/usr/lib/gcc/xtensa-elf/${pkgver}/{cc1obj{,plus},f951,gnat1,go1} + rm $pkgdir/usr/lib/gcc/xtensa-elf/${pkgver}/{libcaf_single,libgfortranbegin}.a + rm -r $pkgdir/usr/lib/go + rm $pkgdir/usr/share/info/{gccgo,gfortran,gnat*,libgomp,libquadmath,libitm}.info + rm $pkgdir/usr/share/locale/{de,fr}/LC_MESSAGES/libstdc++.mo + rm $pkgdir/usr/share/man/man1/{gccgo,gfortran}.1 + + # many packages expect this symlinks + ln -s gcc ${pkgdir}/usr/bin/cc + + # POSIX conformance launcher scripts for c89 and c99 + cat > $pkgdir/usr/bin/c89 <<"EOF" +#!/bin/sh +fl="-std=c89" +for opt; do + case "$opt" in + -ansi|-std=c89|-std=iso9899:1990) fl="";; + -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2 + exit 1;; + esac +done +exec gcc $fl ${1+"$@"} +EOF + + cat > $pkgdir/usr/bin/c99 <<"EOF" +#!/bin/sh +fl="-std=c99" +for opt; do + case "$opt" in + -std=c99|-std=iso9899:1999) fl="";; + -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2 + exit 1;; + esac +done +exec gcc $fl ${1+"$@"} +EOF + + chmod 755 $pkgdir/usr/bin/c{8,9}9 + + # install the libstdc++ man pages + install -dm755 ${pkgdir}/usr/share/man/man3 + install -m644 -t ${pkgdir}/usr/share/man/man3 \ + xtensa-elf/libstdc++-v3/doc/doxygen/man/man3/*.3 + + # Install Runtime Library Exception + install -Dm644 ${srcdir}/${_basedir}/COPYING.RUNTIME \ + ${pkgdir}/usr/share/licenses/xtensa-elf-gcc/RUNTIME.LIBRARY.EXCEPTION +} -- cgit v1.2.3 From d9da058019d165dd78f472168d1783488e84c1ba Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Sun, 30 Jun 2013 17:55:07 -0300 Subject: xtensa-unknown-elf-gcc: fix issues on PKGBUILD --- libre/xtensa-unknown-elf-gcc/PKGBUILD | 53 ++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'libre/xtensa-unknown-elf-gcc/PKGBUILD') diff --git a/libre/xtensa-unknown-elf-gcc/PKGBUILD b/libre/xtensa-unknown-elf-gcc/PKGBUILD index 2ad6a9a7e..5472ba164 100644 --- a/libre/xtensa-unknown-elf-gcc/PKGBUILD +++ b/libre/xtensa-unknown-elf-gcc/PKGBUILD @@ -3,15 +3,19 @@ # Maintainer (Parabola): André Silva # Contributor (Parabola): Márcio Silva -pkgname=xtensa-elf-gcc +_pkgname=gcc +_target="xtensa-unknown-elf" +_sysroot="/usr/${_target}" + +pkgname="${_target}-gcc pkgver=4.8.1 pkgrel=1 #_snapshot=4.8-20130502 -pkgdesc="The GNU Compiler Collection" +pkgdesc="The GNU Compiler Collection for Xtensa processors" arch=('i686' 'x86_64' 'mips64el') license=('GPL' 'LGPL' 'FDL' 'custom') url="http://gcc.gnu.org" -makedepends=('xtensa-elf-binutils>=2.23' 'libmpc' 'cloog' 'gcc-ada' 'doxygen') +makedepends=("${_target}-binutils>=2.23" 'libmpc' 'cloog' 'gcc-ada' 'doxygen') checkdepends=('dejagnu' 'inetutils') options=('!libtool' '!emptydirs') source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2) @@ -45,8 +49,6 @@ prepare() { build() { cd ${srcdir}/gcc-build - export LD_LIBRARY_PATH=/usr/lib - # using -pipe causes spurious test-suite failures # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565 CFLAGS=${CFLAGS/-pipe/} @@ -57,7 +59,7 @@ build() { --mandir=/usr/share/man --infodir=/usr/share/info \ --with-bugurl=https://labs.parabola.nu/ \ --enable-languages=c \ - --enable-shared --enable-threads=posix \ + --disable-shared --enable-threads=posix \ --with-system-zlib --enable-__cxa_atexit \ --disable-libunwind-exceptions --enable-clocale=gnu \ --disable-libstdcxx-pch \ @@ -68,12 +70,14 @@ build() { --with-linker-hash-style=gnu --disable-install-libiberty \ --disable-multilib --disable-libssp --disable-werror \ --enable-checking=release \ - --program-prefix=xtensa-elf- \ - --target=xtensa-elf + --target=${_target} \ + --with-sysroot=${_sysroot} \ + --with-arch=xtensa \ + --with-newlib make # make documentation - cd xtensa-elf/libstdc++-v3 + cd ${_target}/libstdc++-v3 make doc-man-doxygen } @@ -92,8 +96,9 @@ check() { package() { pkgdesc="The GNU Compiler Collection" - depends=("gcc-libs=$pkgver-$pkgrel" 'xtensa-elf-binutils>=2.23' 'libmpc' 'cloog') - install=xtensa-elf-gcc.install + depends=("gcc-libs=$pkgver-$pkgrel" "${_target}-binutils>=2.23" 'libmpc' 'cloog') + groups=("${_target}-devel") + install=${_target}-gcc.install cd ${srcdir}/gcc-build @@ -103,23 +108,23 @@ package() mv $pkgdir{,/usr/share/gdb/auto-load}/usr/lib/libstdc++.so.6.0.18-gdb.py # unfortunately it is much, much easier to install the lot and clean-up the mess... - rm $pkgdir/usr/bin/{{xtensa-elf-,}gfortran,{xtensa-elf-,}gccgo,gnat*} + rm $pkgdir/usr/bin/{{${_target}-,}gfortran,{${_target}-,}gccgo,gnat*} rm $pkgdir/usr/lib/*.so* rm $pkgdir/usr/lib/lib{atomic,gfortran,go{,begin},iberty,objc}.a rm $pkgdir/usr/lib/libgfortran.spec - rm -r $pkgdir/usr/lib/gcc/xtensa-elf/${pkgver}/{ada{include,lib},finclude,include/objc} - rm $pkgdir/usr/lib/gcc/xtensa-elf/${pkgver}/{cc1obj{,plus},f951,gnat1,go1} - rm $pkgdir/usr/lib/gcc/xtensa-elf/${pkgver}/{libcaf_single,libgfortranbegin}.a + rm -r $pkgdir/usr/lib/gcc/${_target}-/${pkgver}/{ada{include,lib},finclude,include/objc} + rm $pkgdir/usr/lib/gcc/${_target}-/${pkgver}/{cc1obj{,plus},f951,gnat1,go1} + rm $pkgdir/usr/lib/gcc/${_target}-/${pkgver}/{libcaf_single,libgfortranbegin}.a rm -r $pkgdir/usr/lib/go rm $pkgdir/usr/share/info/{gccgo,gfortran,gnat*,libgomp,libquadmath,libitm}.info rm $pkgdir/usr/share/locale/{de,fr}/LC_MESSAGES/libstdc++.mo rm $pkgdir/usr/share/man/man1/{gccgo,gfortran}.1 # many packages expect this symlinks - ln -s gcc ${pkgdir}/usr/bin/cc + ln -s ${_target}-gcc ${pkgdir}/usr/bin/${_target}-cc # POSIX conformance launcher scripts for c89 and c99 - cat > $pkgdir/usr/bin/c89 <<"EOF" + cat > $pkgdir/usr/bin/${_target}-c89 <<"EOF" #!/bin/sh fl="-std=c89" for opt; do @@ -129,10 +134,10 @@ for opt; do exit 1;; esac done -exec gcc $fl ${1+"$@"} +exec ${_target}-gcc $fl ${1+"$@"} EOF - cat > $pkgdir/usr/bin/c99 <<"EOF" + cat > $pkgdir/usr/bin/${_target}-c99 <<"EOF" #!/bin/sh fl="-std=c99" for opt; do @@ -142,17 +147,13 @@ for opt; do exit 1;; esac done -exec gcc $fl ${1+"$@"} +exec ${_target}-gcc $fl ${1+"$@"} EOF - chmod 755 $pkgdir/usr/bin/c{8,9}9 + chmod 755 $pkgdir/usr/bin/${_target}-c{8,9}9 - # install the libstdc++ man pages - install -dm755 ${pkgdir}/usr/share/man/man3 - install -m644 -t ${pkgdir}/usr/share/man/man3 \ - xtensa-elf/libstdc++-v3/doc/doxygen/man/man3/*.3 # Install Runtime Library Exception install -Dm644 ${srcdir}/${_basedir}/COPYING.RUNTIME \ - ${pkgdir}/usr/share/licenses/xtensa-elf-gcc/RUNTIME.LIBRARY.EXCEPTION + ${pkgdir}/usr/share/licenses/${_target}/RUNTIME.LIBRARY.EXCEPTION } -- cgit v1.2.3 From 0ebb087df0decfe020c909e249f86e1bd5628d22 Mon Sep 17 00:00:00 2001 From: Márcio Alexandre Silva Delgado Date: Tue, 2 Jul 2013 21:04:01 -0300 Subject: xtensa-unknown-elf-{binutils,gcc,glibc,linux-libre-api-headers}: adding and fixing cross pkg --- libre/xtensa-unknown-elf-binutils/PKGBUILD | 7 +- libre/xtensa-unknown-elf-gcc/PKGBUILD | 51 ++++--- libre/xtensa-unknown-elf-glibc/PKGBUILD | 155 +++++++++++++++++++++ .../glibc-2.17-getaddrinfo-stack-overflow.patch | 47 +++++++ .../glibc-2.17-regexp-matcher-overrun.patch | 137 ++++++++++++++++++ .../glibc-2.17-sync-with-linux37.patch | 130 +++++++++++++++++ libre/xtensa-unknown-elf-glibc/locale-gen | 42 ++++++ libre/xtensa-unknown-elf-glibc/locale.gen.txt | 23 +++ libre/xtensa-unknown-elf-glibc/nscd.service | 17 +++ libre/xtensa-unknown-elf-glibc/nscd.tmpfiles | 1 + .../xtensa-unknown-elf-glibc.install | 19 +++ .../PKGBUILD | 12 +- 12 files changed, 608 insertions(+), 33 deletions(-) create mode 100644 libre/xtensa-unknown-elf-glibc/PKGBUILD create mode 100644 libre/xtensa-unknown-elf-glibc/glibc-2.17-getaddrinfo-stack-overflow.patch create mode 100644 libre/xtensa-unknown-elf-glibc/glibc-2.17-regexp-matcher-overrun.patch create mode 100644 libre/xtensa-unknown-elf-glibc/glibc-2.17-sync-with-linux37.patch create mode 100644 libre/xtensa-unknown-elf-glibc/locale-gen create mode 100644 libre/xtensa-unknown-elf-glibc/locale.gen.txt create mode 100644 libre/xtensa-unknown-elf-glibc/nscd.service create mode 100644 libre/xtensa-unknown-elf-glibc/nscd.tmpfiles create mode 100644 libre/xtensa-unknown-elf-glibc/xtensa-unknown-elf-glibc.install (limited to 'libre/xtensa-unknown-elf-gcc/PKGBUILD') diff --git a/libre/xtensa-unknown-elf-binutils/PKGBUILD b/libre/xtensa-unknown-elf-binutils/PKGBUILD index 8527a057d..2e29d1ff4 100644 --- a/libre/xtensa-unknown-elf-binutils/PKGBUILD +++ b/libre/xtensa-unknown-elf-binutils/PKGBUILD @@ -5,11 +5,11 @@ _pkgname=binutils _target="xtensa-unknown-elf" -_sysroot="/usr/${_target}" +_sysroot="/usr/$CHOST/${_target}" pkgname=${_target}-binutils pkgver=2.23.2 -pkgrel=2.1 +pkgrel=2.3 pkgdesc="A set of programs to assemble and manipulate binary and object files for the Xtensa architecture" arch=('i686' 'x86_64' 'mips64el') url="http://www.gnu.org/software/binutils/" @@ -48,9 +48,8 @@ build() { --with-bugurl=https://labs.parabola.nu/ \ --enable-ld=default --enable-gold \ --enable-plugins --enable-threads \ - --with-pic --disable-shared \ + --with-pic --enable-shared \ --disable-werror --disable-multilib \ - --with-sysroot=${_sysroot} \ --target=${_target} # check the host environment and makes sure all the necessary tools are available diff --git a/libre/xtensa-unknown-elf-gcc/PKGBUILD b/libre/xtensa-unknown-elf-gcc/PKGBUILD index 5472ba164..6081151b7 100644 --- a/libre/xtensa-unknown-elf-gcc/PKGBUILD +++ b/libre/xtensa-unknown-elf-gcc/PKGBUILD @@ -5,9 +5,9 @@ _pkgname=gcc _target="xtensa-unknown-elf" -_sysroot="/usr/${_target}" +_sysroot="/usr/$CHOST/${_target}" -pkgname="${_target}-gcc +pkgname=${_target}-gcc pkgver=4.8.1 pkgrel=1 #_snapshot=4.8-20130502 @@ -15,7 +15,7 @@ pkgdesc="The GNU Compiler Collection for Xtensa processors" arch=('i686' 'x86_64' 'mips64el') license=('GPL' 'LGPL' 'FDL' 'custom') url="http://gcc.gnu.org" -makedepends=("${_target}-binutils>=2.23" 'libmpc' 'cloog' 'gcc-ada' 'doxygen') +makedepends=("binutils>=2.23" 'libmpc' 'cloog' 'gcc-ada' 'doxygen') checkdepends=('dejagnu' 'inetutils') options=('!libtool' '!emptydirs') source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2) @@ -54,26 +54,31 @@ build() { CFLAGS=${CFLAGS/-pipe/} CXXFLAGS=${CXXFLAGS/-pipe/} - ${srcdir}/${_basedir}/configure --prefix=/usr \ - --libdir=/usr/lib --libexecdir=/usr/lib \ - --mandir=/usr/share/man --infodir=/usr/share/info \ - --with-bugurl=https://labs.parabola.nu/ \ + LD_LIBRARY_PATH=/usr/lib ${srcdir}/${_basedir}/configure --prefix=/usr \ + --disable-shared --disable-threads --disable-multilib \ --enable-languages=c \ - --disable-shared --enable-threads=posix \ - --with-system-zlib --enable-__cxa_atexit \ - --disable-libunwind-exceptions --enable-clocale=gnu \ - --disable-libstdcxx-pch \ - --enable-gnu-unique-object --enable-linker-build-id \ - --enable-cloog-backend=isl --disable-cloog-version-check \ - --enable-lto --enable-gold --enable-ld=default \ - --enable-plugin --with-plugin-ld=ld.gold \ - --with-linker-hash-style=gnu --disable-install-libiberty \ - --disable-multilib --disable-libssp --disable-werror \ - --enable-checking=release \ - --target=${_target} \ - --with-sysroot=${_sysroot} \ - --with-arch=xtensa \ - --with-newlib + --disable-nls \ + --target=$_target +# --build=x86_64-unknown-linux-gnu \ +# --without-headers \ +# --disable-multilib --disable-libssp --disable-werror \ +# --libdir=/usr/lib --libexecdir=/usr/lib \ +# --mandir=/usr/share/man --infodir=/usr/share/info \ +# --with-bugurl=https://labs.parabola.nu/ \ +# --disable-shared --enable-threads=posix \ +# --with-system-zlib --enable-__cxa_atexit \ +# --disable-libunwind-exceptions --enable-clocale=gnu \ +# --disable-libstdcxx-pch \ +# --enable-gnu-unique-object --enable-linker-build-id \ +# --enable-cloog-backend=isl --disable-cloog-version-check \ +# --enable-lto --enable-gold --enable-ld=default \ +# --enable-plugin --with-plugin-ld=ld.gold \ +# --with-linker-hash-style=gnu --disable-install-libiberty \ +# --with-as=/usr/bin/${_target}-as --with-ld=/usr/bin/${_target}-ld \ +# --disable-multilib --disable-libssp --disable-werror \ +# --enable-checking=release \ +# --target=${_target} \ +# --with-newlib make # make documentation @@ -96,7 +101,7 @@ check() { package() { pkgdesc="The GNU Compiler Collection" - depends=("gcc-libs=$pkgver-$pkgrel" "${_target}-binutils>=2.23" 'libmpc' 'cloog') + depends=("gcc-libs=$pkgver-$pkgrel" 'binutils>=2.23' 'libmpc' 'cloog') groups=("${_target}-devel") install=${_target}-gcc.install diff --git a/libre/xtensa-unknown-elf-glibc/PKGBUILD b/libre/xtensa-unknown-elf-glibc/PKGBUILD new file mode 100644 index 000000000..0a459b10b --- /dev/null +++ b/libre/xtensa-unknown-elf-glibc/PKGBUILD @@ -0,0 +1,155 @@ +# $Id: PKGBUILD 186623 2013-05-30 07:47:03Z allan $ +# Maintainer: Allan McRae + +# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc +# NOTE: valgrind requires rebuilt with each major glibc version + +_pkgname=glibc +_target="xtensa-unknown-elf" +_sysroot="usr/$CHOST/${_target}" + +pkgname=${_target}-glibc +pkgver=2.17 +pkgrel=6 +pkgdesc="GNU C Library for Xtensa processors" +arch=('i686' 'x86_64') +url="http://www.gnu.org/software/libc" +license=('GPL' 'LGPL') +groups=('base') +depends=("${_target}-linux-api-headers>=3.7" 'tzdata' 'filesystem>=2013.01') +makedepends=('gcc>=4.7') +backup=(etc/gai.conf + etc/locale.gen + etc/nscd.conf) +options=('!strip') +install=${_target}-glibc.install +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 + nscd.service + nscd.tmpfiles + locale.gen.txt + locale-gen) +md5sums=('87bf675c8ee523ebda4803e8e1cec638' + 'SKIP' + 'fb99380d94598cc76d793deebf630022' + '56d5f2c09503a348281a20ae404b7de3' + '200acc05961b084ee00dde919e64f82d' + 'c1e07c0bec0fe89791bfd9d13fc85edf' + 'bccbe5619e75cf1d97312ec3681c605c' + '07ac979b6ab5eeb778d55f041529d623' + '476e9113489f93b348b21e144b6a8fcf') + + +build() { + cd ${srcdir}/${_pkgname}-${pkgver} + + # combination of upstream commits 318cd0b, b540704 and fc1abbe + patch -p1 -i ${srcdir}/glibc-2.17-sync-with-linux37.patch + + # CVE-2013-1914 - upstream commit 1cef1b19 + patch -p1 -i ${srcdir}/glibc-2.17-getaddrinfo-stack-overflow.patch + + # CVE-2013-0242 - upstream commit a445af0b + patch -p1 -i ${srcdir}/glibc-2.17-regexp-matcher-overrun.patch + + cd ${srcdir} + mkdir glibc-build + cd 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 "sbindir=/usr/bin" >> configparms + echo "rootsbindir=/usr/bin" >> configparms + + # remove hardening options for building libraries + CFLAGS=${CFLAGS/-fstack-protector/} + CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/} + + ${srcdir}/${_pkgname}-${pkgver}/configure --prefix=/usr \ + --libdir=/usr/lib --libexecdir=/usr/lib \ + --build=$CHOST --host=$_target \ + --with-headers=/${_sysroot}/include \ + --with-bugurl=https://labs.parabola.nu/ \ + --enable-add-ons=nptl,libidn \ + --enable-obsolete-rpc \ + --enable-kernel=2.6.32 \ + --enable-bind-now --disable-profile \ + --enable-stackguard-randomization \ + --enable-multi-arch + + # 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 + make + + # remove harding in preparation to run test-suite + sed -i '4,6d' configparms +} + +check() { + # bug to file - the linker commands need to be reordered + LDFLAGS=${LDFLAGS/--as-needed,/} + + cd ${srcdir}/glibc-build + make check +} + +package() { + cd ${srcdir}/glibc-build + + install -dm755 ${pkgdir}/etc + touch ${pkgdir}/etc/ld.so.conf + + make install_root=${pkgdir} install + + rm -f ${pkgdir}/etc/ld.so.{cache,conf} + + install -dm755 ${pkgdir}/usr/lib/{locale,systemd/system,tmpfiles.d} + + install -m644 ${srcdir}/${_pkgname}-${pkgver}/nscd/nscd.conf ${pkgdir}/etc/nscd.conf + install -m644 ${srcdir}/nscd.service ${pkgdir}/usr/lib/systemd/system + install -m644 ${srcdir}/nscd.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/nscd.conf + + install -m644 ${srcdir}/${_pkgname}-${pkgver}/posix/gai.conf ${pkgdir}/etc/gai.conf + + install -m755 ${srcdir}/locale-gen ${pkgdir}/usr/bin + + # create /etc/locale.gen + install -m644 ${srcdir}/locale.gen.txt ${pkgdir}/etc/locale.gen + sed -e '1,3d' -e 's|/| |g' -e 's|\\| |g' -e 's|^|#|g' \ + ${srcdir}/glibc-${pkgver}/localedata/SUPPORTED >> ${pkgdir}/etc/locale.gen + + # 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 + + cd $pkgdir + strip $STRIP_BINARIES usr/bin/{gencat,getconf,getent,iconv,iconvconfig} \ + usr/bin/{ldconfig,locale,localedef,nscd,makedb} \ + usr/bin/{pcprofiledump,pldd,rpcgen,sln,sprof} \ + usr/lib/getconf/* + [[ $CARCH = "i686" ]] && strip $STRIP_BINARIES usr/bin/lddlibc4 + + strip $STRIP_STATIC usr/lib/*.a + + strip $STRIP_SHARED usr/lib/{libanl,libBrokenLocale,libcidn,libcrypt}-*.so \ + usr/lib/libnss_{compat,db,dns,files,hesiod,nis,nisplus}-*.so \ + usr/lib/{libdl,libm,libnsl,libresolv,librt,libutil}-*.so \ + usr/lib/{libmemusage,libpcprofile,libSegFault}.so \ + usr/lib/{pt_chown,{audit,gconv}/*.so} +} diff --git a/libre/xtensa-unknown-elf-glibc/glibc-2.17-getaddrinfo-stack-overflow.patch b/libre/xtensa-unknown-elf-glibc/glibc-2.17-getaddrinfo-stack-overflow.patch new file mode 100644 index 000000000..aa916ac2c --- /dev/null +++ b/libre/xtensa-unknown-elf-glibc/glibc-2.17-getaddrinfo-stack-overflow.patch @@ -0,0 +1,47 @@ +diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c +index d95c2d1..2309281 100644 +--- a/sysdeps/posix/getaddrinfo.c ++++ b/sysdeps/posix/getaddrinfo.c +@@ -2489,11 +2489,27 @@ getaddrinfo (const char *name, const char *service, + __typeof (once) old_once = once; + __libc_once (once, gaiconf_init); + /* Sort results according to RFC 3484. */ +- struct sort_result results[nresults]; +- size_t order[nresults]; ++ struct sort_result *results; ++ size_t *order; + struct addrinfo *q; + struct addrinfo *last = NULL; + char *canonname = NULL; ++ bool malloc_results; ++ ++ malloc_results ++ = !__libc_use_alloca (nresults * (sizeof (*results) + sizeof (size_t))); ++ if (malloc_results) ++ { ++ results = malloc (nresults * (sizeof (*results) + sizeof (size_t))); ++ if (results == NULL) ++ { ++ __free_in6ai (in6ai); ++ return EAI_MEMORY; ++ } ++ } ++ else ++ results = alloca (nresults * (sizeof (*results) + sizeof (size_t))); ++ order = (size_t *) (results + nresults); + + /* Now we definitely need the interface information. */ + if (! check_pf_called) +@@ -2664,6 +2680,9 @@ getaddrinfo (const char *name, const char *service, + + /* Fill in the canonical name into the new first entry. */ + p->ai_canonname = canonname; ++ ++ if (malloc_results) ++ free (results); + } + + __free_in6ai (in6ai); +-- +1.7.1 + diff --git a/libre/xtensa-unknown-elf-glibc/glibc-2.17-regexp-matcher-overrun.patch b/libre/xtensa-unknown-elf-glibc/glibc-2.17-regexp-matcher-overrun.patch new file mode 100644 index 000000000..b108f9d42 --- /dev/null +++ b/libre/xtensa-unknown-elf-glibc/glibc-2.17-regexp-matcher-overrun.patch @@ -0,0 +1,137 @@ +diff --git a/posix/Makefile b/posix/Makefile +index 88d409f..2cacd21 100644 +--- a/posix/Makefile ++++ b/posix/Makefile +@@ -86,7 +86,7 @@ tests := tstgetopt testfnm runtests runptests \ + tst-rfc3484-3 \ + tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \ + bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \ +- bug-getopt5 tst-getopt_long1 ++ bug-getopt5 tst-getopt_long1 bug-regex34 + xtests := bug-ga2 + ifeq (yes,$(build-shared)) + test-srcs := globtest +@@ -199,5 +199,6 @@ bug-regex26-ENV = LOCPATH=$(common-objpfx)localedata + bug-regex30-ENV = LOCPATH=$(common-objpfx)localedata + bug-regex32-ENV = LOCPATH=$(common-objpfx)localedata + bug-regex33-ENV = LOCPATH=$(common-objpfx)localedata ++bug-regex34-ENV = LOCPATH=$(common-objpfx)localedata + tst-rxspencer-ARGS = --utf8 rxspencer/tests + tst-rxspencer-ENV = LOCPATH=$(common-objpfx)localedata +diff --git a/posix/bug-regex34.c b/posix/bug-regex34.c +new file mode 100644 +index 0000000..bb3b613 +--- /dev/null ++++ b/posix/bug-regex34.c +@@ -0,0 +1,46 @@ ++/* Test re_search with multi-byte characters in UTF-8. ++ Copyright (C) 2013 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#define _GNU_SOURCE 1 ++#include ++#include ++#include ++#include ++ ++static int ++do_test (void) ++{ ++ struct re_pattern_buffer r; ++ /* ကျွန်ုပ်x */ ++ const char *s = "\xe1\x80\x80\xe1\x80\xbb\xe1\x80\xbd\xe1\x80\x94\xe1\x80\xba\xe1\x80\xaf\xe1\x80\x95\xe1\x80\xbax"; ++ ++ if (setlocale (LC_ALL, "en_US.UTF-8") == NULL) ++ { ++ puts ("setlocale failed"); ++ return 1; ++ } ++ memset (&r, 0, sizeof (r)); ++ ++ re_compile_pattern ("[^x]x", 5, &r); ++ /* This was triggering a buffer overflow. */ ++ re_search (&r, s, strlen (s), 0, strlen (s), 0); ++ return 0; ++} ++ ++#define TEST_FUNCTION do_test () ++#include "../test-skeleton.c" +diff --git a/posix/regexec.c b/posix/regexec.c +index 7f2de85..5ca2bf6 100644 +--- a/posix/regexec.c ++++ b/posix/regexec.c +@@ -197,7 +197,7 @@ static int group_nodes_into_DFAstates (const re_dfa_t *dfa, + static int check_node_accept (const re_match_context_t *mctx, + const re_token_t *node, int idx) + internal_function; +-static reg_errcode_t extend_buffers (re_match_context_t *mctx) ++static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len) + internal_function; + + /* Entry point for POSIX code. */ +@@ -1160,7 +1160,7 @@ check_matching (re_match_context_t *mctx, int fl_longest_match, + || (BE (next_char_idx >= mctx->input.valid_len, 0) + && mctx->input.valid_len < mctx->input.len)) + { +- err = extend_buffers (mctx); ++ err = extend_buffers (mctx, next_char_idx + 1); + if (BE (err != REG_NOERROR, 0)) + { + assert (err == REG_ESPACE); +@@ -1738,7 +1738,7 @@ clean_state_log_if_needed (re_match_context_t *mctx, int next_state_log_idx) + && mctx->input.valid_len < mctx->input.len)) + { + reg_errcode_t err; +- err = extend_buffers (mctx); ++ err = extend_buffers (mctx, next_state_log_idx + 1); + if (BE (err != REG_NOERROR, 0)) + return err; + } +@@ -2792,7 +2792,7 @@ get_subexp (re_match_context_t *mctx, int bkref_node, int bkref_str_idx) + if (bkref_str_off >= mctx->input.len) + break; + +- err = extend_buffers (mctx); ++ err = extend_buffers (mctx, bkref_str_off + 1); + if (BE (err != REG_NOERROR, 0)) + return err; + +@@ -4102,7 +4102,7 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node, + + static reg_errcode_t + internal_function __attribute_warn_unused_result__ +-extend_buffers (re_match_context_t *mctx) ++extend_buffers (re_match_context_t *mctx, int min_len) + { + reg_errcode_t ret; + re_string_t *pstr = &mctx->input; +@@ -4111,8 +4111,10 @@ extend_buffers (re_match_context_t *mctx) + if (BE (INT_MAX / 2 / sizeof (re_dfastate_t *) <= pstr->bufs_len, 0)) + return REG_ESPACE; + +- /* Double the lengthes of the buffers. */ +- ret = re_string_realloc_buffers (pstr, MIN (pstr->len, pstr->bufs_len * 2)); ++ /* Double the lengthes of the buffers, but allocate at least MIN_LEN. */ ++ ret = re_string_realloc_buffers (pstr, ++ MAX (min_len, ++ MIN (pstr->len, pstr->bufs_len * 2))); + if (BE (ret != REG_NOERROR, 0)) + return ret; + +-- +1.7.1 + diff --git a/libre/xtensa-unknown-elf-glibc/glibc-2.17-sync-with-linux37.patch b/libre/xtensa-unknown-elf-glibc/glibc-2.17-sync-with-linux37.patch new file mode 100644 index 000000000..24b25c997 --- /dev/null +++ b/libre/xtensa-unknown-elf-glibc/glibc-2.17-sync-with-linux37.patch @@ -0,0 +1,130 @@ +diff --git a/sysdeps/gnu/netinet/tcp.h b/sysdeps/gnu/netinet/tcp.h +index 06e8414..b62a696 100644 +--- a/sysdeps/gnu/netinet/tcp.h ++++ b/sysdeps/gnu/netinet/tcp.h +@@ -37,20 +37,29 @@ + /* + * User-settable options (used with setsockopt). + */ +-#define TCP_NODELAY 1 /* Don't delay send to coalesce packets */ +-#define TCP_MAXSEG 2 /* Set maximum segment size */ +-#define TCP_CORK 3 /* Control sending of partial frames */ +-#define TCP_KEEPIDLE 4 /* Start keeplives after this period */ +-#define TCP_KEEPINTVL 5 /* Interval between keepalives */ +-#define TCP_KEEPCNT 6 /* Number of keepalives before death */ +-#define TCP_SYNCNT 7 /* Number of SYN retransmits */ +-#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */ +-#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */ +-#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ +-#define TCP_INFO 11 /* Information about this connection. */ +-#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */ +-#define TCP_CONGESTION 13 /* Congestion control algorithm. */ +-#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ ++#define TCP_NODELAY 1 /* Don't delay send to coalesce packets */ ++#define TCP_MAXSEG 2 /* Set maximum segment size */ ++#define TCP_CORK 3 /* Control sending of partial frames */ ++#define TCP_KEEPIDLE 4 /* Start keeplives after this period */ ++#define TCP_KEEPINTVL 5 /* Interval between keepalives */ ++#define TCP_KEEPCNT 6 /* Number of keepalives before death */ ++#define TCP_SYNCNT 7 /* Number of SYN retransmits */ ++#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */ ++#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */ ++#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ ++#define TCP_INFO 11 /* Information about this connection. */ ++#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */ ++#define TCP_CONGESTION 13 /* Congestion control algorithm. */ ++#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ ++#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */ ++#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/ ++#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */ ++#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */ ++#define TCP_REPAIR 19 /* TCP sock is under repair right now */ ++#define TCP_REPAIR_QUEUE 20 /* Set TCP queue to repair */ ++#define TCP_QUEUE_SEQ 21 /* Set sequence number of repaired queue. */ ++#define TCP_REPAIR_OPTIONS 22 /* Repair TCP connection options */ ++#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */ + + #ifdef __USE_MISC + # include +@@ -173,7 +182,9 @@ enum + # define TCPI_OPT_TIMESTAMPS 1 + # define TCPI_OPT_SACK 2 + # define TCPI_OPT_WSCALE 4 +-# define TCPI_OPT_ECN 8 ++# define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */ ++# define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */ ++# define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */ + + /* Values for tcpi_state. */ + enum tcp_ca_state +@@ -241,6 +252,49 @@ struct tcp_md5sig + u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */ + }; + ++/* For socket repair options. */ ++struct tcp_repair_opt ++{ ++ u_int32_t opt_code; ++ u_int32_t opt_val; ++}; ++ ++/* Queue to repair, for TCP_REPAIR_QUEUE. */ ++enum ++{ ++ TCP_NO_QUEUE, ++ TCP_RECV_QUEUE, ++ TCP_SEND_QUEUE, ++ TCP_QUEUES_NR, ++}; ++ ++/* For cookie transactions socket options. */ ++#define TCP_COOKIE_MIN 8 /* 64-bits */ ++#define TCP_COOKIE_MAX 16 /* 128-bits */ ++#define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX) ++ ++/* Flags for both getsockopt and setsockopt */ ++#define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */ ++#define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies, ++ * supercedes everything. */ ++ ++/* Flags for getsockopt */ ++#define TCP_S_DATA_IN (1 << 2) /* Was data received? */ ++#define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */ ++ ++#define TCP_MSS_DEFAULT 536U /* IPv4 (RFC1122, RFC2581) */ ++#define TCP_MSS_DESIRED 1220U /* IPv6 (tunneled), EDNS0 (RFC3226) */ ++ ++struct tcp_cookie_transactions ++{ ++ u_int16_t tcpct_flags; ++ u_int8_t __tcpct_pad1; ++ u_int8_t tcpct_cookie_desired; ++ u_int16_t tcpct_s_data_desired; ++ u_int16_t tcpct_used; ++ u_int8_t tcpct_value[TCP_MSS_DEFAULT]; ++}; ++ + #endif /* Misc. */ + + #endif /* netinet/tcp.h */ +diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h +index df8f167..eadd7d9 100644 +--- a/sysdeps/unix/sysv/linux/bits/socket.h ++++ b/sysdeps/unix/sysv/linux/bits/socket.h +@@ -1,6 +1,5 @@ + /* System-specific socket constants and types. Linux version. +- Copyright (C) 1991, 1992, 1994-2001, 2004, 2006-2010, 2011, 2012 +- Free Software Foundation, Inc. ++ Copyright (C) 1991-2013 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or +@@ -208,6 +207,8 @@ enum + #define MSG_MORE MSG_MORE + MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return.*/ + #define MSG_WAITFORONE MSG_WAITFORONE ++ MSG_FASTOPEN = 0x20000000, /* Send data in TCP SYN. */ ++#define MSG_FASTOPEN MSG_FASTOPEN + + MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file + descriptor received through diff --git a/libre/xtensa-unknown-elf-glibc/locale-gen b/libre/xtensa-unknown-elf-glibc/locale-gen new file mode 100644 index 000000000..5aff344c4 --- /dev/null +++ b/libre/xtensa-unknown-elf-glibc/locale-gen @@ -0,0 +1,42 @@ +#!/bin/sh + +set -e + +LOCALEGEN=/etc/locale.gen +LOCALES=/usr/share/i18n/locales +if [ -n "$POSIXLY_CORRECT" ]; then + unset POSIXLY_CORRECT +fi + + +[ -f $LOCALEGEN -a -s $LOCALEGEN ] || exit 0; + +# Remove all old locale dir and locale-archive before generating new +# locale data. +rm -rf /usr/lib/locale/* || true + +umask 022 + +is_entry_ok() { + if [ -n "$locale" -a -n "$charset" ] ; then + true + else + echo "error: Bad entry '$locale $charset'" + false + fi +} + +echo "Generating locales..." +while read locale charset; do \ + case $locale in \#*) continue;; "") continue;; esac; \ + is_entry_ok || continue + echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \ + echo -n ".$charset"; \ + echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \ + echo -n '...'; \ + if [ -f $LOCALES/$locale ]; then input=$locale; else \ + input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; fi; \ + localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias $locale; \ + echo ' done'; \ +done < $LOCALEGEN +echo "Generation complete." diff --git a/libre/xtensa-unknown-elf-glibc/locale.gen.txt b/libre/xtensa-unknown-elf-glibc/locale.gen.txt new file mode 100644 index 000000000..ccdd81734 --- /dev/null +++ b/libre/xtensa-unknown-elf-glibc/locale.gen.txt @@ -0,0 +1,23 @@ +# Configuration file for locale-gen +# +# lists of locales that are to be generated by the locale-gen command. +# +# Each line is of the form: +# +# +# +# where is one of the locales given in /usr/share/i18n/locales +# and is one of the character sets listed in /usr/share/i18n/charmaps +# +# Examples: +# en_US ISO-8859-1 +# en_US.UTF-8 UTF-8 +# de_DE ISO-8859-1 +# de_DE@euro ISO-8859-15 +# +# The locale-gen command will generate all the locales, +# placing them in /usr/lib/locale. +# +# A list of supported locales is included in this file. +# Uncomment the ones you need. +# diff --git a/libre/xtensa-unknown-elf-glibc/nscd.service b/libre/xtensa-unknown-elf-glibc/nscd.service new file mode 100644 index 000000000..bc80a0730 --- /dev/null +++ b/libre/xtensa-unknown-elf-glibc/nscd.service @@ -0,0 +1,17 @@ +[Unit] +Description=Name Service Cache Daemon +After=syslog.target + +[Service] +Type=forking +ExecStart=/usr/sbin/nscd +ExecStop=/usr/sbin/nscd --shutdown +ExecReload=/usr/sbin/nscd -i passwd +ExecReload=/usr/sbin/nscd -i group +ExecReload=/usr/sbin/nscd -i hosts +ExecReload=/usr/sbin/nscd -i services +Restart=always +PIDFile=/run/nscd/nscd.pid + +[Install] +WantedBy=multi-user.target diff --git a/libre/xtensa-unknown-elf-glibc/nscd.tmpfiles b/libre/xtensa-unknown-elf-glibc/nscd.tmpfiles new file mode 100644 index 000000000..8a24a785e --- /dev/null +++ b/libre/xtensa-unknown-elf-glibc/nscd.tmpfiles @@ -0,0 +1 @@ +d /run/nscd 0755 root root diff --git a/libre/xtensa-unknown-elf-glibc/xtensa-unknown-elf-glibc.install b/libre/xtensa-unknown-elf-glibc/xtensa-unknown-elf-glibc.install new file mode 100644 index 000000000..f8147a6cf --- /dev/null +++ b/libre/xtensa-unknown-elf-glibc/xtensa-unknown-elf-glibc.install @@ -0,0 +1,19 @@ +infodir=usr/share/info +filelist=(libc.info{,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11}) + +post_upgrade() { + ldconfig -r . + locale-gen + + [[ -x usr/bin/install-info ]] || return 0 + for file in ${filelist[@]}; do + install-info $infodir/$file.gz $infodir/dir 2> /dev/null + done +} + +pre_remove() { + [[ -x usr/bin/install-info ]] || return 0 + for file in ${filelist[@]}; do + install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null + done +} diff --git a/libre/xtensa-unknown-elf-linux-libre-api-headers/PKGBUILD b/libre/xtensa-unknown-elf-linux-libre-api-headers/PKGBUILD index e27c1ba35..23dada50b 100644 --- a/libre/xtensa-unknown-elf-linux-libre-api-headers/PKGBUILD +++ b/libre/xtensa-unknown-elf-linux-libre-api-headers/PKGBUILD @@ -5,15 +5,15 @@ # toolchain build order: linux-libre-api-headers->glibc->binutils->gcc->binutils->glibc export ARCH=xtensa _target=xtensa-unknown-elf -_sysroot="/usr/${_target}" +_sysroot="usr/$CHOST/${_target}" pkgname=${_target}-linux-libre-api-headers _basekernel=3.8 _sublevel=4 pkgver=${_basekernel}.${_sublevel} pkgrel=1 -pkgdesc="Kernel headers sanitized for use in userspace" -arch=('i686' 'x86_64') +pkgdesc="Kernel headers sanitized for use in userspace for Xtensa processors" +arch=('i686' 'x86_64' 'mips64el') url="http://www.gnu.org/software/libc" license=('GPL2') provides=("${_target}-linux-api-headers=${pkgver}") @@ -37,11 +37,11 @@ build() { package() { cd ${srcdir}/linux-${_basekernel} - make ARCH=${ARCH} INSTALL_HDR_PATH=${pkgdir}${_sysroot}/usr headers_install + make ARCH=${ARCH} INSTALL_HDR_PATH=${pkgdir}/${_sysroot} headers_install # use headers from libdrm - rm -r ${pkgdir}${_sysroot}/usr/include/drm - + rm -r ${pkgdir}/${_sysroot}/include/drm + # clean-up unnecessary files generated during install find ${pkgdir} \( -name .install -o -name ..install.cmd \) -delete } -- cgit v1.2.3 From 27de30007e987b9c3911198da203a853dabc13d1 Mon Sep 17 00:00:00 2001 From: Márcio Alexandre Silva Delgado Date: Thu, 4 Jul 2013 00:20:18 -0300 Subject: xtensa-unknown-elf: fixing pkg --- libre/xtensa-unknown-elf-binutils/PKGBUILD | 67 +++++++++--------------------- libre/xtensa-unknown-elf-gcc/PKGBUILD | 58 +++++++------------------- 2 files changed, 35 insertions(+), 90 deletions(-) (limited to 'libre/xtensa-unknown-elf-gcc/PKGBUILD') diff --git a/libre/xtensa-unknown-elf-binutils/PKGBUILD b/libre/xtensa-unknown-elf-binutils/PKGBUILD index 2e29d1ff4..be9284c45 100644 --- a/libre/xtensa-unknown-elf-binutils/PKGBUILD +++ b/libre/xtensa-unknown-elf-binutils/PKGBUILD @@ -1,23 +1,21 @@ # $Id: PKGBUILD 182407 2013-04-10 07:34:20Z allan $ # Maintainer: Allan McRae # Maintainer (Parabola): André Silva -# Contributor (Parabola): Márcio Silva +# Maintainer (Parabola): Márcio Silva _pkgname=binutils _target="xtensa-unknown-elf" -_sysroot="/usr/$CHOST/${_target}" pkgname=${_target}-binutils pkgver=2.23.2 -pkgrel=2.3 +pkgrel=2.4 pkgdesc="A set of programs to assemble and manipulate binary and object files for the Xtensa architecture" arch=('i686' 'x86_64' 'mips64el') url="http://www.gnu.org/software/binutils/" license=('GPL') groups=("${_target}-base-devel") depends=('glibc>=2.17' 'zlib') -checkdepends=('dejagnu' 'bc') -options=('!libtool' '!distcc' '!ccache') +options=('!libtool') install=${_target}-binutils.install source=(ftp://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.bz2{,.sig} binutils-2.23.2-texinfo-5.0.patch) @@ -30,10 +28,7 @@ prepare() { # http://sourceware.org/git/?p=binutils.git;a=patch;h=e02bf935 # http://sourceware.org/git/?p=binutils.git;a=patch;h=935f8542 - patch -p1 -i ${srcdir}/binutils-2.23.2-texinfo-5.0.patch - - # hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS" - sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure + patch -Np1 -i ${srcdir}/binutils-2.23.2-texinfo-5.0.patch mkdir ${srcdir}/binutils-build } @@ -41,56 +36,34 @@ prepare() { build() { cd ${srcdir}/binutils-build - CFLAGS=" -pipe " \ - CXXFLAGS=" -pipe " \ ${srcdir}/binutils-${pkgver}/configure --prefix=/usr \ - --with-lib-path=/usr/lib:/usr/local/lib \ - --with-bugurl=https://labs.parabola.nu/ \ - --enable-ld=default --enable-gold \ - --enable-plugins --enable-threads \ - --with-pic --enable-shared \ - --disable-werror --disable-multilib \ - --target=${_target} + --target=${_target} \ + --bindir=/usr/bin --sbindir=/usr/bin \ + --disable-nls \ + --enable-shared \ + --disable-multilib \ + --with-bugurl=https://labs.parabola.nu/ +# --libdir=/usr/lib --libexecdir=/usr/lib --with-lib-path=/usr/lib \ +# --enable-ld=default --enable-gold \ +# --enable-plugins --enable-threads \ +# --with-pic \ +# --disable-werror \ # check the host environment and makes sure all the necessary tools are available make configure-host - make tooldir=/usr -} - -check() { - cd ${srcdir}/binutils-build - - # unset LDFLAGS as testsuite makes assumptions about which ones are active - # do not abort on errors - manually check log files - make LDFLAGS="" -k check || true + make } package() { cd ${srcdir}/binutils-build - make prefix=${pkgdir}/usr tooldir=${pkgdir}/usr install - - # Add some useful headers - install -m644 ${srcdir}/binutils-${pkgver}/include/libiberty.h ${pkgdir}/usr/include - install -m644 ${srcdir}/binutils-${pkgver}/include/demangle.h ${pkgdir}/usr/include - - # Install PIC libiberty.a - install -m644 libiberty/pic/libiberty.a ${pkgdir}/usr/lib + make prefix=${pkgdir}/usr install # Remove unwanted files rm ${pkgdir}/usr/share/man/man1/${_target}-{dlltool,nlmconv,windres,windmc}* - rm ${pkgdir}/usr/share/info/{configure,standards}.info # Remove unnecessary files and folders - rm -f $pkgdir/usr/bin/ar - rm -f $pkgdir/usr/bin/as - rm -f $pkgdir/usr/bin/ld - rm -f $pkgdir/usr/bin/nm - rm -f $pkgdir/usr/bin/objdump - rm -f $pkgdir/usr/bin/ranlib - rm -f $pkgdir/usr/bin/strip - rm -f $pkgdir/usr/bin/objcopy - rm -f $pkgdir/usr/include - rm -f $pkgdir/usr/lib/libiberty.a - rm -rf $pkgdir/usr/share + rm $pkgdir/usr/${_target}/bin/* && rmdir $pkgdir/usr/${_target}/bin + rm $pkgdir/usr/$CHOST/${_target}/include/* && rmdir $pkgdir/usr/$CHOST/${_target}/include + rm $pkgdir/usr/share/info/* && rmdir $pkgdir/usr/share/info } diff --git a/libre/xtensa-unknown-elf-gcc/PKGBUILD b/libre/xtensa-unknown-elf-gcc/PKGBUILD index 6081151b7..797f67f9e 100644 --- a/libre/xtensa-unknown-elf-gcc/PKGBUILD +++ b/libre/xtensa-unknown-elf-gcc/PKGBUILD @@ -10,7 +10,6 @@ _sysroot="/usr/$CHOST/${_target}" pkgname=${_target}-gcc pkgver=4.8.1 pkgrel=1 -#_snapshot=4.8-20130502 pkgdesc="The GNU Compiler Collection for Xtensa processors" arch=('i686' 'x86_64' 'mips64el') license=('GPL' 'LGPL' 'FDL' 'custom') @@ -19,15 +18,9 @@ makedepends=("binutils>=2.23" 'libmpc' 'cloog' 'gcc-ada' 'doxygen') checkdepends=('dejagnu' 'inetutils') options=('!libtool' '!emptydirs') source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2) - #ftp://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-${_snapshot}.tar.bz2 md5sums=('3b2386c114cd74185aa3754b58a79304') - -if [ -n "${_snapshot}" ]; then - _basedir=gcc-${_snapshot} -else - _basedir=gcc-${pkgver} -fi +_basedir=gcc-${pkgver} prepare() { cd ${srcdir}/${_basedir} @@ -40,28 +33,23 @@ prepare() { echo ${pkgver} > gcc/BASE-VER - # hack! - some configure tests for header files using "$CPP $CPPFLAGS" - sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure - mkdir ${srcdir}/gcc-build } build() { cd ${srcdir}/gcc-build - # using -pipe causes spurious test-suite failures - # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565 - CFLAGS=${CFLAGS/-pipe/} - CXXFLAGS=${CXXFLAGS/-pipe/} - - LD_LIBRARY_PATH=/usr/lib ${srcdir}/${_basedir}/configure --prefix=/usr \ - --disable-shared --disable-threads --disable-multilib \ - --enable-languages=c \ - --disable-nls \ - --target=$_target -# --build=x86_64-unknown-linux-gnu \ -# --without-headers \ -# --disable-multilib --disable-libssp --disable-werror \ + ${srcdir}/${_basedir}/configure --prefix=/home/marcio/src/xtensa-elf/tools \ + --target=${_target} \ + --disable-multilib \ + --disable-nls \ + --disable-shared \ + --disable-threads \ + --enable-languages=c \ + --disable-libquadmath \ + --disable-libssp \ + --with-newlib +# --disable-werror \ # --libdir=/usr/lib --libexecdir=/usr/lib \ # --mandir=/usr/share/man --infodir=/usr/share/info \ # --with-bugurl=https://labs.parabola.nu/ \ @@ -74,30 +62,14 @@ build() { # --enable-lto --enable-gold --enable-ld=default \ # --enable-plugin --with-plugin-ld=ld.gold \ # --with-linker-hash-style=gnu --disable-install-libiberty \ -# --with-as=/usr/bin/${_target}-as --with-ld=/usr/bin/${_target}-ld \ -# --disable-multilib --disable-libssp --disable-werror \ # --enable-checking=release \ -# --target=${_target} \ -# --with-newlib - make - + make all-gcc + # make documentation cd ${_target}/libstdc++-v3 make doc-man-doxygen } -check() { - cd ${srcdir}/gcc-build - - # increase stack size to prevent test failures - # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31827 - ulimit -s 32768 - - # do not abort on error as some are "expected" - make -k check || true - ${srcdir}/${_basedir}/contrib/test_summary -} - package() { pkgdesc="The GNU Compiler Collection" @@ -107,7 +79,7 @@ package() cd ${srcdir}/gcc-build - make -j1 DESTDIR=${pkgdir} install + make -j1 DESTDIR=${pkgdir} install-gcc install -d $pkgdir/usr/share/gdb/auto-load/usr/lib mv $pkgdir{,/usr/share/gdb/auto-load}/usr/lib/libstdc++.so.6.0.18-gdb.py -- cgit v1.2.3 From 1b4d48a4e1adc646897e0de4a17b5d702656f9f9 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Thu, 4 Jul 2013 13:35:28 -0300 Subject: xtensa-unknown-elf-gcc: fix issues on PKGBUILD --- libre/xtensa-unknown-elf-gcc/PKGBUILD | 73 +++++++---------------------------- 1 file changed, 13 insertions(+), 60 deletions(-) (limited to 'libre/xtensa-unknown-elf-gcc/PKGBUILD') diff --git a/libre/xtensa-unknown-elf-gcc/PKGBUILD b/libre/xtensa-unknown-elf-gcc/PKGBUILD index 797f67f9e..1d81b0385 100644 --- a/libre/xtensa-unknown-elf-gcc/PKGBUILD +++ b/libre/xtensa-unknown-elf-gcc/PKGBUILD @@ -10,11 +10,11 @@ _sysroot="/usr/$CHOST/${_target}" pkgname=${_target}-gcc pkgver=4.8.1 pkgrel=1 -pkgdesc="The GNU Compiler Collection for Xtensa processors" +pkgdesc="The GNU Compiler Collection for the Xtensa architecture" arch=('i686' 'x86_64' 'mips64el') license=('GPL' 'LGPL' 'FDL' 'custom') url="http://gcc.gnu.org" -makedepends=("binutils>=2.23" 'libmpc' 'cloog' 'gcc-ada' 'doxygen') +makedepends=('binutils>=2.23' 'libmpc' 'cloog' 'gcc-ada' 'doxygen') checkdepends=('dejagnu' 'inetutils') options=('!libtool' '!emptydirs') source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2) @@ -33,13 +33,16 @@ prepare() { echo ${pkgver} > gcc/BASE-VER + # hack! - some configure tests for header files using "$CPP $CPPFLAGS" + sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure + mkdir ${srcdir}/gcc-build } build() { cd ${srcdir}/gcc-build - ${srcdir}/${_basedir}/configure --prefix=/home/marcio/src/xtensa-elf/tools \ + ${srcdir}/${_basedir}/configure --prefix=/usr \ --target=${_target} \ --disable-multilib \ --disable-nls \ @@ -48,9 +51,9 @@ build() { --enable-languages=c \ --disable-libquadmath \ --disable-libssp \ - --with-newlib -# --disable-werror \ -# --libdir=/usr/lib --libexecdir=/usr/lib \ + --with-newlib \ + --disable-werror \ + --libdir=/usr/lib --libexecdir=/usr/lib # --mandir=/usr/share/man --infodir=/usr/share/info \ # --with-bugurl=https://labs.parabola.nu/ \ # --disable-shared --enable-threads=posix \ @@ -64,15 +67,11 @@ build() { # --with-linker-hash-style=gnu --disable-install-libiberty \ # --enable-checking=release \ make all-gcc - - # make documentation - cd ${_target}/libstdc++-v3 - make doc-man-doxygen } package() { - pkgdesc="The GNU Compiler Collection" + pkgdesc="The GNU Compiler Collection for the Xtensa architecture" depends=("gcc-libs=$pkgver-$pkgrel" 'binutils>=2.23' 'libmpc' 'cloog') groups=("${_target}-devel") install=${_target}-gcc.install @@ -81,56 +80,10 @@ package() make -j1 DESTDIR=${pkgdir} install-gcc - install -d $pkgdir/usr/share/gdb/auto-load/usr/lib - mv $pkgdir{,/usr/share/gdb/auto-load}/usr/lib/libstdc++.so.6.0.18-gdb.py - - # unfortunately it is much, much easier to install the lot and clean-up the mess... - rm $pkgdir/usr/bin/{{${_target}-,}gfortran,{${_target}-,}gccgo,gnat*} - rm $pkgdir/usr/lib/*.so* - rm $pkgdir/usr/lib/lib{atomic,gfortran,go{,begin},iberty,objc}.a - rm $pkgdir/usr/lib/libgfortran.spec - rm -r $pkgdir/usr/lib/gcc/${_target}-/${pkgver}/{ada{include,lib},finclude,include/objc} - rm $pkgdir/usr/lib/gcc/${_target}-/${pkgver}/{cc1obj{,plus},f951,gnat1,go1} - rm $pkgdir/usr/lib/gcc/${_target}-/${pkgver}/{libcaf_single,libgfortranbegin}.a - rm -r $pkgdir/usr/lib/go - rm $pkgdir/usr/share/info/{gccgo,gfortran,gnat*,libgomp,libquadmath,libitm}.info - rm $pkgdir/usr/share/locale/{de,fr}/LC_MESSAGES/libstdc++.mo - rm $pkgdir/usr/share/man/man1/{gccgo,gfortran}.1 - # many packages expect this symlinks ln -s ${_target}-gcc ${pkgdir}/usr/bin/${_target}-cc - # POSIX conformance launcher scripts for c89 and c99 - cat > $pkgdir/usr/bin/${_target}-c89 <<"EOF" -#!/bin/sh -fl="-std=c89" -for opt; do - case "$opt" in - -ansi|-std=c89|-std=iso9899:1990) fl="";; - -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2 - exit 1;; - esac -done -exec ${_target}-gcc $fl ${1+"$@"} -EOF - - cat > $pkgdir/usr/bin/${_target}-c99 <<"EOF" -#!/bin/sh -fl="-std=c99" -for opt; do - case "$opt" in - -std=c99|-std=iso9899:1999) fl="";; - -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2 - exit 1;; - esac -done -exec ${_target}-gcc $fl ${1+"$@"} -EOF - - chmod 755 $pkgdir/usr/bin/${_target}-c{8,9}9 - - - # Install Runtime Library Exception - install -Dm644 ${srcdir}/${_basedir}/COPYING.RUNTIME \ - ${pkgdir}/usr/share/licenses/${_target}/RUNTIME.LIBRARY.EXCEPTION + # Remove unnecessary files and folders + rm $pkgdir/usr/share/info/* && rmdir $pkgdir/usr/share/info + rm $pkgdir/man/man7/* && rmdir $pkgdir/man/man7 } -- cgit v1.2.3 From 6833660b7f8f829054ea8a135f057d4f854c05d6 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Thu, 4 Jul 2013 13:40:52 -0300 Subject: xtensa-unknown-elf-gcc: add coadde as maintainer too --- libre/xtensa-unknown-elf-gcc/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libre/xtensa-unknown-elf-gcc/PKGBUILD') diff --git a/libre/xtensa-unknown-elf-gcc/PKGBUILD b/libre/xtensa-unknown-elf-gcc/PKGBUILD index 1d81b0385..2134d7470 100644 --- a/libre/xtensa-unknown-elf-gcc/PKGBUILD +++ b/libre/xtensa-unknown-elf-gcc/PKGBUILD @@ -1,7 +1,7 @@ # $Id: PKGBUILD 186915 2013-05-31 23:25:14Z allan $ # Maintainer: Allan McRae # Maintainer (Parabola): André Silva -# Contributor (Parabola): Márcio Silva +# Maintainer (Parabola): Márcio Silva _pkgname=gcc _target="xtensa-unknown-elf" -- cgit v1.2.3 From 25f3d1275407c55db135966eda8ce31ea4ca892b Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Thu, 4 Jul 2013 13:49:16 -0300 Subject: xtensa-unknown-elf-gcc: fix issue path to remove unnessaries files on PKGBUILD --- libre/xtensa-unknown-elf-gcc/PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libre/xtensa-unknown-elf-gcc/PKGBUILD') diff --git a/libre/xtensa-unknown-elf-gcc/PKGBUILD b/libre/xtensa-unknown-elf-gcc/PKGBUILD index 2134d7470..02611d173 100644 --- a/libre/xtensa-unknown-elf-gcc/PKGBUILD +++ b/libre/xtensa-unknown-elf-gcc/PKGBUILD @@ -1,7 +1,7 @@ # $Id: PKGBUILD 186915 2013-05-31 23:25:14Z allan $ # Maintainer: Allan McRae # Maintainer (Parabola): André Silva -# Maintainer (Parabola): Márcio Silva +# Contributor (Parabola): Márcio Silva _pkgname=gcc _target="xtensa-unknown-elf" @@ -85,5 +85,5 @@ package() # Remove unnecessary files and folders rm $pkgdir/usr/share/info/* && rmdir $pkgdir/usr/share/info - rm $pkgdir/man/man7/* && rmdir $pkgdir/man/man7 + rm $pkgdir/usr/share/man/man7/* && rmdir $pkgdir/usr/share/man/man7 } -- cgit v1.2.3