From 5f622fc2425565c12730738de5533e2153b04da5 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 31 May 2014 13:38:56 +0800 Subject: [PATCH] Externals/cross-compiler - Fix GCC patchset to emit a correct userland --- Externals/config.mk | 2 +- Externals/cross-compiler/Makefile | 4 ++-- Externals/cross-compiler/patches/gcc/gcc/config.gcc.patch | 4 ++-- Externals/cross-compiler/patches/gcc/gcc/config/acess2.h | 6 ++++++ .../cross-compiler/patches/gcc/libgcc/config.host.patch | 4 ++-- Externals/libspiderscript/source | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Externals/config.mk b/Externals/config.mk index 3d7913b5..f11a1d1b 100644 --- a/Externals/config.mk +++ b/Externals/config.mk @@ -4,7 +4,7 @@ -include ../../Makefile.cfg ifeq ($(ARCH),x86) - BFD := i586 + BFD := i686 else ifeq ($(ARCH),x86_64) BFD := x86_64 else diff --git a/Externals/cross-compiler/Makefile b/Externals/cross-compiler/Makefile index 9dde5d88..6dd554f3 100644 --- a/Externals/cross-compiler/Makefile +++ b/Externals/cross-compiler/Makefile @@ -42,7 +42,7 @@ $(warning $(BINUTILS_DIR) $(GCC_DIR)) $(GCC_DIR)/%: patches/gcc/%.patch @echo [PATCH] $@ - #@tar -xf $(GCC_ARCHIVE) $@ + @tar -xf $(GCC_ARCHIVE) $@ @patch $@ $< $(GCC_DIR)/%: patches/gcc/% @echo [CP] $@ @@ -50,7 +50,7 @@ $(GCC_DIR)/%: patches/gcc/% $(BINUTILS_DIR)/%: patches/binutils/%.patch @echo [PATCH] $@ - #@tar -xf $(BINUTILS_ARCHIVE) $@ + @tar -xf $(BINUTILS_ARCHIVE) $@ @patch $@ $< $(BINUTILS_DIR)/%: patches/binutils/% @echo [CP] $@ diff --git a/Externals/cross-compiler/patches/gcc/gcc/config.gcc.patch b/Externals/cross-compiler/patches/gcc/gcc/config.gcc.patch index 4a1525f2..d50ab47d 100644 --- a/Externals/cross-compiler/patches/gcc/gcc/config.gcc.patch +++ b/Externals/cross-compiler/patches/gcc/gcc/config.gcc.patch @@ -4,7 +4,7 @@ # Common parts for widely ported systems. case ${target} in +*-*-acess2*) -+ extra_parts="crtbegin.o crtend.o" ++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o crtendT.o" + gas=yes + gnu_ld=yes + default_use_cxa_atexit=yes @@ -16,7 +16,7 @@ ;; +i[3-7]86-*-acess2*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h newlib-stdint.h acess2.h" -+ tmake_file="i386/t-i386elf t-svr4" ++ tmake_file="i386/t-i386elf i386/t-crtstuff t-svr4" + use_fixproto=yes + ;; i[34567]86-*-elf*) diff --git a/Externals/cross-compiler/patches/gcc/gcc/config/acess2.h b/Externals/cross-compiler/patches/gcc/gcc/config/acess2.h index ec3c1131..44a4e037 100644 --- a/Externals/cross-compiler/patches/gcc/gcc/config/acess2.h +++ b/Externals/cross-compiler/patches/gcc/gcc/config/acess2.h @@ -9,6 +9,12 @@ #define LIB_SPEC "-lc -lld-acess -lposix" #define LIBSTDCXX "c++" +#undef STARTFILE_SPEC +#undef ENDFILE_SPEC +#define STARTFILE_SPEC "crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} %{shared:crt0S.o%s;:crt0.o%s}" +#define ENDFILE_SPEC "%{static:crtendT.o%s;shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" +#undef LINK_SPEC +#define LINK_SPEC "%{shared:-shared} %{!shared:%{!static:%{rdynamic:-export-dynamic}%{!dynamic-linker:-dynamic-linker /Acess/Libs/ld-acess.so}}}" /* #undef TARGET_VERSION // note that adding these two lines cause an error in gcc-4.7.0 diff --git a/Externals/cross-compiler/patches/gcc/libgcc/config.host.patch b/Externals/cross-compiler/patches/gcc/libgcc/config.host.patch index bcf7a4af..e250c603 100644 --- a/Externals/cross-compiler/patches/gcc/libgcc/config.host.patch +++ b/Externals/cross-compiler/patches/gcc/libgcc/config.host.patch @@ -5,11 +5,11 @@ tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic" ;; +i[3-7]86-*-acess2*) -+ extra_parts="crtbegin.o crtend.o" ++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o crtendT.o" + tmake_file="$tmake_file i386/t-crtstuff" + ;; +x86_64-*-acess2*) -+ extra_parts="crtbegin.o crtend.o" ++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o crtendT.o" + tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic" + ;; i[34567]86-*-freebsd*) diff --git a/Externals/libspiderscript/source b/Externals/libspiderscript/source index 9f2d7faf..a5d190a8 160000 --- a/Externals/libspiderscript/source +++ b/Externals/libspiderscript/source @@ -1 +1 @@ -Subproject commit 9f2d7faf34c16ceaee2f1bffe3d5558c41382523 +Subproject commit a5d190a89ca3f3a78c8b44a855b044ff4e713bb3 -- 2.20.1