patches/gcc/3.4.6/260-arm-softfloat.patch
changeset 747 d3e603e7c17c
parent 402 197e1b49586e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/gcc/3.4.6/260-arm-softfloat.patch	Mon Jul 28 21:32:33 2008 +0000
     1.3 @@ -0,0 +1,161 @@
     1.4 +diff -durN gcc-3.4.6.orig/gcc/config/arm/coff.h gcc-3.4.6/gcc/config/arm/coff.h
     1.5 +--- gcc-3.4.6.orig/gcc/config/arm/coff.h	2004-02-24 15:25:22.000000000 +0100
     1.6 ++++ gcc-3.4.6/gcc/config/arm/coff.h	2007-08-15 23:10:54.000000000 +0200
     1.7 +@@ -31,11 +31,16 @@
     1.8 + #define TARGET_VERSION fputs (" (ARM/coff)", stderr)
     1.9 + 
    1.10 + #undef  TARGET_DEFAULT
    1.11 +-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
    1.12 ++#define TARGET_DEFAULT		\
    1.13 ++	( ARM_FLAG_SOFT_FLOAT	\
    1.14 ++	| ARM_FLAG_VFP		\
    1.15 ++	| ARM_FLAG_APCS_32	\
    1.16 ++	| ARM_FLAG_APCS_FRAME	\
    1.17 ++	| ARM_FLAG_MMU_TRAPS )
    1.18 + 
    1.19 + #ifndef MULTILIB_DEFAULTS
    1.20 + #define MULTILIB_DEFAULTS \
    1.21 +-  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
    1.22 ++  { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" }
    1.23 + #endif
    1.24 + 
    1.25 + /* This is COFF, but prefer stabs.  */
    1.26 +diff -durN gcc-3.4.6.orig/gcc/config/arm/elf.h gcc-3.4.6/gcc/config/arm/elf.h
    1.27 +--- gcc-3.4.6.orig/gcc/config/arm/elf.h	2004-02-24 15:25:22.000000000 +0100
    1.28 ++++ gcc-3.4.6/gcc/config/arm/elf.h	2007-08-15 23:10:54.000000000 +0200
    1.29 +@@ -46,7 +46,9 @@
    1.30 + 
    1.31 + #ifndef SUBTARGET_ASM_FLOAT_SPEC
    1.32 + #define SUBTARGET_ASM_FLOAT_SPEC "\
    1.33 +-%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
    1.34 ++%{mapcs-float:-mfloat} \
    1.35 ++%{mhard-float:-mfpu=fpa} \
    1.36 ++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
    1.37 + #endif
    1.38 + 
    1.39 + #ifndef ASM_SPEC
    1.40 +@@ -106,12 +108,17 @@
    1.41 + #endif
    1.42 + 
    1.43 + #ifndef TARGET_DEFAULT
    1.44 +-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
    1.45 ++#define TARGET_DEFAULT		\
    1.46 ++	( ARM_FLAG_SOFT_FLOAT	\
    1.47 ++	| ARM_FLAG_VFP		\
    1.48 ++	| ARM_FLAG_APCS_32	\
    1.49 ++	| ARM_FLAG_APCS_FRAME	\
    1.50 ++	| ARM_FLAG_MMU_TRAPS )
    1.51 + #endif
    1.52 + 
    1.53 + #ifndef MULTILIB_DEFAULTS
    1.54 + #define MULTILIB_DEFAULTS \
    1.55 +-  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
    1.56 ++  { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
    1.57 + #endif
    1.58 + 
    1.59 + #define TARGET_ASM_FILE_START_APP_OFF true
    1.60 +diff -durN gcc-3.4.6.orig/gcc/config/arm/linux-elf.h gcc-3.4.6/gcc/config/arm/linux-elf.h
    1.61 +--- gcc-3.4.6.orig/gcc/config/arm/linux-elf.h	2007-08-15 23:07:00.000000000 +0200
    1.62 ++++ gcc-3.4.6/gcc/config/arm/linux-elf.h	2007-08-15 23:10:54.000000000 +0200
    1.63 +@@ -44,12 +44,26 @@
    1.64 + #define TARGET_LINKER_EMULATION "armelf_linux"
    1.65 + #endif
    1.66 + 
    1.67 +-/* Default is to use APCS-32 mode.  */
    1.68 ++/*
    1.69 ++ * Default is to use APCS-32 mode with soft-vfp.
    1.70 ++ * The old Linux default for floats can be achieved with -mhard-float
    1.71 ++ * or with the configure --with-float=hard option.
    1.72 ++ * If -msoft-float or --with-float=soft is used then software float 
    1.73 ++ * support will be used just like the default but with the legacy
    1.74 ++ * big endian word ordering for double float representation instead.
    1.75 ++ */
    1.76 + #undef  TARGET_DEFAULT
    1.77 +-#define TARGET_DEFAULT \
    1.78 +-		( ARM_FLAG_APCS_32 | \
    1.79 +-		  ARM_FLAG_MMU_TRAPS | \
    1.80 +-		  TARGET_ENDIAN_DEFAULT )
    1.81 ++#define TARGET_DEFAULT		\
    1.82 ++	( ARM_FLAG_APCS_32	\
    1.83 ++	| ARM_FLAG_SOFT_FLOAT	\
    1.84 ++	| TARGET_ENDIAN_DEFAULT	\
    1.85 ++	| ARM_FLAG_VFP		\
    1.86 ++	| ARM_FLAG_MMU_TRAPS )
    1.87 ++
    1.88 ++#undef  SUBTARGET_EXTRA_ASM_SPEC
    1.89 ++#define SUBTARGET_EXTRA_ASM_SPEC "\
    1.90 ++%{mhard-float:-mfpu=fpa} \
    1.91 ++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
    1.92 + 
    1.93 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
    1.94 + 
    1.95 +@@ -57,7 +71,7 @@
    1.96 + 
    1.97 + #undef  MULTILIB_DEFAULTS
    1.98 + #define MULTILIB_DEFAULTS \
    1.99 +-	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
   1.100 ++	{ "marm", TARGET_ENDIAN_OPTION, "mapcs-32", "mno-thumb-interwork" }
   1.101 + 
   1.102 + #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
   1.103 + 
   1.104 +@@ -72,7 +86,7 @@
   1.105 +    %{shared:-lc} \
   1.106 +    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
   1.107 + 
   1.108 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc"
   1.109 ++#define LIBGCC_SPEC "-lgcc"
   1.110 + 
   1.111 + /* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
   1.112 +    the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
   1.113 +diff -durN gcc-3.4.6.orig/gcc/config/arm/t-linux gcc-3.4.6/gcc/config/arm/t-linux
   1.114 +--- gcc-3.4.6.orig/gcc/config/arm/t-linux	2003-09-20 23:09:07.000000000 +0200
   1.115 ++++ gcc-3.4.6/gcc/config/arm/t-linux	2007-08-15 23:10:54.000000000 +0200
   1.116 +@@ -4,7 +4,10 @@
   1.117 + LIBGCC2_DEBUG_CFLAGS = -g0
   1.118 + 
   1.119 + LIB1ASMSRC = arm/lib1funcs.asm
   1.120 +-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
   1.121 ++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
   1.122 ++	_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
   1.123 ++	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
   1.124 ++	_fixsfsi _fixunssfsi
   1.125 + 
   1.126 + # MULTILIB_OPTIONS = mhard-float/msoft-float
   1.127 + # MULTILIB_DIRNAMES = hard-float soft-float
   1.128 +diff -durN gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h gcc-3.4.6/gcc/config/arm/unknown-elf.h
   1.129 +--- gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h	2004-02-24 15:25:22.000000000 +0100
   1.130 ++++ gcc-3.4.6/gcc/config/arm/unknown-elf.h	2007-08-15 23:10:54.000000000 +0200
   1.131 +@@ -30,7 +30,12 @@
   1.132 + 
   1.133 + /* Default to using APCS-32 and software floating point.  */
   1.134 + #ifndef TARGET_DEFAULT
   1.135 +-#define TARGET_DEFAULT	(ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
   1.136 ++#define TARGET_DEFAULT		\
   1.137 ++	( ARM_FLAG_SOFT_FLOAT	\
   1.138 ++	| ARM_FLAG_VFP		\
   1.139 ++	| ARM_FLAG_APCS_32	\
   1.140 ++	| ARM_FLAG_APCS_FRAME	\
   1.141 ++	| ARM_FLAG_MMU_TRAPS )
   1.142 + #endif
   1.143 + 
   1.144 + /* Now we define the strings used to build the spec file.  */
   1.145 +diff -durN gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h gcc-3.4.6/gcc/config/arm/xscale-elf.h
   1.146 +--- gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h	2003-07-02 01:26:43.000000000 +0200
   1.147 ++++ gcc-3.4.6/gcc/config/arm/xscale-elf.h	2007-08-15 23:10:54.000000000 +0200
   1.148 +@@ -49,11 +49,12 @@
   1.149 + 		     endian, regardless of the endian-ness of the memory
   1.150 + 		     system.  */
   1.151 + 		     
   1.152 +-#define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
   1.153 +-  %{mhard-float:-mfpu=fpa} \
   1.154 +-  %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
   1.155 ++#define SUBTARGET_EXTRA_ASM_SPEC "\
   1.156 ++%{!mcpu=*:-mcpu=xscale} \
   1.157 ++%{mhard-float:-mfpu=fpa} \
   1.158 ++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
   1.159 + 
   1.160 + #ifndef MULTILIB_DEFAULTS
   1.161 + #define MULTILIB_DEFAULTS \
   1.162 +-  { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" }
   1.163 ++  { "mlittle-endian", "mno-thumb-interwork", "marm" }
   1.164 + #endif