Improve support for arm-wince-pe target

Nick Clifton nickc@redhat.com
Tue Jun 10 14:57:00 GMT 2003


Hi Guys,

  I have applied the patch below to add a seperate arm-wince-pe target
  to config.gcc.  This allows us to have this target default to using
  the apcs-32 ABI, whilst the arm-pe target defaults to the apcs-26
  ABI.  For both targets I have also enabled a multilib of the
  opposite ABI.

Cheers
        Nick

2003-06-10  Nick Clifton  <nickc@redhat.com>

	* config.gcc: Add arm-wince-pe target.
	* config/arm/pe.h (MULTILIB_DEFAULTS): Define.
        Add comment about default apcs26 support.
	* config/arm/t-pe (MULTILIB_OPTIONS): Add an -mapcs-32
	multilib.
        (MULTILIB_DIRNAMES): Add 'apcs32'.
	* config/arm/t-wince-pe: New makefile fragment.
	* config/arm/wince-pe.h: New file.  Overrides a few definitions
	in arm/pe.h

Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.318
diff -c -3 -p -r1.318 config.gcc
*** config.gcc	10 Jun 2003 02:31:42 -0000	1.318
--- config.gcc	10 Jun 2003 14:08:36 -0000
*************** arm*-*-elf | ep9312-*-elf)
*** 695,700 ****
--- 695,705 ----
  	tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h"
  	tmake_file=arm/t-arm-elf
  	;;
+ arm*-wince-pe*)
+ 	tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h arm/pe.h arm/wince-pe.h"
+ 	tmake_file=arm/t-wince-pe
+ 	extra_objs="pe.o"
+ 	;;
  arm-*-pe*)
  	tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h arm/pe.h"
  	tmake_file=arm/t-pe

Index: config/arm/pe.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/pe.h,v
retrieving revision 1.20
diff -c -3 -p -r1.20 pe.h
*** config/arm/pe.h	4 Jun 2003 17:33:48 -0000	1.20
--- config/arm/pe.h	10 Jun 2003 14:09:01 -0000
***************
*** 65,73 ****
--- 65,82 ----
    N_("Ignore dllimport attribute for functions") },		\
  { "no-nop-fun-dllimport",	- TARGET_FLAG_NOP_FUN, "" },
  
+ /* Defaulting to APCS-26 support is a legacy issue.   It has been done
+    that way for a long time, so changing it will probably break some
+    people's worlds.  Support for APCS-32 is now enabled as a multilib,
+    and at some point in the future APCS-32 may become the default.
+    Possibly when chips that support APCS-26 are no longer made.  */
+ 
  #undef  TARGET_DEFAULT
  #define TARGET_DEFAULT	(ARM_FLAG_SOFT_FLOAT | TARGET_FLAG_NOP_FUN)
  
+ #undef  MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+   { "marm", "mlittle-endian", "msoft-float", "mapcs-26", "mno-thumb-interwork" }  
  
  #undef  WCHAR_TYPE
  #define WCHAR_TYPE 	"short unsigned int"
***************
*** 92,98 ****
  #define SUPPORTS_ONE_ONLY 1
  
  /* Switch into a generic section.  */
! #undef TARGET_ASM_NAMED_SECTION
  #define TARGET_ASM_NAMED_SECTION  default_pe_asm_named_section
  
  /* This outputs a lot of .req's to define alias for various registers.
--- 101,107 ----
  #define SUPPORTS_ONE_ONLY 1
  
  /* Switch into a generic section.  */
! #undef  TARGET_ASM_NAMED_SECTION
  #define TARGET_ASM_NAMED_SECTION  default_pe_asm_named_section
  
  /* This outputs a lot of .req's to define alias for various registers.

Index: config/arm/t-pe
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/t-pe,v
retrieving revision 1.7
diff -c -3 -p -r1.7 t-pe
*** config/arm/t-pe	16 Dec 2002 18:20:57 -0000	1.7
--- config/arm/t-pe	10 Jun 2003 14:09:01 -0000
*************** pe.o: $(srcdir)/config/arm/pe.c $(CONFIG
*** 24,31 ****
    $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H)
  	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c
  
! MULTILIB_OPTIONS = mhard-float mthumb
! MULTILIB_DIRNAMES = fpu thumb
  
  LIBGCC = stmp-multilib
  INSTALL_LIBGCC = install-multilib
--- 24,31 ----
    $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H)
  	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c
  
! MULTILIB_OPTIONS = mhard-float mthumb mapcs-32
! MULTILIB_DIRNAMES = fpu thumb apcs32
  
  LIBGCC = stmp-multilib
  INSTALL_LIBGCC = install-multilib

*** /dev/null	2003-01-30 10:24:37.000000000 +0000
--- config/arm/t-wince-pe	2003-06-10 15:03:11.000000000 +0100
***************
*** 0 ****
--- 1,37 ----
+ LIB1ASMSRC = arm/lib1funcs.asm
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX
+ 
+ # We want fine grained libraries, so use the new code to build the
+ # floating point emulation libraries.
+ FPBIT = fp-bit.c
+ DPBIT = dp-bit.c
+ 
+ fp-bit.c: $(srcdir)/config/fp-bit.c
+ 	echo '#define FLOAT' > fp-bit.c
+ 	echo '#ifndef __ARMEB__' >> fp-bit.c
+ 	echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c
+ 	echo '#endif' >> fp-bit.c
+ 	cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+ 
+ dp-bit.c: $(srcdir)/config/fp-bit.c
+ 	echo '#ifndef __ARMEB__' > dp-bit.c
+ 	echo '#define FLOAT_BIT_ORDER_MISMATCH' >> dp-bit.c
+ 	echo '#define FLOAT_WORD_ORDER_MISMATCH' >> dp-bit.c
+ 	echo '#endif' >> dp-bit.c
+ 	cat $(srcdir)/config/fp-bit.c >> dp-bit.c
+ 
+ pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+   $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H)
+ 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c
+ 
+ MULTILIB_OPTIONS = mhard-float mapcs-26
+ MULTILIB_DIRNAMES = fpu apcs26
+ # Note - Thumb multilib omitted because Thumb apcs32 support for
+ # arm-wince-pe target does not appear to be working in binutils
+ # yet... 
+ # MULTILIB_OPTIONS += thumb
+ # MULTILIB_DIRNAMES += thumb
+ 
+ LIBGCC = stmp-multilib
+ INSTALL_LIBGCC = install-multilib
+ TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc

*** /dev/null	2003-01-30 10:24:37.000000000 +0000
--- config/arm/wince-pe.h	2003-06-10 15:04:59.000000000 +0100
***************
*** 0 ****
--- 1,29 ----
+ /* Definitions of target machine for GNU compiler, for ARM with WINCE-PE obj format.
+    Copyright (C) 2003 Free Software Foundation, Inc.
+    Contributed by Nick Clifton <nickc@redhat.com>
+    
+    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, 59 Temple Place - Suite 330,
+    Boston, MA 02111-1307, USA.  */
+ 
+ /* Override arm/pe.h's default apcs26 support.  */
+ 
+ #undef  TARGET_DEFAULT
+ #define TARGET_DEFAULT	(ARM_FLAG_APCS_32 | ARM_FLAG_SOFT_FLOAT | TARGET_FLAG_NOP_FUN)
+ 
+ #undef  MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+   { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }  

        



More information about the Gcc-patches mailing list