]> rtime.felk.cvut.cz Git - rtems-devel.git/blob - gcc-patches/4.1.2/gcc-core-4.1.2-rtems4.8-20070405.diff
f9de16dc9e3ec2f3bc5e86923e653ad1ecaeb15c
[rtems-devel.git] / gcc-patches / 4.1.2 / gcc-core-4.1.2-rtems4.8-20070405.diff
1 diff -uNr gcc-4.1.2.orig/gcc/config/arm/rtems-elf.h gcc-4.1.2/gcc/config/arm/rtems-elf.h
2 --- gcc-4.1.2.orig/gcc/config/arm/rtems-elf.h   2005-11-22 00:28:29.000000000 +0100
3 +++ gcc-4.1.2/gcc/config/arm/rtems-elf.h        2007-04-05 04:50:02.000000000 +0200
4 @@ -27,6 +27,7 @@
5  #define TARGET_OS_CPP_BUILTINS()               \
6      do {                                       \
7         builtin_define ("__rtems__");           \
8 +       builtin_define ("__USE_INIT_FINI__");   \
9         builtin_assert ("system=rtems");        \
10      } while (0)
11  
12 diff -uNr gcc-4.1.2.orig/gcc/config/c4x/rtems.h gcc-4.1.2/gcc/config/c4x/rtems.h
13 --- gcc-4.1.2.orig/gcc/config/c4x/rtems.h       2005-06-25 03:22:41.000000000 +0200
14 +++ gcc-4.1.2/gcc/config/c4x/rtems.h    2007-04-05 04:50:02.000000000 +0200
15 @@ -24,6 +24,5 @@
16  #define TARGET_OS_CPP_BUILTINS()               \
17      do {                                       \
18         builtin_define ("__rtems__");           \
19 -       builtin_define ("__USE_INIT_FINI__");   \
20         builtin_assert ("system=rtems");        \
21      } while (0)
22 diff -uNr gcc-4.1.2.orig/gcc/config/mips/elf.h gcc-4.1.2/gcc/config/mips/elf.h
23 --- gcc-4.1.2.orig/gcc/config/mips/elf.h        2005-07-09 10:46:34.000000000 +0200
24 +++ gcc-4.1.2/gcc/config/mips/elf.h     2007-04-05 04:50:03.000000000 +0200
25 @@ -48,5 +48,3 @@
26  
27  #undef  ENDFILE_SPEC
28  #define ENDFILE_SPEC "crtend%O%s crtn%O%s"
29 -
30 -#define NO_IMPLICIT_EXTERN_C 1
31 diff -uNr gcc-4.1.2.orig/gcc/config/mips/mips.h gcc-4.1.2/gcc/config/mips/mips.h
32 --- gcc-4.1.2.orig/gcc/config/mips/mips.h       2006-02-17 22:38:59.000000000 +0100
33 +++ gcc-4.1.2/gcc/config/mips/mips.h    2007-04-05 04:49:10.000000000 +0200
34 @@ -450,6 +450,8 @@
35  #endif
36  #endif /* IN_LIBGCC2 */
37  
38 +#define TARGET_LIBGCC_SDATA_SECTION ".sdata"
39 +
40  #ifndef MULTILIB_ENDIAN_DEFAULT
41  #if TARGET_ENDIAN_DEFAULT == 0
42  #define MULTILIB_ENDIAN_DEFAULT "EL"
43 @@ -2712,7 +2714,6 @@
44  /* Define the strings to put out for each section in the object file.  */
45  #define TEXT_SECTION_ASM_OP    "\t.text"       /* instructions */
46  #define DATA_SECTION_ASM_OP    "\t.data"       /* large data */
47 -#define SDATA_SECTION_ASM_OP   "\t.sdata"      /* small data */
48  
49  #undef READONLY_DATA_SECTION_ASM_OP
50  #define READONLY_DATA_SECTION_ASM_OP   "\t.rdata"      /* read-only data */
51 diff -uNr gcc-4.1.2.orig/gcc/config.gcc gcc-4.1.2/gcc/config.gcc
52 --- gcc-4.1.2.orig/gcc/config.gcc       2006-10-16 01:12:23.000000000 +0200
53 +++ gcc-4.1.2/gcc/config.gcc    2007-04-05 04:50:03.000000000 +0200
54 @@ -761,6 +761,11 @@
55          tmake_file=bfin/t-bfin-elf
56          use_collect2=no
57          ;;
58 +bfin*-rtems*)
59 +       tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/rtems.h rtems.h"
60 +        tmake_file=bfin/t-bfin-elf
61 +        use_collect2=no
62 +        ;;
63  bfin*-*)
64         tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h"
65          tmake_file=bfin/t-bfin
66 @@ -1560,7 +1565,7 @@
67         tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
68         use_fixproto=yes
69         ;;
70 -mips*-*-rtems*)
71 +mips-*-rtems*)
72         tm_file="elfos.h ${tm_file} mips/elf.h mips/rtems.h rtems.h"
73         tmake_file="mips/t-elf t-rtems mips/t-rtems"
74         ;;
75 diff -uNr gcc-4.1.2.orig/gcc/crtstuff.c gcc-4.1.2/gcc/crtstuff.c
76 --- gcc-4.1.2.orig/gcc/crtstuff.c       2005-11-15 02:21:29.000000000 +0100
77 +++ gcc-4.1.2/gcc/crtstuff.c    2007-04-05 04:49:10.000000000 +0200
78 @@ -225,6 +225,9 @@
79     in one DSO or the main program is not used in another object.  The
80     dynamic linker takes care of this.  */
81  
82 +#ifdef TARGET_LIBGCC_SDATA_SECTION
83 +extern void *__dso_handle __attribute__ ((__section__ (TARGET_LIBGCC_SDATA_SECTION)));
84 +#endif
85  #ifdef HAVE_GAS_HIDDEN
86  extern void *__dso_handle __attribute__ ((__visibility__ ("hidden")));
87  #endif
88 diff -uNr gcc-4.1.2.orig/Makefile.in gcc-4.1.2/Makefile.in
89 --- gcc-4.1.2.orig/Makefile.in  2006-04-04 23:03:05.000000000 +0200
90 +++ gcc-4.1.2/Makefile.in       2007-04-05 04:50:03.000000000 +0200
91 @@ -329,9 +329,9 @@
92  # CFLAGS will be just -g.  We want to ensure that TARGET libraries
93  # (which we know are built with gcc) are built with optimizations so
94  # prepend -O2 when setting CFLAGS_FOR_TARGET.
95 -CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
96 +CFLAGS_FOR_TARGET = $(strip -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
97  SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
98 -CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
99 +CXXFLAGS_FOR_TARGET = $(strip $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
100  LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
101  LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
102  LDFLAGS_FOR_TARGET =