update gcc nios2 support, thanks atle
authorIvan Kuten <ivan.kuten@promwad.com>
Fri, 9 Nov 2007 09:57:25 +0000 (09:57 -0000)
committerIvan Kuten <ivan.kuten@promwad.com>
Fri, 9 Nov 2007 09:57:25 +0000 (09:57 -0000)
toolchain/Config.in.2
toolchain/gcc/3.4.6/901-nios2-ctor_dtor.patch [new file with mode: 0644]
toolchain/gcc/3.4.6/nios2-config-fix.patch.conditional [new file with mode: 0644]
toolchain/gcc/Makefile.in
toolchain/gcc/gcc-uclibc-3.x.mk

index 244fcf108969d06061632c77ce869fcf5debf5bc..c99e4fb82e31a1f85682db799a5b7051b94bf593 100644 (file)
@@ -48,7 +48,7 @@ config BR2_USE_WCHAR
 config BR2_SOFT_FLOAT
        bool "Use software floating point by default"
        default n
-       depends on BR2_arm || BR2_armeb || BR2_avr32 || BR2_mips || BR2_mipsel || BR2_powerpc
+       depends on BR2_arm || BR2_armeb || BR2_avr32 || BR2_mips || BR2_mipsel || BR2_powerpc || BR2_nios2
        help
          If your target CPU does not have a Floating Point Unit (FPU) or a
          kernel FPU emulator, but you still wish to support floating point
diff --git a/toolchain/gcc/3.4.6/901-nios2-ctor_dtor.patch b/toolchain/gcc/3.4.6/901-nios2-ctor_dtor.patch
new file mode 100644 (file)
index 0000000..87145ad
--- /dev/null
@@ -0,0 +1,52 @@
+Index: gcc/gcc/config/nios2/nios2.h
+===================================================================
+--- gcc/gcc/config/nios2/nios2.h       (revision 195)
++++ gcc/gcc/config/nios2/nios2.h       (revision 196)
+@@ -88,8 +88,6 @@
+       N_("All ld/st instructins do not use io variants (default)") },         \
+     { "smallc", 0,                    \
+       N_("Link with a limited version of the C library") },           \
+-    { "ctors-in-init", 0,                     \
+-      "" /* undocumented: N_("Link with static constructors and destructors in init") */ },           \
+     { "", TARGET_DEFAULT, 0 }                         \
+ }
+@@ -140,12 +138,12 @@
+ #define STARTFILE_SPEC  \
+ "%{msys-crt0=*: %*} %{!msys-crt0=*: crt1%O%s} \
+  %{msys-crt0=: %eYou need a C startup file for -msys-crt0=} \
+- %{mctors-in-init: crti%O%s crtbegin%O%s} \
++ crti%O%s crtbegin%O%s \
+ "
+ #undef ENDFILE_SPEC 
+ #define ENDFILE_SPEC \
+- "%{mctors-in-init: crtend%O%s crtn%O%s}"
++ " crtend%O%s crtn%O%s"
+ /***********************
+Index: gcc/gcc/config/nios2/t-nios2
+===================================================================
+--- gcc/gcc/config/nios2/t-nios2       (revision 195)
++++ gcc/gcc/config/nios2/t-nios2       (revision 196)
+@@ -36,18 +36,8 @@
+       echo ''          >  ${DPBIT}
+       cat $(srcdir)/config/fp-bit.c >> ${DPBIT}
+-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o 
++EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
+-# Assemble startup files. 
+-$(T)crti.o: $(srcdir)/config/nios2/crti.asm $(GCC_PASSES) 
+-      $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
+-      -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/nios2/crti.asm 
+-
+-$(T)crtn.o: $(srcdir)/config/nios2/crtn.asm $(GCC_PASSES) 
+-      $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
+-      -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/nios2/crtn.asm 
+-
+-
+ ## You may need to provide additional #defines at the beginning of
+ ## fp-bit.c and dp-bit.c to control target endianness and other options
+ ##
diff --git a/toolchain/gcc/3.4.6/nios2-config-fix.patch.conditional b/toolchain/gcc/3.4.6/nios2-config-fix.patch.conditional
new file mode 100644 (file)
index 0000000..9f1c378
--- /dev/null
@@ -0,0 +1,19 @@
+--- gcc-3.4.6/gcc/config/t-linux-uclibc        2007-11-07 14:50:34.000000000 +0100
++++ /dev/null  2007-11-02 12:35:37.750656579 +0100
+@@ -1,5 +0,0 @@
+-# Remove glibc specific files added in t-linux
+-SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES))
+-
+-# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc
+-LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH))
+--- gcc-3.4.6/gcc/config.gcc.orig      2007-11-07 14:50:34.000000000 +0100
++++ gcc-3.4.6/gcc/config.gcc   2007-11-07 15:32:31.000000000 +0100
+@@ -2334,7 +2334,7 @@
+ # Rather than hook into each target, just do it after all the linux
+ # targets have been processed
+ case ${target} in
+-*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc"
++*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC"
+ esac
+ # Support for --with-cpu and related options (and a few unrelated options,
index 822de1c136f9f5848a79b27136e5f992b5adb25a..1ada6dfaedf7ec12e89a96a0603fb246a723ae8d 100644 (file)
@@ -27,7 +27,9 @@ endif
 ifeq ($(BR2_SOFT_FLOAT),y)
 # gcc 3.4.x soft float configuration is different than previous versions.
 ifeq ($(findstring x3.4.,x$(GCC_VERSION)),x3.4.)
+ifneq ($(BR2_nios2),y)
 SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
+endif
 else
 SOFT_FLOAT_CONFIG_OPTION:=--without-float
 endif
index e2210d06c5dc977ad9c7b14f1c23713700e4108e..c6c622a0ceb7d714af90c520b973afa982f6198d 100644 (file)
@@ -167,6 +167,9 @@ endif
        #ifeq ("$(strip $(ARCH))","i386")
        #toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc i386-gcc-soft-float.patch
        #endif
+endif
+ifeq ("$(strip $(ARCH))","nios2")
+       toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) nios2-config-fix.patch.conditional
 endif
        touch $@