diff --git a/dkarm-eabi/patches/gcc-7.3.0.patch b/dkarm-eabi/patches/gcc-7.3.0.patch new file mode 100644 index 0000000..c2d4a43 --- /dev/null +++ b/dkarm-eabi/patches/gcc-7.3.0.patch @@ -0,0 +1,125 @@ +diff -NBaur gcc-7.3.0/gcc/config/arm/t-arm-elf gcc-7.3.0-arm/gcc/config/arm/t-arm-elf +--- gcc-7.3.0/gcc/config/arm/t-arm-elf 2017-01-01 12:07:43.905435000 +0000 ++++ gcc-7.3.0-arm/gcc/config/arm/t-arm-elf 2018-02-11 19:35:34.805307181 +0000 +@@ -16,11 +16,19 @@ + # along with GCC; see the file COPYING3. If not see + # . + +-MULTILIB_OPTIONS = marm/mthumb +-MULTILIB_DIRNAMES = arm thumb ++MULTILIB_OPTIONS = mthumb mbig-endian march=armv6k mfloat-abi=hard ++MULTILIB_DIRNAMES = thumb be armv6k fpu + MULTILIB_EXCEPTIONS = + MULTILIB_MATCHES = + ++MULTILIB_REQUIRED = mthumb mbig-endian mthumb/mbig-endian march=armv6k/mfloat-abi=hard ++ ++ ++MULTILIB_MATCHES += march?armv6k=mtune?mpcore ++MULTILIB_MATCHES += march?armv6k=mcpu?mpcore ++ ++ ++ + #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 +@@ -38,9 +46,9 @@ + # 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_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* + +diff -NBaur gcc-7.3.0/gcc/config/arm/unknown-elf.h gcc-7.3.0-arm/gcc/config/arm/unknown-elf.h +--- gcc-7.3.0/gcc/config/arm/unknown-elf.h 2017-01-01 12:07:43.905435000 +0000 ++++ gcc-7.3.0-arm/gcc/config/arm/unknown-elf.h 2018-02-11 19:35:34.805307181 +0000 +@@ -29,7 +29,7 @@ + #endif + + /* Now we define the strings used to build the spec file. */ +-#define UNKNOWN_ELF_STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s" ++#define UNKNOWN_ELF_STARTFILE_SPEC " crti%O%s crtbegin%O%s" + + #undef STARTFILE_SPEC + #define STARTFILE_SPEC \ +@@ -93,4 +93,9 @@ + udivmoddi4, which will depend on the exception unwind routines, + which will depend on abort, which is defined in libc. */ + #undef LINK_GCC_C_SEQUENCE_SPEC +-#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L --end-group" ++#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L %(libgloss) --end-group" ++ ++/* The system headers under devkitARM are C++-aware. */ ++#undef NO_IMPLICIT_EXTERN_C ++#define NO_IMPLICIT_EXTERN_C ++ +diff -NBaur gcc-7.3.0/gcc/gcc.c gcc-7.3.0-arm/gcc/gcc.c +--- gcc-7.3.0/gcc/gcc.c 2017-09-15 09:18:34.015147000 +0100 ++++ gcc-7.3.0-arm/gcc/gcc.c 2018-02-11 19:35:34.805307181 +0000 +@@ -779,6 +779,11 @@ + #endif + #endif + ++#ifndef LIBGLOSS_SPEC ++# define LIBGLOSS_SPEC "-lsysbase" ++#endif ++ ++ + /* config.h can define STARTFILE_SPEC to override the default crt0 files. */ + #ifndef STARTFILE_SPEC + #define STARTFILE_SPEC \ +@@ -1074,6 +1079,7 @@ + static const char *lib_spec = LIB_SPEC; + static const char *link_gomp_spec = ""; + static const char *libgcc_spec = LIBGCC_SPEC; ++static const char *libgloss_spec = LIBGLOSS_SPEC; + static const char *endfile_spec = ENDFILE_SPEC; + static const char *startfile_spec = STARTFILE_SPEC; + static const char *linker_name_spec = LINKER_NAME; +@@ -1579,6 +1585,7 @@ + INIT_STATIC_SPEC ("lib", &lib_spec), + INIT_STATIC_SPEC ("link_gomp", &link_gomp_spec), + INIT_STATIC_SPEC ("libgcc", &libgcc_spec), ++ INIT_STATIC_SPEC ("libgloss", &libgloss_spec), + INIT_STATIC_SPEC ("startfile", &startfile_spec), + INIT_STATIC_SPEC ("cross_compile", &cross_compile), + INIT_STATIC_SPEC ("version", &compiler_version), +diff -NBaur gcc-7.3.0/libgcc/config/arm/t-bpabi gcc-7.3.0-arm/libgcc/config/arm/t-bpabi +--- gcc-7.3.0/libgcc/config/arm/t-bpabi 2012-08-17 16:06:06.447485000 +0100 ++++ gcc-7.3.0-arm/libgcc/config/arm/t-bpabi 2018-02-11 19:35:34.809307181 +0000 +@@ -17,4 +17,4 @@ + # On ARM, specifying -fnon-call-exceptions will needlessly pull in + # the unwinder in simple programs which use 64-bit division. Omitting + # the option is safe. +-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions ++LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions +diff -NBaur gcc-7.3.0/libgcc/crtstuff.c gcc-7.3.0-arm/libgcc/crtstuff.c +--- gcc-7.3.0/libgcc/crtstuff.c 2017-01-01 12:07:43.905435000 +0000 ++++ gcc-7.3.0-arm/libgcc/crtstuff.c 2018-02-11 19:35:34.809307181 +0000 +@@ -47,7 +47,7 @@ + + /* Target machine header files require this define. */ + #define IN_LIBGCC2 +- ++#define USED_FOR_TARGET + /* FIXME: Including auto-host is incorrect, but until we have + identified the set of defines that need to go into auto-target.h, + this will have to do. */ +diff -NBaur gcc-7.3.0/libgcc/Makefile.in gcc-7.3.0-arm/libgcc/Makefile.in +--- gcc-7.3.0/libgcc/Makefile.in 2017-04-19 09:08:44.446150000 +0100 ++++ gcc-7.3.0-arm/libgcc/Makefile.in 2018-02-11 19:35:34.809307181 +0000 +@@ -844,7 +844,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/select_toolchain.sh b/select_toolchain.sh index a64037e..5634c54 100755 --- a/select_toolchain.sh +++ b/select_toolchain.sh @@ -30,10 +30,10 @@ done case "$VERSION" in "1" ) - GCC_VER=7.2.0 - BINUTILS_VER=2.29.1 + GCC_VER=7.3.0 + BINUTILS_VER=2.30 NEWLIB_VER=2.5.0 - GDB_VER=8.0.1 + GDB_VER=8.0 basedir='dkarm-eabi' package=devkitARM target=arm-none-eabi