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]

[Xtensa] Change to 16-bit wide characters for xtensa-elf target


The xtensa-elf target should use 16-bit wide characters but until now has been 
using 32 bits.  The xtensa-linux-gnu target still uses 32-bit wide characters 
and I patched xtensa/linux.h to set this explicitly.  This patch also removes 
several redundant macros and clarifies some comments.  Tested with the 
xtensa-elf target and committed on the mainline branch.

2003-04-29  Bob Wilson  <bob.wilson@acm.org>

        * config/xtensa/elf.h (SIZE_TYPE, PTRDIFF_TYPE, USER_LABEL_PREFIX): 
        Remove redundant macros.
        (WCHAR_TYPE, WCHAR_TYPE_SIZE): Change to "short unsigned int".
        (LOCAL_LABEL_PREFIX): Define unconditionally.
        (NO_DOT_IN_LABEL): Clarify comment.
        * config/xtensa/linux.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Add explicit 
        definition to "long int".

cvs server: Diffing .
Index: elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/elf.h,v
retrieving revision 1.7
diff -c -3 -r1.7 elf.h
*** elf.h	5 Nov 2002 21:36:49 -0000	1.7
--- elf.h	28 Apr 2003 22:28:15 -0000
***************
*** 1,6 ****
  /* Xtensa/Elf configuration.
     Derived from the configuration for GCC for Intel i386 running Linux.
!    Copyright (C) 2001 Free Software Foundation, Inc.
  
  This file is part of GCC.
  
--- 1,6 ----
  /* Xtensa/Elf configuration.
     Derived from the configuration for GCC for Intel i386 running Linux.
!    Copyright (C) 2001,2003 Free Software Foundation, Inc.
  
  This file is part of GCC.
  
***************
*** 41,57 ****
  #undef TARGET_VERSION
  #define TARGET_VERSION fputs (" (Xtensa/ELF)", stderr);
  
- #undef SIZE_TYPE
- #define SIZE_TYPE "unsigned int"
- 
- #undef PTRDIFF_TYPE
- #define PTRDIFF_TYPE "int"
- 
  #undef WCHAR_TYPE
! #define WCHAR_TYPE "int"
  
  #undef WCHAR_TYPE_SIZE
! #define WCHAR_TYPE_SIZE BITS_PER_WORD
  
  #undef ASM_SPEC
  #define ASM_SPEC "%{v} %{mno-density:--no-density} \
--- 41,51 ----
  #undef TARGET_VERSION
  #define TARGET_VERSION fputs (" (Xtensa/ELF)", stderr);
  
  #undef WCHAR_TYPE
! #define WCHAR_TYPE "short unsigned int"
  
  #undef WCHAR_TYPE_SIZE
! #define WCHAR_TYPE_SIZE 16
  
  #undef ASM_SPEC
  #define ASM_SPEC "%{v} %{mno-density:--no-density} \
***************
*** 81,109 ****
        %{rdynamic:-export-dynamic} \
      %{static:-static}}}"
  
! /* Local compiler-generated symbols must have a prefix that the assembler
!    understands.   By default, this is $, although some targets (e.g.,
!    NetBSD-ELF) need to override this. */
! 
! #ifndef LOCAL_LABEL_PREFIX
  #define LOCAL_LABEL_PREFIX	"."
- #endif
- 
- /* By default, external symbols do not have an underscore prepended. */
  
! #ifndef USER_LABEL_PREFIX
! #define USER_LABEL_PREFIX	""
! #endif
! 
! /* Define this macro if the assembler does not accept the character
!    "." in label names.  By default constructors and destructors in G++
!    have names that use ".".  If this macro is defined, these names
!    are rewritten to avoid ".". */
! #define NO_DOT_IN_LABEL
! 
! /* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler
!    doesn't allow $ in symbol names.  */
  #undef NO_DOLLAR_IN_LABEL
  
  /* Do not force "-fpic" for this target.  */
  #define XTENSA_ALWAYS_PIC 0
--- 75,86 ----
        %{rdynamic:-export-dynamic} \
      %{static:-static}}}"
  
! #undef LOCAL_LABEL_PREFIX
  #define LOCAL_LABEL_PREFIX	"."
  
! /* Avoid dots for compatibility with VxWorks.  */
  #undef NO_DOLLAR_IN_LABEL
+ #define NO_DOT_IN_LABEL
  
  /* Do not force "-fpic" for this target.  */
  #define XTENSA_ALWAYS_PIC 0
Index: linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/linux.h,v
retrieving revision 1.9
diff -c -3 -r1.9 linux.h
*** linux.h	26 Apr 2003 00:39:02 -0000	1.9
--- linux.h	28 Apr 2003 22:28:15 -0000
***************
*** 34,39 ****
--- 34,45 ----
  #undef TARGET_VERSION
  #define TARGET_VERSION fputs (" (Xtensa GNU/Linux with ELF)", stderr);
  
+ #undef WCHAR_TYPE
+ #define WCHAR_TYPE "long int"
+ 
+ #undef WCHAR_TYPE_SIZE
+ #define WCHAR_TYPE_SIZE 32
+ 
  #undef ASM_SPEC
  #define ASM_SPEC "%{v} %{mno-density:--no-density} \
                    %{mtext-section-literals:--text-section-literals} \

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