summaryrefslogtreecommitdiff
path: root/core/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'core/gcc')
-rw-r--r--core/gcc/PKGBUILD42
-rw-r--r--core/gcc/gcc-libs.install4
-rw-r--r--core/gcc/gcc_mips64el_lib.patch24
3 files changed, 62 insertions, 8 deletions
diff --git a/core/gcc/PKGBUILD b/core/gcc/PKGBUILD
index 412cd95bd..c2d3d3650 100644
--- a/core/gcc/PKGBUILD
+++ b/core/gcc/PKGBUILD
@@ -4,16 +4,21 @@
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
# NOTE: libtool requires rebuilt with each new gcc version
-pkgname=('gcc' 'gcc-libs' 'gcc-fortran' 'gcc-objc' 'gcc-ada' 'gcc-go')
+if [ "${CARCH}" != "mips64el" ]; then
+ pkgname=('gcc' 'gcc-libs' 'gcc-fortran' 'gcc-objc' 'gcc-ada' 'gcc-go')
+else
+ pkgname=('gcc' 'gcc-libs' 'gcc-fortran' 'gcc-objc')
+fi
pkgver=4.8.2
_pkgver=4.8
pkgrel=7
_snapshot=4.8-20131219
pkgdesc="The GNU Compiler Collection"
-arch=('i686' 'x86_64')
+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' '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
@@ -24,7 +29,6 @@ md5sums=('666ef08f87649f941bc5512e13a88fdc'
'40cb437805e2f7a006aa0d0c3098ab0f'
'6eb6e080dbf7bc6825f53a0aaa6c4ef9')
-
if [ -n "${_snapshot}" ]; then
_basedir=gcc-${_snapshot}
else
@@ -41,6 +45,7 @@ prepare() {
# Arch Linux installs x86_64 libraries /lib
[[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
+ [[ $CARCH == "mips64el" ]] && sed -i 's/lib32/lib/' gcc/config/mips/t-linux64
echo ${pkgver} > gcc/BASE-VER
@@ -68,11 +73,27 @@ build() {
CFLAGS=${CFLAGS/-pipe/}
CXXFLAGS=${CXXFLAGS/-pipe/}
+ # Use our CFLAGS, CXXFLAGS and LDFLAGS for the binaries built.
+ export BOOT_CFLAGS="$CFLAGS"
+ export CFLAGS_FOR_BUILD="$CFLAGS"
+ export CFLAGS_FOR_TARGET="$CFLAGS"
+ export CXXFLAGS_FOR_BUILD="$CXXFLAGS"
+ export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
+ export BOOT_LDFLAGS="$LDFLAGS"
+ export LDFLAGS_FOR_BUILD="$LDFLAGS"
+ export LDFLAGS_FOR_TARGET="$LDFLAGS"
+
+ if [[ "${CARCH}" != "mips64el" ]]; then
+ languages=c,c++,ada,fortran,go,lto,objc,obj-c++
+ else
+ languages=c,c++,fortran,lto,objc,obj-c++
+ fi
+
${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++,ada,fortran,go,lto,objc,obj-c++ \
+ --with-bugurl=https://labs.parabola.nu/ \
+ --enable-languages=$languages \
--enable-shared --enable-threads=posix \
--with-system-zlib --enable-__cxa_atexit \
--disable-libunwind-exceptions --enable-clocale=gnu \
@@ -90,6 +111,8 @@ build() {
}
check() {
+ # Takes days and no one here uses it.
+ if [ "$CARCH" != "mips64el" ] ; then
cd ${srcdir}/gcc-build
# increase stack size to prevent test failures
@@ -99,6 +122,7 @@ check() {
# do not abort on error as some are "expected"
make -k check || true
${srcdir}/${_basedir}/contrib/test_summary
+ fi
}
package_gcc-libs()
@@ -122,6 +146,10 @@ package_gcc-libs()
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
@@ -135,6 +163,8 @@ package_gcc-libs()
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
diff --git a/core/gcc/gcc-libs.install b/core/gcc/gcc-libs.install
index 23553b8f0..a6ac198f2 100644
--- a/core/gcc/gcc-libs.install
+++ b/core/gcc/gcc-libs.install
@@ -4,13 +4,13 @@ filelist=(libgomp.info libquadmath.info)
post_upgrade() {
[ -x usr/bin/install-info ] || return 0
for file in ${filelist[@]}; do
- install-info $infodir/$file.gz $infodir/dir 2> /dev/null
+ [ -f $infodir/$file.gz ] && install-info $infodir/$file.gz $infodir/dir 2> /dev/null || true
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
+ [ -f $infodir/$file.gz ] && install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null || true
done
}
diff --git a/core/gcc/gcc_mips64el_lib.patch b/core/gcc/gcc_mips64el_lib.patch
new file mode 100644
index 000000000..c938d9b30
--- /dev/null
+++ b/core/gcc/gcc_mips64el_lib.patch
@@ -0,0 +1,24 @@
+diff -ru gcc-4.7-20120324.orig/gcc/config/mips/linux64.h gcc-4.7-20120324/gcc/config/mips/linux64.h
+--- gcc-4.7-20120324.orig/gcc/config/mips/linux64.h 2012-04-06 11:32:50.545152897 +0200
++++ gcc-4.7-20120324/gcc/config/mips/linux64.h 2012-04-06 12:06:58.501290352 +0200
+@@ -23,9 +23,9 @@
+ #define GNU_USER_LINK_EMULATION64 "elf64%{EB:b}%{EL:l}tsmip"
+ #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER32 "/lib32/ld.so.1"
+ #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
++#define GLIBC_DYNAMIC_LINKERN32 "/lib/ld.so.1"
+ #define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0"
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+diff -ru gcc-4.7-20120324.orig/gcc/config/mips/t-linux64 gcc-4.7-20120324/gcc/config/mips/t-linux64
+--- gcc-4.7-20120324.orig/gcc/config/mips/t-linux64 2012-04-06 11:32:50.379989000 +0200
++++ gcc-4.7-20120324/gcc/config/mips/t-linux64 2012-04-06 12:05:55.461021317 +0200
+@@ -18,4 +18,4 @@
+
+ MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
+ MULTILIB_DIRNAMES = n32 32 64
+-MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
++MULTILIB_OSDIRNAMES = ../lib ../lib32 ../lib64