diff options
Diffstat (limited to 'core/gcc/PKGBUILD')
-rw-r--r-- | core/gcc/PKGBUILD | 217 |
1 files changed, 123 insertions, 94 deletions
diff --git a/core/gcc/PKGBUILD b/core/gcc/PKGBUILD index c6d78cabd..c2d3d3650 100644 --- a/core/gcc/PKGBUILD +++ b/core/gcc/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 197286 2013-10-25 01:09:21Z allan $ +# $Id: PKGBUILD 202694 2013-12-25 03:04:31Z allan $ # Maintainer: Allan McRae <allan@archlinux.org> # toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc @@ -10,8 +10,9 @@ else pkgname=('gcc' 'gcc-libs' 'gcc-fortran' 'gcc-objc') fi pkgver=4.8.2 -pkgrel=3 -#_snapshot=4.8-20130725 +_pkgver=4.8 +pkgrel=7 +_snapshot=4.8-20131219 pkgdesc="The GNU Compiler Collection" arch=('i686' 'x86_64' 'mips64el') license=('GPL' 'LGPL' 'FDL' 'custom') @@ -20,11 +21,13 @@ makedepends=('binutils>=2.23' 'libmpc' 'cloog' 'doxygen') [[ "$CARCH" != "mips64el" ]] && makedepends+=('gcc-ada') checkdepends=('dejagnu' 'inetutils') options=('!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 - gcc-4.8-filename-output.patch) -md5sums=('a3d7d63b9cb6b6ea049469a0c4a43c9d' - '40cb437805e2f7a006aa0d0c3098ab0f') +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 + gcc-4.8-filename-output.patch + gcc-4.8-lambda-ICE.patch) +md5sums=('666ef08f87649f941bc5512e13a88fdc' + '40cb437805e2f7a006aa0d0c3098ab0f' + '6eb6e080dbf7bc6825f53a0aaa6c4ef9') if [ -n "${_snapshot}" ]; then _basedir=gcc-${_snapshot} @@ -32,6 +35,8 @@ else _basedir=gcc-${pkgver} fi +_libdir="usr/lib/gcc/$CHOST/$pkgver" + prepare() { cd ${srcdir}/${_basedir} @@ -49,6 +54,13 @@ prepare() { # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57653 patch -p0 -i ${srcdir}/gcc-4.8-filename-output.patch + + # http://gcc.gnu.org/bugzilla//show_bug.cgi?id=56710 - commit 3d1f8279 + patch -p1 -i ${srcdir}/gcc-4.8-lambda-ICE.patch + + # installing libiberty headers is broken + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56780#c6 + sed -i 's#@target_header_dir@#libiberty#' libiberty/Makefile.in mkdir ${srcdir}/gcc-build } @@ -73,9 +85,6 @@ build() { if [[ "${CARCH}" != "mips64el" ]]; then languages=c,c++,ada,fortran,go,lto,objc,obj-c++ - # The ancient MIPS ABI has possible requirements incompatible - # with GNU hash. - extra="--with-linker-hash-style=gnu" else languages=c,c++,fortran,lto,objc,obj-c++ fi @@ -88,19 +97,17 @@ build() { --enable-shared --enable-threads=posix \ --with-system-zlib --enable-__cxa_atexit \ --disable-libunwind-exceptions --enable-clocale=gnu \ - --disable-libstdcxx-pch \ + --disable-libstdcxx-pch --disable-libssp \ --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 \ - $extra --disable-install-libiberty \ - --disable-multilib --disable-libssp --disable-werror \ + --enable-lto --enable-plugin --enable-install-libiberty \ + --with-linker-hash-style=gnu \ + --disable-multilib --disable-werror \ --enable-checking=release make # make documentation - cd $CHOST/libstdc++-v3 - make doc-man-doxygen + make -C $CHOST/libstdc++-v3/doc doc-man-doxygen } check() { @@ -123,30 +130,43 @@ package_gcc-libs() pkgdesc="Runtime libraries shipped by GCC" groups=('base') depends=('glibc>=2.17') + options=('!emptydirs') install=gcc-libs.install cd ${srcdir}/gcc-build - make -j1 -C $CHOST/libgcc DESTDIR=${pkgdir} install-shared - for lib in libmudflap libgomp libstdc++-v3/src; do - make -j1 -C $CHOST/$lib DESTDIR=${pkgdir} install-toolexeclibLTLIBRARIES - done - [ "$CARCH" != "mips64el" ] && for lib in libitm libsanitizer/asan; do - make -j1 -C $CHOST/$lib DESTDIR=${pkgdir} install-toolexeclibLTLIBRARIES + + make -C $CHOST/libgcc DESTDIR=${pkgdir} install-shared + rm ${pkgdir}/${_libdir}/libgcc_eh.a + + for lib in libmudflap \ + libgomp \ + libitm \ + libatomic \ + libstdc++-v3/src \ + libquadmath \ + libgfortran \ + libsanitizer/asan; do + # Skip libitm and asan on mips64el + test "$CARCH" = "mips64el" && + echo "$lib" | grep -q "libitm libsanitizer/asan" && + continue + make -C $CHOST/$lib DESTDIR=${pkgdir} install-toolexeclibLTLIBRARIES done - make -j1 -C $CHOST/libstdc++-v3/po DESTDIR=${pkgdir} install - make -j1 -C $CHOST/libgomp DESTDIR=${pkgdir} install-info - [ "$CARCH" != "mips64el" ] && make -j1 -C $CHOST/libitm DESTDIR=${pkgdir} install-info - - make -j1 DESTDIR=${pkgdir} install-target-libquadmath - make -j1 DESTDIR=${pkgdir} install-target-libgfortran - make -j1 DESTDIR=${pkgdir} install-target-libobjc + [[ $CARCH == "x86_64" ]] && \ + make -C $CHOST/libsanitizer/tsan DESTDIR=${pkgdir} install-toolexeclibLTLIBRARIES - # remove unnecessary files installed by install-target-{libquadmath,libgfortran,libobjc} - rm -r ${pkgdir}/usr/lib/{gcc/,libgfortran.spec} - - # remove static libraries - find ${pkgdir} -name *.a -delete + make -C $CHOST/libobjc DESTDIR=${pkgdir} install-libs + + make -C $CHOST/libstdc++-v3/po DESTDIR=${pkgdir} install + + for lib in libgomp \ + libitm \ + libquadmath; do + # Skip libitm in mips64el + test "$CARCH" = "mips64el" && test "$lib" = "libitm" && continue + make -C $CHOST/$lib DESTDIR=${pkgdir} install-info + done # Install Runtime Library Exception install -Dm644 ${srcdir}/${_basedir}/COPYING.RUNTIME \ @@ -162,28 +182,45 @@ package_gcc() install=gcc.install cd ${srcdir}/gcc-build + + make -C gcc DESTDIR=${pkgdir} install-driver install-cpp install-gcc-ar \ + c++.install-common install-headers install-plugin install-lto-wrapper + + install -m755 gcc/gcov $pkgdir/usr/bin/ + install -m755 -t $pkgdir/${_libdir}/ gcc/{cc1,cc1plus,collect2,lto1} + + make -C $CHOST/libgcc DESTDIR=${pkgdir} install + rm ${pkgdir}/usr/lib/libgcc_s.so* - make -j1 DESTDIR=${pkgdir} install + make -C $CHOST/libstdc++-v3/src DESTDIR=${pkgdir} install + make -C $CHOST/libstdc++-v3/include DESTDIR=${pkgdir} install + make -C $CHOST/libstdc++-v3/libsupc++ DESTDIR=${pkgdir} install + make -C $CHOST/libstdc++-v3/python 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/{{$CHOST-,}gfortran,{$CHOST-,}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/$CHOST/${pkgver}/{ada{include,lib},finclude,include/objc} - rm $pkgdir/usr/lib/gcc/$CHOST/${pkgver}/{cc1obj{,plus},f951,gnat1,go1} - rm $pkgdir/usr/lib/gcc/$CHOST/${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 - - # remove static libraries - note libstdc++.a is needed for the binutils and glibc testsuite - rm $pkgdir/usr/lib/lib{asan,gomp,itm,mudflap{,th},quadmath}.a - [[ $CARCH = "x86_64" ]] && rm $pkgdir/usr/lib/libtsan.a + mv $pkgdir/usr/lib/libstdc++.so.6.*-gdb.py \ + $pkgdir/usr/share/gdb/auto-load/usr/lib/ + rm ${pkgdir}/usr/lib/libstdc++.so* + + make DESTDIR=${pkgdir} install-fixincludes + make -C gcc DESTDIR=${pkgdir} install-mkheaders + make -C lto-plugin DESTDIR=${pkgdir} install + + make -C $CHOST/libgomp DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS \ + install-nodist_libsubincludeHEADERS + make -C $CHOST/libitm DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS + make -C $CHOST/libmudflap DESTDIR=${pkgdir} install-nobase_libsubincludeHEADERS + make -C $CHOST/libquadmath DESTDIR=${pkgdir} install-nodist_libsubincludeHEADERS + make -C $CHOST/libsanitizer/asan DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS + + make -C libiberty DESTDIR=${pkgdir} install + + make -C gcc DESTDIR=${pkgdir} install-man install-info + rm ${pkgdir}/usr/share/man/man1/{gccgo,gfortran}.1 + rm ${pkgdir}/usr/share/info/{gccgo,gfortran,gnat-style,gnat_rm,gnat_ugn}.info + + make -C libcpp DESTDIR=${pkgdir} install + make -C gcc DESTDIR=${pkgdir} install-po # many packages expect this symlinks ln -s gcc ${pkgdir}/usr/bin/cc @@ -218,13 +255,11 @@ 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 \ - ${CHOST}/libstdc++-v3/doc/doxygen/man/man3/*.3 + make -C $CHOST/libstdc++-v3/doc DESTDIR=$pkgdir doc-install-man # Install Runtime Library Exception - install -Dm644 ${srcdir}/${_basedir}/COPYING.RUNTIME \ - ${pkgdir}/usr/share/licenses/gcc/RUNTIME.LIBRARY.EXCEPTION + install -d ${pkgdir}/usr/share/licenses/gcc/ + ln -s ../gcc-libs/RUNTIME.LIBRARY.EXCEPTION ${pkgdir}/usr/share/licenses/gcc/ } package_gcc-fortran() @@ -235,24 +270,16 @@ package_gcc-fortran() install=gcc-fortran.install cd ${srcdir}/gcc-build - make -j1 DESTDIR=$pkgdir install-target-libgfortran - make -j1 -C $CHOST/libgomp DESTDIR=$pkgdir install-nodist_fincludeHEADERS - make -j1 -C gcc DESTDIR=$pkgdir fortran.install-{common,man,info} - install -Dm755 gcc/f951 $pkgdir/usr/lib/gcc/$CHOST/$pkgver/f951 + make -C $CHOST/libgfortran DESTDIR=$pkgdir install-{{caf,my}execlibLTLIBRARIES,toolexeclibDATA} + make -C $CHOST/libgomp DESTDIR=$pkgdir install-nodist_fincludeHEADERS + make -C gcc DESTDIR=$pkgdir fortran.install-{common,man,info} + install -Dm755 gcc/f951 $pkgdir/${_libdir}/f951 ln -s gfortran ${pkgdir}/usr/bin/f95 - # remove files included in gcc-libs or gcc and unnneeded static lib - rm ${pkgdir}/usr/lib/lib{gfortran,gcc_s}.so* - rm ${pkgdir}/usr/lib/libquadmath.{a,so*} - rm ${pkgdir}/usr/lib/gcc/$CHOST/${pkgver}/{*.o,libgc*} - rm ${pkgdir}/usr/share/info/libquadmath.info - rm -r ${pkgdir}/usr/lib/gcc/$CHOST/${pkgver}/include - rm ${pkgdir}/usr/lib/libgfortran.a - # Install Runtime Library Exception - install -Dm644 ${srcdir}/${_basedir}/COPYING.RUNTIME \ - ${pkgdir}/usr/share/licenses/gcc-fortran/RUNTIME.LIBRARY.EXCEPTION + install -d ${pkgdir}/usr/share/licenses/gcc-fortran/ + ln -s ../gcc-libs/RUNTIME.LIBRARY.EXCEPTION ${pkgdir}/usr/share/licenses/gcc-fortran/ } package_gcc-objc() @@ -261,18 +288,13 @@ package_gcc-objc() depends=("gcc=$pkgver-$pkgrel") cd ${srcdir}/gcc-build - make -j1 DESTDIR=$pkgdir install-target-libobjc - install -dm755 $pkgdir/usr/lib/gcc/$CHOST/$pkgver/ - install -m755 gcc/cc1obj{,plus} $pkgdir/usr/lib/gcc/$CHOST/$pkgver/ - - # remove files included in gcc-libs or gcc - rm ${pkgdir}/usr/lib/lib{gcc_s,objc}.so* - rm $pkgdir/usr/lib/gcc/$CHOST/${pkgver}/{*.o,lib*} - rm $pkgdir/usr/lib/gcc/$CHOST/${pkgver}/include/unwind.h + make DESTDIR=$pkgdir -C $CHOST/libobjc install-headers + install -dm755 $pkgdir/${_libdir} + install -m755 gcc/cc1obj{,plus} $pkgdir/${_libdir}/ # Install Runtime Library Exception - install -Dm644 ${srcdir}/${_basedir}/COPYING.RUNTIME \ - ${pkgdir}/usr/share/licenses/gcc-objc/RUNTIME.LIBRARY.EXCEPTION + install -d ${pkgdir}/usr/share/licenses/gcc-objc/ + ln -s ../gcc-libs/RUNTIME.LIBRARY.EXCEPTION ${pkgdir}/usr/share/licenses/gcc-objc/ } package_gcc-ada() @@ -283,14 +305,20 @@ package_gcc-ada() install=gcc-ada.install cd ${srcdir}/gcc-build/gcc - make -j1 DESTDIR=$pkgdir ada.install-{common,info} - install -m755 gnat1 $pkgdir/usr/lib/gcc/$CHOST/$pkgver + make DESTDIR=$pkgdir ada.install-{common,info} + install -m755 gnat1 $pkgdir/${_libdir} ln -s gcc ${pkgdir}/usr/bin/gnatgcc + # insist on dynamic linking + mv ${pkgdir}/${_libdir}/adalib/libgna{rl,t}-${_pkgver}.so ${pkgdir}/usr/lib + ln -s libgnarl-${_pkgver}.so ${pkgdir}/usr/lib/libgnarl.so + ln -s libgnat-${_pkgver}.so ${pkgdir}/usr/lib/libgnat.so + rm ${pkgdir}/${_libdir}/adalib/libgna{rl,t}.* + # Install Runtime Library Exception - install -Dm644 ${srcdir}/${_basedir}/COPYING.RUNTIME \ - ${pkgdir}/usr/share/licenses/gcc-ada/RUNTIME.LIBRARY.EXCEPTION + install -d ${pkgdir}/usr/share/licenses/gcc-ada/ + ln -s ../gcc-libs/RUNTIME.LIBRARY.EXCEPTION ${pkgdir}/usr/share/licenses/gcc-ada/ } package_gcc-go() @@ -301,12 +329,13 @@ package_gcc-go() install=gcc-go.install cd ${srcdir}/gcc-build - make -j1 DESTDIR=$pkgdir install-target-libgo - make -j1 -C gcc DESTDIR=$pkgdir go.install-{common,man,info} - install -Dm755 gcc/go1 $pkgdir/usr/lib/gcc/$CHOST/$pkgver/go1 - rm $pkgdir/usr/lib/lib{atomic,go}.a + make -C $CHOST/libgo DESTDIR=$pkgdir install-exec-am + make -C gcc DESTDIR=$pkgdir go.install-{common,man,info} + install -Dm755 gcc/go1 $pkgdir/${_libdir}/go1 + + rm $pkgdir/usr/lib/libgo.a # Install Runtime Library Exception - install -Dm644 ${srcdir}/${_basedir}/COPYING.RUNTIME \ - ${pkgdir}/usr/share/licenses/gcc-go/RUNTIME.LIBRARY.EXCEPTION + install -d ${pkgdir}/usr/share/licenses/gcc-go/ + ln -s ../gcc-libs/RUNTIME.LIBRARY.EXCEPTION ${pkgdir}/usr/share/licenses/gcc-go/ } |