From 52f97a3b6c54bfb4e618b941293431d3de4d5b6d Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 10 Jun 2003 14:45:44 +0000 Subject: [PATCH] Improve support for arm-wince-pe target: * 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 From-SVN: r67705 --- gcc/ChangeLog | 12 ++++++++++++ gcc/config.gcc | 5 +++++ gcc/config/arm/pe.h | 11 ++++++++++- gcc/config/arm/t-pe | 4 ++-- gcc/config/arm/t-wince-pe | 37 +++++++++++++++++++++++++++++++++++++ gcc/config/arm/wince-pe.h | 29 +++++++++++++++++++++++++++++ 6 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 gcc/config/arm/t-wince-pe create mode 100644 gcc/config/arm/wince-pe.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1565c4871c2..971ca02a9e5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2003-06-10 Nick Clifton + + * 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 + 2003-06-10 Roger Sayle * builtins.c (fold_builtin): Optimize cos(-x) as cos(x). diff --git a/gcc/config.gcc b/gcc/config.gcc index 43e6f46f555..d2abc8b6bd4 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -695,6 +695,11 @@ arm*-*-elf | ep9312-*-elf) 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 diff --git a/gcc/config/arm/pe.h b/gcc/config/arm/pe.h index 471676ee035..a8ca0d47543 100644 --- a/gcc/config/arm/pe.h +++ b/gcc/config/arm/pe.h @@ -65,9 +65,18 @@ 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,7 +101,7 @@ #define SUPPORTS_ONE_ONLY 1 /* Switch into a generic section. */ -#undef TARGET_ASM_NAMED_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. diff --git a/gcc/config/arm/t-pe b/gcc/config/arm/t-pe index ba4ea10e402..4c20b317973 100644 --- a/gcc/config/arm/t-pe +++ b/gcc/config/arm/t-pe @@ -24,8 +24,8 @@ 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 mthumb -MULTILIB_DIRNAMES = fpu thumb +MULTILIB_OPTIONS = mhard-float mthumb mapcs-32 +MULTILIB_DIRNAMES = fpu thumb apcs32 LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib diff --git a/gcc/config/arm/t-wince-pe b/gcc/config/arm/t-wince-pe new file mode 100644 index 00000000000..9537a7f75ed --- /dev/null +++ b/gcc/config/arm/t-wince-pe @@ -0,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 diff --git a/gcc/config/arm/wince-pe.h b/gcc/config/arm/wince-pe.h new file mode 100644 index 00000000000..feed1337c90 --- /dev/null +++ b/gcc/config/arm/wince-pe.h @@ -0,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 + + 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" } -- 2.30.2