This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add new target: vxworks for xscale


kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:

> Thu Sep 26 12:01:02 2002  Olivier Hainque <hainque@act-europe.fr>
>
> 	* config/arm/vxxscale.h, config/arm/vxxscale-coff.h: New files.
> 	* config/arm/vxxscale-elf.h, config/arm/t-vxxscale-elf: Likewise.
> 	* config.gcc (xscale-coff-vxworks, xscale-wrs-vxworks): New new cases.
> 	* fixinc/fixinc.copy: New file.
> 	* fixinc/mkfixinc.sh (*-vxworks*): New case, using above.

This is entirely the wrong way to write a modern VxWorks
configuration.  In fact, it's entirely the wrong way to write a modern
target configuration, period.

Please back out this change and submit a revision based on the example
of the current PowerPC VxWorks configuration (which is not exactly
right either, but is miles ahead of this).

Specific issues:

> *** /dev/null	Mon May  5 19:12:57 2003
> --- gcc/config/arm/vxxscale.h	Fri May  9 14:25:41 2003

Call this file gcc/config/arm/vxworks.h. 

The target configuration should support multilibbing between generic
ARM and XScale, but it is okay if it just supports XScale in its
initial revision.  Note comments about multilibs below.

> + #undef  CPP_PREDEFINES
> + #define CPP_PREDEFINES "-DCPU=XSCALE -D__vxworks -Acpu=xscale -Amachine=xscale"

Use TARGET_CPP_OS_BUILTINS, not CPP_PREDEFINES, and do not define any
assertions.  The CPU define needs to be conditionalized on the actual
CPU setting.

> + #undef  ASM_FILE_START
> + #define ASM_FILE_START(STREAM) 						\
> +   do 									\
> +     {									\
> +       fprintf (STREAM, "%s Generated by gcc %s for Xscale/VxWorks\n",	\
> + 	       ASM_COMMENT_START, version_string);			\

This is totally unnecessary; remove it.

> + /* VxWorks does all the library stuff itself.  */
> + #undef  LIB_SPEC
> + #define LIB_SPEC 	""
> + 
> + /* VxWorks uses object files, not loadable images.  make linker just
> +    combine objects. */
> + #undef  LINK_SPEC
> + #define LINK_SPEC 	"-r"
> + 
> + /* VxWorks provides the functionality of crt0.o and friends itself.  */
> + #undef  STARTFILE_SPEC
> + #define STARTFILE_SPEC 	""
> + 
> + #undef  ENDFILE_SPEC
> + #define ENDFILE_SPEC 	""

Get these overrides from config/vxworks.h; don't duplicate them in the
target-specific file.

> + #define EH_FRAME_IN_DATA_SECTION
> + /* ??? To be investigated, in order to avoid link time errors against
> +    __EH_FRAME_BEGIN__, only defined through the use of crtstuff.  */

VxWorks supports only sjlj exceptions.

> *** /dev/null	Mon May  5 19:12:57 2003
> --- gcc/config/arm/vxxscale-coff.h	Fri May  9 14:25:32 2003

Do not put any support for COFF at all in the revised patch.  (That
means no support for VxWorks 5.4.)

> *** /dev/null	Mon May  5 19:12:57 2003
> --- gcc/config/arm/vxxscale-elf.h	Fri May  9 14:25:17 2003

Merge this file into config/arm/vxworks.h.

> + #ifndef MULTILIB_DEFAULTS
> + #define MULTILIB_DEFAULTS \
> +   { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" }
> + #endif

> + MULTILIB_OPTIONS     = mlittle-endian/mbig-endian
> + MULTILIB_DIRNAMES    = le be
> + MULTILIB_EXCEPTIONS  = 
> + MULTILIB_MATCHES     = mbig-endian=mbe mlittle-endian=mle
> + 
> + # Note XScale does not support 26 bit APCS.
> + # Note XScale does not support hard FP
> + 
> + MULTILIB_OPTIONS    += mno-thumb-interwork/mthumb-interwork
> + MULTILIB_DIRNAMES   += normal interwork
> + 
> + MULTILIB_OPTIONS    += marm/mthumb
> + MULTILIB_DIRNAMES   += arm thumb
> + MULTILIB_EXCEPTIONS += *mhard-float/*mthumb*
> + 
> + MULTILIB_REDUNDANT_DIRS = interwork/thumb=thumb
> + 

Multilib settings for VxWorks are highly idiosyncratic and look
nothing like this.  If you do not have access to an actual VxWorks 5.5
installation to see what the correct multilib definition is, leave it
out entirely.

> + xscale-coff-vxworks)
> + 	tm_file="arm/semi.h arm/aout.h arm/coff.h arm/arm.h"
> + 	tm_file="${tm_file} arm/vxxscale.h arm/vxxscale-coff.h"
> + 	tmake_file=arm/t-xscale-coff
> + 	thread_file='vxworks'
> + 	use_collect2=no
> + 	;;
> + xscale-wrs-vxworks)
> + 	tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h"
> + 	tm_file="${tm_file} arm/arm.h arm/vxxscale.h arm/vxxscale-elf.h"
> + 	tmake_file=arm/t-vxxscale-elf
> + 	thread_file='vxworks'	
> + 	;;

Do not reintroduce xscale-*-* as a target triple; it should be
arm-*-vxworks, and as I said above, it should be ELF only.  Also, it
should be DWARF2 only; no stabs.

You need to include config/t-vxworks in your tmake_file list.

> *** /dev/null	Mon May  5 19:12:57 2003
> --- gcc/fixinc/fixinc.copy	Tue May  6 08:22:33 2003
> ***************
> *** 0 ****
> --- 1,2 ----
> + #!/bin/sh
> + cp -R $2/* $1

The correct fixincludes setting for VxWorks is to not run it at all.
The correct way to do that is by setting STMP_FIXINC to nothing in
your t-fragment.  config/t-vxworks should do that for you, but it
doesn't at present; feel free to fix that.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]