diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2014-06-15 10:05:13 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-06-15 10:05:46 +0200 |
commit | 47e410981184016a6ab4c58fdfc9449e2fd945e7 (patch) | |
tree | e279669cc8f7976f9e661fbebade152978e6f1c6 /toolchain/gcc | |
parent | f7712ed524e8811fedee86d7b829c2f2e27dc38b (diff) |
add support for xtensa architecture, tested with qemu. thanks to Max Filippov for help
Diffstat (limited to 'toolchain/gcc')
-rw-r--r-- | toolchain/gcc/Makefile | 11 | ||||
-rw-r--r-- | toolchain/gcc/patches/4.8.3/musl-stubs.patch | 35 |
2 files changed, 32 insertions, 14 deletions
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile index f6033d208..5c1f14c0b 100644 --- a/toolchain/gcc/Makefile +++ b/toolchain/gcc/Makefile @@ -10,6 +10,10 @@ ifeq ($(ADK_TARGET_LIB_MUSL),y) TARGET_CXXFLAGS:= $(filter-out -fstack-protector-all,$(TARGET_CXXFLAGS)) endif +ifneq ($(ADK_LINUX_XTENSA),y) +GCC_FINAL_CONFOPTS+= --enable-cxx-flags='$(TARGET_CXXFLAGS)' +endif + GCC_CONFOPTS:= --prefix=$(TOOLCHAIN_DIR)/usr \ --with-bugurl="http://www.openadk.org/" \ --build=$(GNU_HOST_NAME) \ @@ -131,6 +135,10 @@ GCC_BUILD_DIR_INITIAL:= $(WRKBUILD)-initial GCC_BUILD_DIR_FINAL:= $(WRKBUILD)-final $(GCC_BUILD_DIR_MINIMAL)/.configured: +ifeq ($(ADK_LINUX_XTENSA),y) + tar xf $(TOPDIR)/target/xtensa/overlay/xtensa_dc232b.tar \ + --strip-components=1 -C $(WRKSRC) gcc +endif mkdir -p $(GCC_BUILD_DIR_MINIMAL) # these symlinks are very important, do not remove rm -rf $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/sys-include @@ -198,8 +206,7 @@ $(GCC_BUILD_DIR_FINAL)/.configured: --enable-languages=$(LANGUAGES) \ --with-build-sysroot='$${prefix}/${STAGING_HOST2TARGET}' \ --with-sysroot='$${prefix}/${STAGING_HOST2TARGET}' \ - --enable-shared='libstdc++' \ - --enable-cxx-flags='$(TARGET_CXXFLAGS)' + --enable-shared='libstdc++' touch $@ $(WRKBUILD)/.compiled: $(GCC_BUILD_DIR_FINAL)/.configured diff --git a/toolchain/gcc/patches/4.8.3/musl-stubs.patch b/toolchain/gcc/patches/4.8.3/musl-stubs.patch index 35050fd9c..779bcd3fb 100644 --- a/toolchain/gcc/patches/4.8.3/musl-stubs.patch +++ b/toolchain/gcc/patches/4.8.3/musl-stubs.patch @@ -1,6 +1,6 @@ -diff -Nur gcc-4.8.2.orig/gcc/config/m68k/linux.h gcc-4.8.2/gcc/config/m68k/linux.h ---- gcc-4.8.2.orig/gcc/config/m68k/linux.h 2013-01-10 21:38:27.000000000 +0100 -+++ gcc-4.8.2/gcc/config/m68k/linux.h 2014-02-24 10:19:00.214399704 +0100 +diff -Nur gcc-4.8.3.orig/gcc/config/m68k/linux.h gcc-4.8.3/gcc/config/m68k/linux.h +--- gcc-4.8.3.orig/gcc/config/m68k/linux.h 2013-01-10 21:38:27.000000000 +0100 ++++ gcc-4.8.3/gcc/config/m68k/linux.h 2014-06-01 08:57:42.139913658 +0200 @@ -72,6 +72,7 @@ done. */ @@ -9,9 +9,9 @@ diff -Nur gcc-4.8.2.orig/gcc/config/m68k/linux.h gcc-4.8.2/gcc/config/m68k/linux #undef LINK_SPEC #define LINK_SPEC "-m m68kelf %{shared} \ -diff -Nur gcc-4.8.2.orig/gcc/config/mips/linux64.h gcc-4.8.2/gcc/config/mips/linux64.h ---- gcc-4.8.2.orig/gcc/config/mips/linux64.h 2013-01-10 21:38:27.000000000 +0100 -+++ gcc-4.8.2/gcc/config/mips/linux64.h 2014-02-24 10:19:47.238583895 +0100 +diff -Nur gcc-4.8.3.orig/gcc/config/mips/linux64.h gcc-4.8.3/gcc/config/mips/linux64.h +--- gcc-4.8.3.orig/gcc/config/mips/linux64.h 2013-01-10 21:38:27.000000000 +0100 ++++ gcc-4.8.3/gcc/config/mips/linux64.h 2014-06-01 08:57:42.139913658 +0200 @@ -27,6 +27,9 @@ #define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1" #define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0" @@ -23,9 +23,9 @@ diff -Nur gcc-4.8.2.orig/gcc/config/mips/linux64.h gcc-4.8.2/gcc/config/mips/lin CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ - BIONIC_DYNAMIC_LINKERN32) + BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32) -diff -Nur gcc-4.8.2.orig/gcc/config/sparc/linux64.h gcc-4.8.2/gcc/config/sparc/linux64.h ---- gcc-4.8.2.orig/gcc/config/sparc/linux64.h 2013-01-10 21:38:27.000000000 +0100 -+++ gcc-4.8.2/gcc/config/sparc/linux64.h 2014-02-24 10:20:49.414827006 +0100 +diff -Nur gcc-4.8.3.orig/gcc/config/sparc/linux64.h gcc-4.8.3/gcc/config/sparc/linux64.h +--- gcc-4.8.3.orig/gcc/config/sparc/linux64.h 2013-01-10 21:38:27.000000000 +0100 ++++ gcc-4.8.3/gcc/config/sparc/linux64.h 2014-06-01 08:57:42.139913658 +0200 @@ -94,6 +94,9 @@ #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" @@ -36,9 +36,9 @@ diff -Nur gcc-4.8.2.orig/gcc/config/sparc/linux64.h gcc-4.8.2/gcc/config/sparc/l #ifdef SPARC_BI_ARCH -diff -Nur gcc-4.8.2.orig/gcc/config/sparc/linux.h gcc-4.8.2/gcc/config/sparc/linux.h ---- gcc-4.8.2.orig/gcc/config/sparc/linux.h 2013-01-10 21:38:27.000000000 +0100 -+++ gcc-4.8.2/gcc/config/sparc/linux.h 2014-02-24 10:21:14.342924339 +0100 +diff -Nur gcc-4.8.3.orig/gcc/config/sparc/linux.h gcc-4.8.3/gcc/config/sparc/linux.h +--- gcc-4.8.3.orig/gcc/config/sparc/linux.h 2013-01-10 21:38:27.000000000 +0100 ++++ gcc-4.8.3/gcc/config/sparc/linux.h 2014-06-01 08:57:42.139913658 +0200 @@ -84,6 +84,7 @@ done. */ @@ -47,3 +47,14 @@ diff -Nur gcc-4.8.2.orig/gcc/config/sparc/linux.h gcc-4.8.2/gcc/config/sparc/lin #undef LINK_SPEC #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \ +diff -Nur gcc-4.8.3.orig/gcc/config/xtensa/linux.h gcc-4.8.3/gcc/config/xtensa/linux.h +--- gcc-4.8.3.orig/gcc/config/xtensa/linux.h 2013-01-10 21:38:27.000000000 +0100 ++++ gcc-4.8.3/gcc/config/xtensa/linux.h 2014-06-01 08:58:39.740070402 +0200 +@@ -45,6 +45,7 @@ + %{mno-longcalls:--no-longcalls}" + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-xtensa.so.1" + + #undef LINK_SPEC + #define LINK_SPEC \ |