From 7aac10ec00a333ada7f2c1a9068a1e3386ef5192 Mon Sep 17 00:00:00 2001 From: Piotr Esden-Tempski Date: Tue, 1 Jan 2013 00:37:28 -0800 Subject: [PATCH] Updated all tools and libraries to the newest versions. Updated patches. --- .../patch-binutils-2.23.1-svc-cortexm3.diff | 12 +++++ patches/patch-gcc-config-arm-t-arm-elf.diff | 46 ++++++++----------- patches/patch-gcc-gengtype-fix.diff | 18 ++++---- patches/patch-libgcc-divide-exceptions.diff | 29 ++++-------- summon-arm-toolchain | 30 ++++++------ 5 files changed, 65 insertions(+), 70 deletions(-) create mode 100644 patches/patch-binutils-2.23.1-svc-cortexm3.diff diff --git a/patches/patch-binutils-2.23.1-svc-cortexm3.diff b/patches/patch-binutils-2.23.1-svc-cortexm3.diff new file mode 100644 index 0000000..c07b0ee --- /dev/null +++ b/patches/patch-binutils-2.23.1-svc-cortexm3.diff @@ -0,0 +1,12 @@ +--- include/opcode/arm.h.orig 2013-01-01 00:30:01.000000000 -0800 ++++ include/opcode/arm.h 2013-01-01 00:30:15.000000000 -0800 +@@ -113,7 +113,8 @@ + #define ARM_AEXT_V6KT2 (ARM_AEXT_V6T2 | ARM_EXT_V6K) + #define ARM_AEXT_V6ZT2 (ARM_AEXT_V6T2 | ARM_EXT_SEC) + #define ARM_AEXT_V6ZKT2 (ARM_AEXT_V6T2 | ARM_EXT_V6K | ARM_EXT_SEC) +-#define ARM_AEXT_V7_ARM (ARM_AEXT_V6KT2 | ARM_EXT_V7 | ARM_EXT_BARRIER) ++#define ARM_AEXT_V7_ARM (ARM_AEXT_V6KT2 | ARM_EXT_V7 | ARM_EXT_BARRIER \ ++ | ARM_EXT_OS) + #define ARM_AEXT_V7A (ARM_AEXT_V7_ARM | ARM_EXT_V7A) + #define ARM_AEXT_V7R (ARM_AEXT_V7_ARM | ARM_EXT_V7R | ARM_EXT_DIV) + #define ARM_AEXT_NOTM \ diff --git a/patches/patch-gcc-config-arm-t-arm-elf.diff b/patches/patch-gcc-config-arm-t-arm-elf.diff index 0c3cb60..ab028f2 100644 --- a/patches/patch-gcc-config-arm-t-arm-elf.diff +++ b/patches/patch-gcc-config-arm-t-arm-elf.diff @@ -1,8 +1,8 @@ ---- gcc/config/arm/t-arm-elf.orig 2011-10-25 21:33:18.000000000 -0700 -+++ gcc/config/arm/t-arm-elf 2011-10-30 18:15:16.000000000 -0700 -@@ -31,78 +31,33 @@ - _arm_floatdidf _arm_floatdisf _arm_floatundidf _arm_floatundisf \ - _clzsi2 _clzdi2 +--- gcc/config/arm/t-arm-elf.orig 2012-12-11 00:42:29.000000000 -0800 ++++ gcc/config/arm/t-arm-elf 2012-12-31 14:43:34.000000000 -0800 +@@ -17,75 +17,30 @@ + # along with GCC; see the file COPYING3. If not see + # . +# We have to build 'arm' and 'thumb' libraries, it seems. MULTILIB_OPTIONS = marm/mthumb @@ -13,7 +13,10 @@ -#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 -- ++# Only we don't actually want any ARM libraries. Or ++# vanilla thumb libraries. ++MULTILIB_EXCEPTIONS = marm* mthumb + -#MULTILIB_OPTIONS += march=armv7 -#MULTILIB_DIRNAMES += thumb2 -#MULTILIB_EXCEPTIONS += march=armv7* marm/*march=armv7* @@ -23,7 +26,10 @@ -#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). @@ -32,7 +38,11 @@ -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* @@ -41,9 +51,9 @@ -# MULTILIB_DIRNAMES += le be -# MULTILIB_MATCHES += mbig-endian=mbe mlittle-endian=mle -# --# MULTILIB_OPTIONS += mhard-float/msoft-float +-# MULTILIB_OPTIONS += mfloat-abi=hard/mfloat-abi=soft -# MULTILIB_DIRNAMES += fpu soft --# MULTILIB_EXCEPTIONS += *mthumb/*mhard-float* +-# MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard* -# -# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork -# MULTILIB_DIRNAMES += normal interwork @@ -77,19 +87,6 @@ -# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm600 -# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm610 -# MULTILIB_MATCHES += mcpu?arm7=mcpu?arm620 -+# Only we don't actually want any ARM libraries. Or -+# vanilla thumb libraries. -+MULTILIB_EXCEPTIONS = marm* mthumb -+ -+# 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 -+ -+# 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* -+ +# All this just to get mfloat-abi=hard mfpu=fpv4-sp-d16 only specified for the M4 +MULTILIB_OPTIONS += mfloat-abi=hard mfpu=fpv4-sp-d16 +MULTILIB_DIRNAMES += float-abi-hard fpuv4-sp-d16 @@ -100,6 +97,3 @@ +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* - - EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o - diff --git a/patches/patch-gcc-gengtype-fix.diff b/patches/patch-gcc-gengtype-fix.diff index 47b8f31..c4c6fae 100644 --- a/patches/patch-gcc-gengtype-fix.diff +++ b/patches/patch-gcc-gengtype-fix.diff @@ -1,19 +1,17 @@ -diff --git a/gcc/gengtype.c b/gcc/gengtype.c -index abf17f8..550d3bb 100644 ---- a/gcc/gengtype.c -+++ b/gcc/gengtype.c -@@ -3594,13 +3594,13 @@ write_field_root (outf_p f, pair_p v, type_p type, const char *name, - int has_length, struct fileloc *line, const char *if_marked, - bool emit_pch, type_p field_type, const char *field_name) +--- gcc/gengtype.c.orig 2012-12-11 00:42:29.000000000 -0800 ++++ gcc/gengtype.c 2012-12-31 14:53:26.000000000 -0800 +@@ -3651,13 +3651,13 @@ + int has_length, struct fileloc *line, const char *if_marked, + bool emit_pch, type_p field_type, const char *field_name) { -+ struct pair newv; +- struct pair newv; /* If the field reference is relative to V, rather than to some subcomponent of V, we can mark any subarrays with a single stride. We're effectively treating the field as a global variable in its own right. */ if (v && type == v->type) { -- struct pair newv; - ++ struct pair newv; newv = *v; newv.type = field_type; + newv.name = ACONCAT ((v->name, ".", field_name, NULL)); diff --git a/patches/patch-libgcc-divide-exceptions.diff b/patches/patch-libgcc-divide-exceptions.diff index c4b4318..b97e16b 100644 --- a/patches/patch-libgcc-divide-exceptions.diff +++ b/patches/patch-libgcc-divide-exceptions.diff @@ -1,23 +1,23 @@ ---- libgcc/Makefile.in.orig 2011-12-26 20:25:30.000000000 -0800 -+++ libgcc/Makefile.in 2011-12-26 21:24:54.000000000 -0800 -@@ -411,14 +411,14 @@ +--- libgcc/Makefile.in.orig 2012-12-31 15:19:32.000000000 -0800 ++++ libgcc/Makefile.in 2012-12-31 15:19:43.000000000 -0800 +@@ -500,14 +500,14 @@ lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS)) - $(lib2-divmod-o): %$(objext): $(gcc_srcdir)/libgcc2.c - $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \ + $(lib2-divmod-o): %$(objext): $(srcdir)/libgcc2.c + $(gcc_compile) -DL$* -c $< \ - -fexceptions -fnon-call-exceptions $(vis_hide) -+ -fno-exceptions -fno-non-call-exceptions $(vis_hide) ++ -fno-exceptions -fnon-call-exceptions $(vis_hide) libgcc-objects += $(lib2-divmod-o) ifeq ($(enable_shared),yes) lib2-divmod-s-o = $(patsubst %,%_s$(objext),$(LIB2_DIVMOD_FUNCS)) - $(lib2-divmod-s-o): %_s$(objext): $(gcc_srcdir)/libgcc2.c - $(gcc_s_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \ + $(lib2-divmod-s-o): %_s$(objext): $(srcdir)/libgcc2.c + $(gcc_s_compile) -DL$* -c $< \ - -fexceptions -fnon-call-exceptions -+ -fno-exceptions -fno-non-call-exceptions ++ -fno-exceptions -fnon-call-exceptions libgcc-s-objects += $(lib2-divmod-s-o) endif -@@ -706,7 +706,7 @@ +@@ -814,7 +814,7 @@ # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and # LIB2ADDEHSHARED matter. (Usually all three are identical.) @@ -26,12 +26,3 @@ ifeq ($(enable_shared),yes) -@@ -728,7 +728,7 @@ - - # Build LIBUNWIND. - --c_flags := -fexceptions -+c_flags := -fno-exceptions - - libunwind-objects += $(addsuffix $(objext),$(basename $(notdir $(LIBUNWIND)))) - diff --git a/summon-arm-toolchain b/summon-arm-toolchain index f48d651..eb91fba 100755 --- a/summon-arm-toolchain +++ b/summon-arm-toolchain @@ -112,31 +112,31 @@ echo "CPUS=$CPUS" ############################################################################## if [ ${USE_LINARO} == 0 ] ; then # For FSF GCC: - GCCVERSION=4.5.2 + GCCVERSION=4.7.2 GCC=gcc-${GCCVERSION} GCCURL=http://ftp.gnu.org/gnu/gcc/${GCC}/${GCC}.tar.gz # For FSF GDB: - GDBVERSION=7.3.1 + GDBVERSION=7.5.1 GDB=gdb-${GDBVERSION} GDBURL=http://ftp.gnu.org/gnu/gdb/${GDB}.tar.bz2 else # For Linaro GCC: - GCCRELEASE=4.6-2011.10 - GCCVERSION=4.6-2011.10 + GCCRELEASE=4.7-2012.12 + GCCVERSION=4.7-2012.12 GCC=gcc-linaro-${GCCVERSION} - GCCURL=http://launchpad.net/gcc-linaro/4.6/${GCCRELEASE}/+download/${GCC}.tar.bz2 + GCCURL=http://launchpad.net/gcc-linaro/4.7/${GCCRELEASE}/+download/${GCC}.tar.bz2 # For Linaro GDB: - GDBRELEASE=7.3-2011.10 - GDBVERSION=7.3-2011.10 + GDBRELEASE=7.5-2012.12-1 + GDBVERSION=7.5-2012.12-1 GDB=gdb-linaro-${GDBVERSION} - GDBURL=http://launchpad.net/gdb-linaro/7.3/${GDBRELEASE}/+download/${GDB}.tar.bz2 + GDBURL=http://launchpad.net/gdb-linaro/7.5/${GDBRELEASE}/+download/${GDB}.tar.bz2 fi -BINUTILS=binutils-2.21.1 -NEWLIB=newlib-1.19.0 -OOCD=openocd-0.6.0 +BINUTILS=binutils-2.23.1 +NEWLIB=newlib-2.0.0 +OOCD=openocd-0.6.1 OOCD_GIT= LIBCMSIS= LIBCMSIS_GIT=v1.10-3 @@ -220,7 +220,7 @@ case "$(uname)" in OOCD_LDFLAGS="-L/opt/mine/lib -L${DARWIN_OPT_PATH}/lib" if gcc --version | grep llvm-gcc > /dev/null ; then echo "Found you are using llvm gcc, switching to clang for gcc compile." - GCC_CC=clang + GCC_CC=llvm-gcc fi ;; CYGWIN*) @@ -334,7 +334,7 @@ fetch ${GDB} ${GDBURL} if [ ${OOCD_EN} != 0 ]; then if [ "x${OOCD_GIT}" == "x" ]; then - fetch ${OOCD} http://sourceforge.net/projects/openocd/files/openocd/0.6.0/${OOCD}.tar.bz2 + fetch ${OOCD} http://sourceforge.net/projects/openocd/files/openocd/0.6.1/${OOCD}.tar.bz2 else clone oocd ${OOCD_GIT} git://openocd.git.sourceforge.net/gitroot/openocd/openocd ./bootstrap fi @@ -386,7 +386,7 @@ if [ ! -e ${STAMPS}/${BINUTILS}.build ]; then unpack ${BINUTILS} log "Patching binutils to allow SVC support on cortex-m3" cd ${BINUTILS} - patch -p1 -i ../patches/patch-binutils-2.21.1-svc-cortexm3.diff + patch -p0 -i ../patches/patch-binutils-2.23.1-svc-cortexm3.diff cd .. cd build log "Configuring ${BINUTILS}" @@ -420,7 +420,7 @@ if [ ! -e ${STAMPS}/${GCC}-${NEWLIB}.build ]; then log "Patching gcc to add multilib support" cd ${GCC} patch -p0 -i ../patches/patch-gcc-config-arm-t-arm-elf.diff - patch -p1 -i ../patches/patch-gcc-gengtype-fix.diff + patch -p0 -i ../patches/patch-gcc-gengtype-fix.diff patch -p0 -i ../patches/patch-libgcc-divide-exceptions.diff cd .. fi