summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2007-04-10 05:53:40 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2007-04-10 05:53:40 +0000
commit9415bdbd6cd2276f2f75a856eb2af096f203bfc7 (patch)
treef4f6118e8b66b9084ffd65f01d14195c4b0bc136
parent2007-04-10 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-9415bdbd6cd2276f2f75a856eb2af096f203bfc7.tar.bz2
Backport from rtems-4.8/gcc-4.1.2.
-rw-r--r--contrib/crossrpms/patches/gcc-core-4.1.1-rtems4.7-20070405.diff173
1 files changed, 173 insertions, 0 deletions
diff --git a/contrib/crossrpms/patches/gcc-core-4.1.1-rtems4.7-20070405.diff b/contrib/crossrpms/patches/gcc-core-4.1.1-rtems4.7-20070405.diff
new file mode 100644
index 0000000000..9347d89934
--- /dev/null
+++ b/contrib/crossrpms/patches/gcc-core-4.1.1-rtems4.7-20070405.diff
@@ -0,0 +1,173 @@
+diff -uNr gcc-4.1.1.orig/gcc/config/arm/rtems-elf.h gcc-4.1.1/gcc/config/arm/rtems-elf.h
+--- gcc-4.1.1.orig/gcc/config/arm/rtems-elf.h 2005-11-22 00:28:29.000000000 +0100
++++ gcc-4.1.1/gcc/config/arm/rtems-elf.h 2007-04-10 07:45:18.000000000 +0200
+@@ -27,6 +27,7 @@
+ #define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__rtems__"); \
++ builtin_define ("__USE_INIT_FINI__"); \
+ builtin_assert ("system=rtems"); \
+ } while (0)
+
+diff -uNr gcc-4.1.1.orig/gcc/config/bfin/rtems.h gcc-4.1.1/gcc/config/bfin/rtems.h
+--- gcc-4.1.1.orig/gcc/config/bfin/rtems.h 1970-01-01 01:00:00.000000000 +0100
++++ gcc-4.1.1/gcc/config/bfin/rtems.h 2007-04-10 07:45:18.000000000 +0200
+@@ -0,0 +1,29 @@
++/* Definitions for rtems targeting a bfin
++ Copyright (C) 2006 Free Software Foundation, Inc.
++ Contributed by Ralf Corsépius (ralf.corsepius@rtems.org).
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++
++GCC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING. If not, write to
++the Free Software Foundation, 51 Franklin Street, Fifth Floor,
++Boston, MA 02110-1301, USA. */
++
++/* Target OS preprocessor built-ins. */
++#define TARGET_OS_CPP_BUILTINS() \
++ do \
++ { \
++ builtin_define ("__rtems__"); \
++ builtin_assert ("system=rtems"); \
++ } \
++ while (0)
+diff -uNr gcc-4.1.1.orig/gcc/config/c4x/rtems.h gcc-4.1.1/gcc/config/c4x/rtems.h
+--- gcc-4.1.1.orig/gcc/config/c4x/rtems.h 2005-06-25 03:22:41.000000000 +0200
++++ gcc-4.1.1/gcc/config/c4x/rtems.h 2007-04-10 07:45:18.000000000 +0200
+@@ -24,6 +24,5 @@
+ #define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__rtems__"); \
+- builtin_define ("__USE_INIT_FINI__"); \
+ builtin_assert ("system=rtems"); \
+ } while (0)
+diff -uNr gcc-4.1.1.orig/gcc/config/mips/elf.h gcc-4.1.1/gcc/config/mips/elf.h
+--- gcc-4.1.1.orig/gcc/config/mips/elf.h 2005-07-09 10:46:34.000000000 +0200
++++ gcc-4.1.1/gcc/config/mips/elf.h 2007-04-10 07:45:18.000000000 +0200
+@@ -48,5 +48,3 @@
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC "crtend%O%s crtn%O%s"
+-
+-#define NO_IMPLICIT_EXTERN_C 1
+diff -uNr gcc-4.1.1.orig/gcc/config/mips/mips.h gcc-4.1.1/gcc/config/mips/mips.h
+--- gcc-4.1.1.orig/gcc/config/mips/mips.h 2006-02-17 22:38:59.000000000 +0100
++++ gcc-4.1.1/gcc/config/mips/mips.h 2007-04-10 07:48:21.000000000 +0200
+@@ -450,6 +450,8 @@
+ #endif
+ #endif /* IN_LIBGCC2 */
+
++#define TARGET_LIBGCC_SDATA_SECTION ".sdata"
++
+ #ifndef MULTILIB_ENDIAN_DEFAULT
+ #if TARGET_ENDIAN_DEFAULT == 0
+ #define MULTILIB_ENDIAN_DEFAULT "EL"
+@@ -2712,7 +2714,6 @@
+ /* Define the strings to put out for each section in the object file. */
+ #define TEXT_SECTION_ASM_OP "\t.text" /* instructions */
+ #define DATA_SECTION_ASM_OP "\t.data" /* large data */
+-#define SDATA_SECTION_ASM_OP "\t.sdata" /* small data */
+
+ #undef READONLY_DATA_SECTION_ASM_OP
+ #define READONLY_DATA_SECTION_ASM_OP "\t.rdata" /* read-only data */
+diff -uNr gcc-4.1.1.orig/gcc/config/mips/t-rtems gcc-4.1.1/gcc/config/mips/t-rtems
+--- gcc-4.1.1.orig/gcc/config/mips/t-rtems 2005-01-15 09:38:53.000000000 +0100
++++ gcc-4.1.1/gcc/config/mips/t-rtems 2007-04-10 07:45:18.000000000 +0200
+@@ -1,5 +1,16 @@
+ # Custom multilibs for RTEMS
+
+-MULTILIB_OPTIONS = mips1/mips3/mips32 msoft-float/msingle-float
+-MULTILIB_DIRNAMES = mips1 mips3 mips32 soft-float single
+-MULTILIB_MATCHES = msingle-float=m4650
++# default is mips1 EB hard-float
++MULTILIB_OPTIONS = mips1/mips3/mips32 EB/EL msoft-float
++MULTILIB_DIRNAMES = mips1 mips3 mips32 eb el soft-float
++MULTILIB_MATCHES = EL=mel EB=meb
++
++MULTILIB_EXCEPTIONS =
++
++# Big endian only
++MULTILIB_EXCEPTIONS += EL*
++MULTILIB_EXCEPTIONS += mips32/EL*
++
++# Little endian only
++MULTILIB_EXCEPTIONS += mips3
++MULTILIB_EXCEPTIONS += mips3/msoft-float
+diff -uNr gcc-4.1.1.orig/gcc/config.gcc gcc-4.1.1/gcc/config.gcc
+--- gcc-4.1.1.orig/gcc/config.gcc 2006-05-09 22:02:29.000000000 +0200
++++ gcc-4.1.1/gcc/config.gcc 2007-04-10 07:45:18.000000000 +0200
+@@ -761,6 +761,11 @@
+ tmake_file=bfin/t-bfin-elf
+ use_collect2=no
+ ;;
++bfin*-rtems*)
++ tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/rtems.h rtems.h"
++ tmake_file=bfin/t-bfin-elf
++ use_collect2=no
++ ;;
+ bfin*-*)
+ tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h"
+ tmake_file=bfin/t-bfin
+@@ -1560,7 +1565,7 @@
+ tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
+ use_fixproto=yes
+ ;;
+-mips*-*-rtems*)
++mips-*-rtems*)
+ tm_file="elfos.h ${tm_file} mips/elf.h mips/rtems.h rtems.h"
+ tmake_file="mips/t-elf t-rtems mips/t-rtems"
+ ;;
+diff -uNr gcc-4.1.1.orig/gcc/crtstuff.c gcc-4.1.1/gcc/crtstuff.c
+--- gcc-4.1.1.orig/gcc/crtstuff.c 2005-11-15 02:21:29.000000000 +0100
++++ gcc-4.1.1/gcc/crtstuff.c 2007-04-10 07:45:24.000000000 +0200
+@@ -225,6 +225,9 @@
+ in one DSO or the main program is not used in another object. The
+ dynamic linker takes care of this. */
+
++#ifdef TARGET_LIBGCC_SDATA_SECTION
++extern void *__dso_handle __attribute__ ((__section__ (TARGET_LIBGCC_SDATA_SECTION)));
++#endif
+ #ifdef HAVE_GAS_HIDDEN
+ extern void *__dso_handle __attribute__ ((__visibility__ ("hidden")));
+ #endif
+diff -uNr gcc-4.1.1.orig/gcc/Makefile.in gcc-4.1.1/gcc/Makefile.in
+--- gcc-4.1.1.orig/gcc/Makefile.in 2006-05-17 20:38:58.000000000 +0200
++++ gcc-4.1.1/gcc/Makefile.in 2007-04-10 07:45:18.000000000 +0200
+@@ -3616,9 +3616,9 @@
+ install-driver: installdirs xgcc$(exeext)
+ -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
+ -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
+- -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)
++ -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext)
+ -( cd $(DESTDIR)$(bindir) && \
+- $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version) )
++ $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version)$(exeext) )
+ -if [ -f gcc-cross$(exeext) ] ; then \
+ if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \
+ rm -f $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \
+diff -uNr gcc-4.1.1.orig/Makefile.in gcc-4.1.1/Makefile.in
+--- gcc-4.1.1.orig/Makefile.in 2006-04-04 23:03:05.000000000 +0200
++++ gcc-4.1.1/Makefile.in 2007-04-10 07:45:18.000000000 +0200
+@@ -329,9 +329,9 @@
+ # CFLAGS will be just -g. We want to ensure that TARGET libraries
+ # (which we know are built with gcc) are built with optimizations so
+ # prepend -O2 when setting CFLAGS_FOR_TARGET.
+-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
++CFLAGS_FOR_TARGET = $(strip -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
+ SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
+-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
++CXXFLAGS_FOR_TARGET = $(strip $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
+ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
+ LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
+ LDFLAGS_FOR_TARGET =