summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO11
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD178
-rw-r--r--gcc-4.9-fix-build-with-gcc-6.patch126
4 files changed, 236 insertions, 83 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bb0e710f88bd..8103716c6d1c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,3 +1,5 @@
+# Generated by mksrcinfo v8
+# Sun Jun 12 09:23:02 UTC 2016
pkgbase = gcc48
pkgdesc = The GNU Compiler Collection - C and C++ frontends (4.8.x)
pkgver = 4.8.5
@@ -13,16 +15,15 @@ pkgbase = gcc48
checkdepends = inetutils
makedepends = binutils>=2.24
makedepends = libmpc
- makedepends = cloog
makedepends = doxygen
- depends = binutils>=2.24
- depends = libmpc
- depends = cloog
+ makedepends = cloog
options = !emptydirs
options = staticlibs
options = !libtool
source = ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.8.5/gcc-4.8.5.tar.bz2
- md5sums = 80d2c2982a3392bb0b89673ff136e223
+ source = gcc-4.9-fix-build-with-gcc-6.patch
+ sha256sums = 22fb1e7e0f68a63cee631d85b20461d1ea6bda162f03096350e38c8d427ecf23
+ sha256sums = d775a053fad367f5490111038fde7c875b4e842919d2d197f95b915e1ae562a9
pkgname = gcc48
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 4b93f75bca97..000000000000
--- a/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-src
-pkg
-*.tar.bz2
-*.tar.xz
diff --git a/PKGBUILD b/PKGBUILD
index 3f8e2da94ec1..6a2b1c3b402d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,118 +1,148 @@
-# Maintainer: Felix Schindler <felix at schindlerfaimly dot de>
+# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
+# Contributor: Felix Schindler <felix at schindlerfaimly dot de>
# Contributor: Allan McRae <allan@archlinux.org>
#
-# This PKGBUILD is maintained at https://github.com/ftalbrecht/aur
+# This PKGBUILD has been maintained at https://github.com/ftalbrecht/aur
# in the gcc48 branch
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
# NOTE: libtool requires rebuilt with each new gcc version
-pkgname=gcc48
-_pkgver_minor=4.8
-pkgver=${_pkgver_minor}.5
-pkgrel=1
-pkgdesc="The GNU Compiler Collection - C and C++ frontends (4.8.x)"
+pkgname='gcc48'
+_pkgver='4.8'
+pkgver="${_pkgver}.5"
+pkgrel='1'
+pkgdesc="The GNU Compiler Collection - C and C++ frontends (${_pkgver}.x)"
arch=('i686' 'x86_64')
-license=('GPL' 'LGPL' 'FDL' 'custom')
url="http://gcc.gnu.org"
-depends=('binutils>=2.24' 'libmpc' 'cloog')
-makedepends=('binutils>=2.24' 'libmpc' 'cloog' 'doxygen')
+license=('GPL' 'LGPL' 'FDL' 'custom')
+makedepends=('binutils>=2.24' 'libmpc' 'doxygen')
+makedepends+=('cloog')
checkdepends=('dejagnu' 'inetutils')
options=('!emptydirs' 'staticlibs' '!libtool')
-source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2)
-md5sums=('80d2c2982a3392bb0b89673ff136e223')
+source=(
+ "ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2"
+ "gcc-4.9-fix-build-with-gcc-6.patch"
+)
+sha256sums=('22fb1e7e0f68a63cee631d85b20461d1ea6bda162f03096350e38c8d427ecf23'
+ 'd775a053fad367f5490111038fde7c875b4e842919d2d197f95b915e1ae562a9')
+PKGEXT='.pkg.tar.gz'
-_basedir=gcc-${pkgver}
+ _basedir="gcc-${pkgver}"
-_libdir="usr/lib/gcc/$CHOST/$pkgver"
+#_libdir="usr/lib/gcc/${CHOST}/${pkgver}"
-build() {
- # prepare
- cd ${srcdir}/${_basedir}
+prepare() {
+ cd "${_basedir}"
# Do not run fixincludes
- sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
+ sed -i -e 's@\./fixinc\.sh@-c true@' 'gcc/Makefile.in'
+
+ # fix build with GCC 6
+ patch -p1 < "${srcdir}/gcc-4.9-fix-build-with-gcc-6.patch"
# Arch Linux installs x86_64 libraries /lib
- [[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
+ case "${CARCH}" in
+ 'x86_64') sed -i -e '/m64=/s/lib64/lib/' 'gcc/config/i386/t-linux64' ;;
+ esac
- echo ${pkgver} > gcc/BASE-VER
+ 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
+ sed -i -e '/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/' {libiberty,gcc}/configure
# 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
+ sed -i -e 's#@target_header_dir@#libiberty#' 'libiberty/Makefile.in'
- mkdir ${srcdir}/gcc-build
+ mkdir "${srcdir}/gcc-build"
# build
- cd ${srcdir}/gcc-build
+ cd "${srcdir}/gcc-build"
# Doesn't like FORTIFY_SOURCE
- CPPFLAGS=${CPPFLAGS//-D_FORTIFY_SOURCE=?/}
- export CPPFLAGS
+ export CPPFLAGS="${CPPFLAGS//-D_FORTIFY_SOURCE=?/}"
# Doesn't like -fstack-protector-strong
- CFLAGS=${CFLAGS//-fstack-protector-strong/-fstack-protector}
- export CFLAGS
- CXXFLAGS=${CXXFLAGS//-fstack-protector-strong/-fstack-protector}
- export CXXFLAGS
+ export CFLAGS="${CFLAGS//-fstack-protector-strong/-fstack-protector}"
+ export CXXFLAGS="${CXXFLAGS//-fstack-protector-strong/-fstack-protector}"
# using -pipe causes spurious test-suite failures
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
- CFLAGS=${CFLAGS/-pipe/}
- CXXFLAGS=${CXXFLAGS/-pipe/}
-
- LD_PRELOAD=/usr/lib/libstdc++.so.6 ${srcdir}/${_basedir}/configure --prefix=/usr \
- --libdir=/usr/lib --libexecdir=/usr/lib \
- --mandir=/usr/share/man --infodir=/usr/share/info \
- --with-bugurl=https://bugs.archlinux.org/ \
- --enable-languages=c,c++,fortran \
- --enable-shared --enable-threads=posix \
- --with-system-zlib --enable-__cxa_atexit \
- --disable-libunwind-exceptions --enable-clocale=gnu \
- --disable-libstdcxx-pch \
- --enable-gnu-unique-object \
- --with-ppl \
- --disable-multilib --disable-werror \
- --enable-linker-build-id \
- --enable-cloog-backend=isl \
- --enable-lto --enable-gold --enable-ld=default \
- --enable-plugin --with-plugin-ld=ld.gold \
- --program-suffix=-${pkgver} --enable-version-specific-runtime-libs \
- --enable-checking=release
-
- make
-
+ export CFLAGS="${CFLAGS/-pipe/}"
+ export CXXFLAGS="${CXXFLAGS/-pipe/}"
+
+ # The following options are one per line, mostly sorted so they are easy to diff compare to other gcc packages.
+ "${srcdir}/${_basedir}/configure" \
+ --build="${CHOST}" \
+ --disable-libstdcxx-pch \
+ --disable-libunwind-exceptions \
+ --disable-multilib \
+ --disable-werror \
+ --enable-__cxa_atexit \
+ --enable-checking='release' \
+ --enable-clocale='gnu' \
+ --enable-cloog-backend='isl' \
+ --enable-gnu-unique-object \
+ --enable-gold \
+ --enable-languages='c,c++,fortran' \
+ --enable-ld=default \
+ --enable-linker-build-id \
+ --enable-lto \
+ --enable-plugin \
+ --enable-shared \
+ --enable-threads='posix' \
+ --enable-version-specific-runtime-libs \
+ --infodir='/usr/share/info' \
+ --libdir='/usr/lib' \
+ --libexecdir='/usr/lib' \
+ --mandir='/usr/share/man' \
+ --program-suffix="-${_pkgver}" \
+ --with-bugurl='https://bugs.archlinux.org/' \
+ --with-plugin-ld='ld.gold' \
+ --with-ppl \
+ --with-system-zlib \
+ --prefix='/usr'
+# CXX='g++-4.9' CC='gcc-4.9'
+}
+
+build() {
+ cd "${srcdir}/gcc-build"
+
+ local _nproc="$(nproc)"; _nproc=$((_nproc>8?8:_nproc))
+ LD_PRELOAD='/usr/lib/libstdc++.so' \
+ make -s -j "${_nproc}"
+
# make documentation
- make -C $CHOST/libstdc++-v3/doc doc-man-doxygen
+ make -s -j1 -C "${CHOST}/libstdc++-v3/doc" 'doc-man-doxygen'
+}
+
+_fn_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 || :
+ "${srcdir}/${_basedir}/contrib/test_summary"
}
package()
{
- cd ${srcdir}/gcc-build
+ cd "${srcdir}/gcc-build"
+
+ make -s -j1 DESTDIR="${pkgdir}" install
- make -j1 DESTDIR=${pkgdir} install
-
## Lazy way of dealing with conflicting man and info pages and locales...
- rm -rf ${pkgdir}/usr/share/
- rm -rf ${pkgdir}/usr/include/
- find ${pkgdir}/ -name \*iberty\* | xargs rm
-
+ rm -rf "${pkgdir}/usr"/{share,include}/
+ find "${pkgdir}/" -name '*iberty*' | xargs rm
+
# Move potentially conflicting stuff to version specific subdirectory
- $(ls "$pkgdir"/usr/lib/gcc/$CHOST/lib* &> /dev/null) && mv "$pkgdir"/usr/lib/gcc/$CHOST/lib* "$pkgdir/usr/lib/gcc/$CHOST/$pkgver/"
-
+ mv "${pkgdir}/usr/lib/gcc/${CHOST}"/lib*/ "${pkgdir}/usr/lib/gcc/${CHOST}/${pkgver}/"
+
# Install Runtime Library Exception
- install -Dm644 ${srcdir}/gcc-${pkgver}/COPYING.RUNTIME \
- ${pkgdir}/usr/share/licenses/$pkgname/RUNTIME.LIBRARY.EXCEPTION
-
- # create symlinks
- cd ${pkgdir}/usr/bin
- for ii in c++ g++ gcc gcc-ar gcc-nm gcc-ranlib gfortran; do
- ln -s ${ii}-${pkgver} ${ii}-${_pkgver_minor}
- ln -s ${CHOST}-${ii}-${pkgver} ${CHOST}-${ii}-${_pkgver_minor}
- done
- ln -s gcov-${pkgver} gcov-${_pkgver_minor}
+ install -Dm644 "${srcdir}/gcc-${pkgver}/COPYING.RUNTIME" \
+ "${pkgdir}/usr/share/licenses/${pkgname}/RUNTIME.LIBRARY.EXCEPTION"
}
diff --git a/gcc-4.9-fix-build-with-gcc-6.patch b/gcc-4.9-fix-build-with-gcc-6.patch
new file mode 100644
index 000000000000..e158c9d6d932
--- /dev/null
+++ b/gcc-4.9-fix-build-with-gcc-6.patch
@@ -0,0 +1,126 @@
+--- a/gcc/cp/Make-lang.in
+++++ b/gcc/cp/Make-lang.in
+@@ -111,7 +111,7 @@ else
+ # deleting the $(srcdir)/cp/cfns.h file.
+ $(srcdir)/cp/cfns.h:
+ endif
+- gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
++ gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
+ $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
+
+ #
+diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
+index 05ca753..d9b16b8 100644
+--- a/gcc/cp/cfns.gperf
++++ b/gcc/cp/cfns.gperf
+@@ -1,3 +1,5 @@
++%language=C++
++%define class-name libc_name
+ %{
+ /* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+
+@@ -16,14 +18,6 @@ for more details.
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+-#ifdef __GNUC__
+-__inline
+-#endif
+-static unsigned int hash (const char *, unsigned int);
+-#ifdef __GNUC__
+-__inline
+-#endif
+-const char * libc_name_p (const char *, unsigned int);
+ %}
+ %%
+ # The standard C library functions, for feeding to gperf; the result is used
+diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
+index c845ddf..65801d1 100644
+--- a/gcc/cp/cfns.h
++++ b/gcc/cp/cfns.h
+@@ -1,5 +1,5 @@
+-/* ANSI-C code produced by gperf version 3.0.3 */
+-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */
++/* C++ code produced by gperf version 3.0.4 */
++/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ -output-file cfns.h cfns.gperf */
+
+ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+@@ -28,7 +28,7 @@
+ #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
+ #endif
+
+-#line 1 "cfns.gperf"
++#line 3 "cfns.gperf"
+
+ /* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+
+@@ -47,25 +47,18 @@ for more details.
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+-#ifdef __GNUC__
+-__inline
+-#endif
+-static unsigned int hash (const char *, unsigned int);
+-#ifdef __GNUC__
+-__inline
+-#endif
+-const char * libc_name_p (const char *, unsigned int);
+ /* maximum key range = 391, duplicates = 0 */
+
+-#ifdef __GNUC__
+-__inline
+-#else
+-#ifdef __cplusplus
+-inline
+-#endif
+-#endif
+-static unsigned int
+-hash (register const char *str, register unsigned int len)
++class libc_name
++{
++private:
++ static inline unsigned int hash (const char *str, unsigned int len);
++public:
++ static const char *libc_name_p (const char *str, unsigned int len);
++};
++
++inline unsigned int
++libc_name::hash (register const char *str, register unsigned int len)
+ {
+ static const unsigned short asso_values[] =
+ {
+@@ -122,14 +115,8 @@ hash (register const char *str, register unsigned int len)
+ return hval + asso_values[(unsigned char)str[len - 1]];
+ }
+
+-#ifdef __GNUC__
+-__inline
+-#ifdef __GNUC_STDC_INLINE__
+-__attribute__ ((__gnu_inline__))
+-#endif
+-#endif
+ const char *
+-libc_name_p (register const char *str, register unsigned int len)
++libc_name::libc_name_p (register const char *str, register unsigned int len)
+ {
+ enum
+ {
+diff --git a/gcc/cp/except.c b/gcc/cp/except.c
+index 221971a..32340f5 100644
+--- a/gcc/cp/except.c
++++ b/gcc/cp/except.c
+@@ -1030,7 +1030,8 @@ nothrow_libfn_p (const_tree fn)
+ unless the system headers are playing rename tricks, and if
+ they are, we don't want to be confused by them. */
+ id = DECL_NAME (fn);
+- return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
++ return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id),
++ IDENTIFIER_LENGTH (id));
+ }
+
+ /* Returns nonzero if an exception of type FROM will be caught by a
+--
+2.8.2
+