summaryrefslogtreecommitdiff
path: root/community/arm-none-eabi-gcc
diff options
context:
space:
mode:
Diffstat (limited to 'community/arm-none-eabi-gcc')
-rw-r--r--community/arm-none-eabi-gcc/PKGBUILD98
-rw-r--r--community/arm-none-eabi-gcc/gcc-4.8.2-multilib.patch95
-rw-r--r--community/arm-none-eabi-gcc/gcc-4.8.2-no-exceptions.patch20
-rw-r--r--community/arm-none-eabi-gcc/libgloss-configure-fix.patch11
4 files changed, 224 insertions, 0 deletions
diff --git a/community/arm-none-eabi-gcc/PKGBUILD b/community/arm-none-eabi-gcc/PKGBUILD
new file mode 100644
index 000000000..87c353a77
--- /dev/null
+++ b/community/arm-none-eabi-gcc/PKGBUILD
@@ -0,0 +1,98 @@
+# Maintainer: Martin Schmölzer <mschmoelzer@gmail.com>
+
+_target=arm-none-eabi
+pkgname=$_target-gcc
+pkgver=4.8.2
+pkgrel=8
+_newlibver=2.1.0
+pkgdesc='The GNU Compiler Collection - cross compiler for ARM EABI (bare-metal) target'
+arch=(i686 x86_64)
+url='http://gcc.gnu.org/'
+license=(GPL LGPL FDL)
+depends=(cloog libmpc zlib)
+makedepends=($_target-binutils gmp mpfr)
+#checkdepends=(dejagnu)
+options=(!emptydirs !strip staticlibs)
+source=(ftp://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.bz2
+ ftp://sourceware.org/pub/newlib/newlib-$_newlibver.tar.gz
+ gcc-$pkgver-multilib.patch
+ gcc-$pkgver-no-exceptions.patch
+ libgloss-configure-fix.patch)
+sha256sums=('09dc2276c73424bbbfda1dbddc62bbbf900c9f185acf7f3e1d773ce2d7e3cdc8'
+ '3e4d5ab9f0508942b6231b8ade4f8e5048cf92c96ed574c2bd6bd3320a599a48'
+ '4edd875c89391cbf5c2b57587a51da0dfda54ca0c711a85e9c301f03083e4189'
+ '649eb3b443e975d40ca61128ba715d1e3a29716e1e45a52c661ac0dba3c2099d'
+ 'eac96c034d3d7d16080d9aef4749e4eda493563a3348e6a06f08e8a330b027ba')
+
+prepare() {
+ # Apply configure fix from newlib CVS
+ cd "$srcdir/newlib-$_newlibver/libgloss/arm"
+ patch -Np0 -i "$srcdir/libgloss-configure-fix.patch"
+ autoreconf
+
+ cd "$srcdir"
+ patch -Np0 -i gcc-$pkgver-multilib.patch
+ patch -Np0 -i gcc-$pkgver-no-exceptions.patch
+
+ # Move newlib and libgloss to gcc source directory
+ mv newlib-$_newlibver/newlib gcc-$pkgver
+ mv newlib-$_newlibver/libgloss gcc-$pkgver
+
+ # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
+ sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" gcc-$pkgver/{libiberty,gcc}/configure
+}
+
+build() {
+ cd gcc-$pkgver
+ mkdir build
+ cd build
+
+ export CFLAGS_FOR_TARGET='-O2 -g -pipe'
+ export CXXFLAGS_FOR_TARGET='-O2 -g -pipe'
+
+ ../configure --target=$_target \
+ --prefix=/usr \
+ --libexecdir=/usr/lib \
+ --with-pkgversion='Arch Repository' \
+ --with-bugurl='https://bugs.archlinux.org/' \
+ --enable-multilib \
+ --enable-interwork \
+ --enable-languages=c,c++ \
+ --with-newlib \
+ --with-gnu-as \
+ --with-gnu-ld \
+ --disable-nls \
+ --disable-shared \
+ --disable-threads \
+ --with-headers=newlib/libc/include \
+ --disable-libssp \
+ --disable-libstdcxx-pch \
+ --disable-libmudflap \
+ --disable-libgomp \
+ --with-system-zlib \
+ --disable-newlib-supplied-syscalls
+
+ make
+}
+
+check() {
+ cd gcc-$pkgver/build
+# TODO: enable gcc tests for arm target
+# make check RUNTESTFLAGS="--target_board=arm-sim\{-mhard-float,-msoft-float\}\{-O2,\}"
+# ../contrib/test_summary
+}
+
+package() {
+ cd gcc-$pkgver/build
+
+ make DESTDIR="$pkgdir" install -j1
+
+ # Strip host objects but do not touch target one
+ find "$pkgdir" -executable -type f -exec /usr/bin/strip --strip-debug '{}' \;
+
+ # Remove files that conflict with host gcc package
+ rm "$pkgdir"/usr/lib/libiberty.a
+ rm -r "$pkgdir"/usr/share/man/man7
+ rm -r "$pkgdir"/usr/share/info
+ rm -r "$pkgdir"/usr/share/gcc-$pkgver
+}
diff --git a/community/arm-none-eabi-gcc/gcc-4.8.2-multilib.patch b/community/arm-none-eabi-gcc/gcc-4.8.2-multilib.patch
new file mode 100644
index 000000000..c75aa158b
--- /dev/null
+++ b/community/arm-none-eabi-gcc/gcc-4.8.2-multilib.patch
@@ -0,0 +1,95 @@
+--- gcc-4.8.2/gcc/config/arm/t-arm-elf.orig 2013-01-10 21:38:27.000000000 +0100
++++ gcc-4.8.2/gcc/config/arm/t-arm-elf 2013-10-17 08:14:29.237001796 +0200
+@@ -18,73 +18,26 @@
+
+ MULTILIB_OPTIONS = marm/mthumb
+ MULTILIB_DIRNAMES = arm thumb
+-MULTILIB_EXCEPTIONS =
+-MULTILIB_MATCHES =
+
+-#MULTILIB_OPTIONS += mcpu=fa526/mcpu=fa626/mcpu=fa606te/mcpu=fa626te/mcpu=fmp626/mcpu=fa726te
+-#MULTILIB_DIRNAMES += fa526 fa626 fa606te fa626te fmp626 fa726te
+-#MULTILIB_EXCEPTIONS += *mthumb*/*mcpu=fa526 *mthumb*/*mcpu=fa626
++# We do not want any ARM or Thumb libraries
++MULTILIB_EXCEPTIONS = marm* mthumb
+
+-#MULTILIB_OPTIONS += march=armv7
+-#MULTILIB_DIRNAMES += thumb2
+-#MULTILIB_EXCEPTIONS += march=armv7* marm/*march=armv7*
+-#MULTILIB_MATCHES += march?armv7=march?armv7-a
+-#MULTILIB_MATCHES += march?armv7=march?armv7-r
+-#MULTILIB_MATCHES += march?armv7=march?armv7-m
+-#MULTILIB_MATCHES += march?armv7=mcpu?cortex-a8
+-#MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4
+-#MULTILIB_MATCHES += march?armv7=mcpu?cortex-m3
++# Build with any one of arm7tdmi, M0, M3 or M4 support
++MULTILIB_OPTIONS += mcpu=arm7tdmi-s/mcpu=cortex-m0/mcpu=cortex-m3/mcpu=cortex-m4
++MULTILIB_DIRNAMES += arm7tdmi-s cortex-m0 cortex-m3 cortex-m4
+
+-# Not quite true. We can support hard-vfp calling in Thumb2, but how do we
+-# express that here? Also, we really need architecture v5e or later
+-# (mcrr etc).
+-MULTILIB_OPTIONS += mfloat-abi=hard
+-MULTILIB_DIRNAMES += fpu
+-MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard*
+-#MULTILIB_EXCEPTIONS += *mcpu=fa526/*mfloat-abi=hard*
+-#MULTILIB_EXCEPTIONS += *mcpu=fa626/*mfloat-abi=hard*
++# These don't make any sense without thumb, because GCC likes to
++# tell you that you have to supply another commandline argument
++# rather than just setting it itself.
++MULTILIB_EXCEPTIONS += mcpu=arm7tdmi-s* mcpu=cortex-m0* mcpu=cortex-m3* mcpu=cortex-m4*
+
+-# MULTILIB_OPTIONS += mcpu=ep9312
+-# MULTILIB_DIRNAMES += ep9312
+-# MULTILIB_EXCEPTIONS += *mthumb/*mcpu=ep9312*
+-#
+-# MULTILIB_OPTIONS += mlittle-endian/mbig-endian
+-# MULTILIB_DIRNAMES += le be
+-# MULTILIB_MATCHES += mbig-endian=mbe mlittle-endian=mle
+-#
+-# MULTILIB_OPTIONS += mfloat-abi=hard/mfloat-abi=soft
+-# MULTILIB_DIRNAMES += fpu soft
+-# MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard*
+-#
+-# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
+-# MULTILIB_DIRNAMES += normal interwork
+-#
+-# MULTILIB_OPTIONS += fno-leading-underscore/fleading-underscore
+-# MULTILIB_DIRNAMES += elf under
+-#
+-# MULTILIB_OPTIONS += mcpu=arm7
+-# MULTILIB_DIRNAMES += nofmult
+-# MULTILIB_EXCEPTIONS += *mthumb*/*mcpu=arm7*
+-# # Note: the multilib_exceptions matches both -mthumb and
+-# # -mthumb-interwork
+-# #
+-# # We have to match all the arm cpu variants which do not have the
+-# # multiply instruction and treat them as if the user had specified
+-# # -mcpu=arm7. Note that in the following the ? is interpreted as
+-# # an = for the purposes of matching command line options.
+-# # FIXME: There ought to be a better way to do this.
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm7d
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm7di
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm70
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm700
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm700i
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm710
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm710c
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm7100
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm7500
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm7500fe
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm6
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm60
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm600
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm610
+-# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm620
++# Specify mfloat-abi=hard mfpu=fpv4-sp-d16 only for Cortex-M4
++MULTILIB_OPTIONS += mfloat-abi=hard mfpu=fpv4-sp-d16
++MULTILIB_DIRNAMES += float-abi-hard fpuv4-sp-d16
++MULTILIB_EXCEPTIONS += mfloat* mthumb/mfloat*
++MULTILIB_EXCEPTIONS += mfpu* mthumb/mfpu*
++MULTILIB_EXCEPTIONS += mthumb/mcpu=cortex-m4/mfloat-abi=hard
++MULTILIB_EXCEPTIONS += mthumb/mcpu=cortex-m4/mfpu=fpv4-sp-d16
++MULTILIB_EXCEPTIONS += *arm7tdmi-s*mfloat-abi* *arm7tdmi-s*mfpu*
++MULTILIB_EXCEPTIONS += *cortex-m3*mfloat-abi* *cortex-m3*mfpu*
++MULTILIB_EXCEPTIONS += *cortex-m0*mfloat-abi* *cortex-m0*mfpu*
diff --git a/community/arm-none-eabi-gcc/gcc-4.8.2-no-exceptions.patch b/community/arm-none-eabi-gcc/gcc-4.8.2-no-exceptions.patch
new file mode 100644
index 000000000..6291ee43b
--- /dev/null
+++ b/community/arm-none-eabi-gcc/gcc-4.8.2-no-exceptions.patch
@@ -0,0 +1,20 @@
+--- gcc-4.8.2/libgcc/Makefile.in.orig 2013-02-04 20:06:20.000000000 +0100
++++ gcc-4.8.2/libgcc/Makefile.in 2013-10-17 08:05:38.314091932 +0200
+@@ -492,7 +492,7 @@
+ ifeq ($(LIB2_DIVMOD_EXCEPTION_FLAGS),)
+ # Provide default flags for compiling divmod functions, if they haven't been
+ # set already by a target-specific Makefile fragment.
+-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -fnon-call-exceptions
++LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions -fnon-call-exceptions
+ endif
+
+ # Build LIB2_DIVMOD_FUNCS.
+@@ -813,7 +813,7 @@
+ # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and
+ # LIB2ADDEHSHARED matter. (Usually all three are identical.)
+
+-c_flags := -fexceptions
++c_flags := -fno-exceptions
+
+ ifeq ($(enable_shared),yes)
+
diff --git a/community/arm-none-eabi-gcc/libgloss-configure-fix.patch b/community/arm-none-eabi-gcc/libgloss-configure-fix.patch
new file mode 100644
index 000000000..46dfd8c9e
--- /dev/null
+++ b/community/arm-none-eabi-gcc/libgloss-configure-fix.patch
@@ -0,0 +1,11 @@
+--- configure.in 2013-09-20 16:23:41.000000000 +0200
++++ /home/mschmoelzer/Projects/newlib/libgloss/arm/configure.in 2014-01-11 00:04:01.000000000 +0100
+@@ -59,7 +59,7 @@
+
+ AC_SUBST(objtype)
+
+-host_makefile_frag=${srcdir}/../config/default.mh
++host_makefile_frag=`cd $srcdir/../config;pwd`/default.mh
+
+ dnl We have to assign the same value to other variables because autoconf
+ dnl doesn't provide a mechanism to substitute a replacement keyword with