patches/gcc/3.4.6/260-arm-softfloat.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jul 28 21:32:33 2008 +0000 (2008-07-28)
changeset 747 d3e603e7c17c
parent 402 patches/gcc/3.4.6/910-arm-softfloat.patch@197e1b49586e
permissions -rw-r--r--
Fourth step at renaming patches: renumber all patches with a 10-step.
     1 diff -durN gcc-3.4.6.orig/gcc/config/arm/coff.h gcc-3.4.6/gcc/config/arm/coff.h
     2 --- gcc-3.4.6.orig/gcc/config/arm/coff.h	2004-02-24 15:25:22.000000000 +0100
     3 +++ gcc-3.4.6/gcc/config/arm/coff.h	2007-08-15 23:10:54.000000000 +0200
     4 @@ -31,11 +31,16 @@
     5  #define TARGET_VERSION fputs (" (ARM/coff)", stderr)
     6  
     7  #undef  TARGET_DEFAULT
     8 -#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
     9 +#define TARGET_DEFAULT		\
    10 +	( ARM_FLAG_SOFT_FLOAT	\
    11 +	| ARM_FLAG_VFP		\
    12 +	| ARM_FLAG_APCS_32	\
    13 +	| ARM_FLAG_APCS_FRAME	\
    14 +	| ARM_FLAG_MMU_TRAPS )
    15  
    16  #ifndef MULTILIB_DEFAULTS
    17  #define MULTILIB_DEFAULTS \
    18 -  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
    19 +  { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" }
    20  #endif
    21  
    22  /* This is COFF, but prefer stabs.  */
    23 diff -durN gcc-3.4.6.orig/gcc/config/arm/elf.h gcc-3.4.6/gcc/config/arm/elf.h
    24 --- gcc-3.4.6.orig/gcc/config/arm/elf.h	2004-02-24 15:25:22.000000000 +0100
    25 +++ gcc-3.4.6/gcc/config/arm/elf.h	2007-08-15 23:10:54.000000000 +0200
    26 @@ -46,7 +46,9 @@
    27  
    28  #ifndef SUBTARGET_ASM_FLOAT_SPEC
    29  #define SUBTARGET_ASM_FLOAT_SPEC "\
    30 -%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
    31 +%{mapcs-float:-mfloat} \
    32 +%{mhard-float:-mfpu=fpa} \
    33 +%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
    34  #endif
    35  
    36  #ifndef ASM_SPEC
    37 @@ -106,12 +108,17 @@
    38  #endif
    39  
    40  #ifndef TARGET_DEFAULT
    41 -#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
    42 +#define TARGET_DEFAULT		\
    43 +	( ARM_FLAG_SOFT_FLOAT	\
    44 +	| ARM_FLAG_VFP		\
    45 +	| ARM_FLAG_APCS_32	\
    46 +	| ARM_FLAG_APCS_FRAME	\
    47 +	| ARM_FLAG_MMU_TRAPS )
    48  #endif
    49  
    50  #ifndef MULTILIB_DEFAULTS
    51  #define MULTILIB_DEFAULTS \
    52 -  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
    53 +  { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
    54  #endif
    55  
    56  #define TARGET_ASM_FILE_START_APP_OFF true
    57 diff -durN gcc-3.4.6.orig/gcc/config/arm/linux-elf.h gcc-3.4.6/gcc/config/arm/linux-elf.h
    58 --- gcc-3.4.6.orig/gcc/config/arm/linux-elf.h	2007-08-15 23:07:00.000000000 +0200
    59 +++ gcc-3.4.6/gcc/config/arm/linux-elf.h	2007-08-15 23:10:54.000000000 +0200
    60 @@ -44,12 +44,26 @@
    61  #define TARGET_LINKER_EMULATION "armelf_linux"
    62  #endif
    63  
    64 -/* Default is to use APCS-32 mode.  */
    65 +/*
    66 + * Default is to use APCS-32 mode with soft-vfp.
    67 + * The old Linux default for floats can be achieved with -mhard-float
    68 + * or with the configure --with-float=hard option.
    69 + * If -msoft-float or --with-float=soft is used then software float 
    70 + * support will be used just like the default but with the legacy
    71 + * big endian word ordering for double float representation instead.
    72 + */
    73  #undef  TARGET_DEFAULT
    74 -#define TARGET_DEFAULT \
    75 -		( ARM_FLAG_APCS_32 | \
    76 -		  ARM_FLAG_MMU_TRAPS | \
    77 -		  TARGET_ENDIAN_DEFAULT )
    78 +#define TARGET_DEFAULT		\
    79 +	( ARM_FLAG_APCS_32	\
    80 +	| ARM_FLAG_SOFT_FLOAT	\
    81 +	| TARGET_ENDIAN_DEFAULT	\
    82 +	| ARM_FLAG_VFP		\
    83 +	| ARM_FLAG_MMU_TRAPS )
    84 +
    85 +#undef  SUBTARGET_EXTRA_ASM_SPEC
    86 +#define SUBTARGET_EXTRA_ASM_SPEC "\
    87 +%{mhard-float:-mfpu=fpa} \
    88 +%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
    89  
    90  #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
    91  
    92 @@ -57,7 +71,7 @@
    93  
    94  #undef  MULTILIB_DEFAULTS
    95  #define MULTILIB_DEFAULTS \
    96 -	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
    97 +	{ "marm", TARGET_ENDIAN_OPTION, "mapcs-32", "mno-thumb-interwork" }
    98  
    99  #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
   100  
   101 @@ -72,7 +86,7 @@
   102     %{shared:-lc} \
   103     %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
   104  
   105 -#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc"
   106 +#define LIBGCC_SPEC "-lgcc"
   107  
   108  /* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
   109     the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
   110 diff -durN gcc-3.4.6.orig/gcc/config/arm/t-linux gcc-3.4.6/gcc/config/arm/t-linux
   111 --- gcc-3.4.6.orig/gcc/config/arm/t-linux	2003-09-20 23:09:07.000000000 +0200
   112 +++ gcc-3.4.6/gcc/config/arm/t-linux	2007-08-15 23:10:54.000000000 +0200
   113 @@ -4,7 +4,10 @@
   114  LIBGCC2_DEBUG_CFLAGS = -g0
   115  
   116  LIB1ASMSRC = arm/lib1funcs.asm
   117 -LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
   118 +LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
   119 +	_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
   120 +	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
   121 +	_fixsfsi _fixunssfsi
   122  
   123  # MULTILIB_OPTIONS = mhard-float/msoft-float
   124  # MULTILIB_DIRNAMES = hard-float soft-float
   125 diff -durN gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h gcc-3.4.6/gcc/config/arm/unknown-elf.h
   126 --- gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h	2004-02-24 15:25:22.000000000 +0100
   127 +++ gcc-3.4.6/gcc/config/arm/unknown-elf.h	2007-08-15 23:10:54.000000000 +0200
   128 @@ -30,7 +30,12 @@
   129  
   130  /* Default to using APCS-32 and software floating point.  */
   131  #ifndef TARGET_DEFAULT
   132 -#define TARGET_DEFAULT	(ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
   133 +#define TARGET_DEFAULT		\
   134 +	( ARM_FLAG_SOFT_FLOAT	\
   135 +	| ARM_FLAG_VFP		\
   136 +	| ARM_FLAG_APCS_32	\
   137 +	| ARM_FLAG_APCS_FRAME	\
   138 +	| ARM_FLAG_MMU_TRAPS )
   139  #endif
   140  
   141  /* Now we define the strings used to build the spec file.  */
   142 diff -durN gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h gcc-3.4.6/gcc/config/arm/xscale-elf.h
   143 --- gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h	2003-07-02 01:26:43.000000000 +0200
   144 +++ gcc-3.4.6/gcc/config/arm/xscale-elf.h	2007-08-15 23:10:54.000000000 +0200
   145 @@ -49,11 +49,12 @@
   146  		     endian, regardless of the endian-ness of the memory
   147  		     system.  */
   148  		     
   149 -#define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
   150 -  %{mhard-float:-mfpu=fpa} \
   151 -  %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
   152 +#define SUBTARGET_EXTRA_ASM_SPEC "\
   153 +%{!mcpu=*:-mcpu=xscale} \
   154 +%{mhard-float:-mfpu=fpa} \
   155 +%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
   156  
   157  #ifndef MULTILIB_DEFAULTS
   158  #define MULTILIB_DEFAULTS \
   159 -  { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" }
   160 +  { "mlittle-endian", "mno-thumb-interwork", "marm" }
   161  #endif