MIPS endianness patch

Gavin Romig-Koch gavin@cygnus.com
Tue Sep 7 05:44:00 GMT 1999


I've just commited the following.

                                       -gavin...

This adds a new macro to the MIPS targets that specifies the default
multilib option for endianness.  This patch then uses that macro to
fix a bug in the tx39el configuration where the driver believed the
default libraries were big endian.


	* config/mips/mips.h (MULTILIB_ENDIAN_DEFAULT) : New macro.
	(MULTILIB_ENDIAN_DEFAULT) : Use the new macro.
	* config/mips/elf64.h (MULTILIB_DEFAULTS) : Use the new macro.
	* config/mips/r3900.h (MULTILIB_DEFAULTS) : Use the new macro.

Index: gcc/config/mips/elf64.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/mips/elf64.h,v
retrieving revision 1.9
diff -c -r1.9 elf64.h
*** gcc/config/mips/elf64.h	1998/12/16 21:08:58	1.9
--- gcc/config/mips/elf64.h	1999/09/04 20:18:42
***************
*** 37,50 ****
  
  #include "mips/mips.h"
  
- /* This must be done after mips.h, because mips.h defines
-    TARGET_ENDIAN_DEFAULT.  */
  #undef MULTILIB_DEFAULTS
! #if TARGET_ENDIAN_DEFAULT == 0
! #define MULTILIB_DEFAULTS { "EL", "mips3" }
! #else
! #define MULTILIB_DEFAULTS { "EB", "mips3" }
! #endif
  
  #undef CPP_PREDEFINES
  #define CPP_PREDEFINES "-Dmips -DMIPSEB -DR4000 -D_mips -D_MIPSEB -D_R4000"
--- 37,44 ----
  
  #include "mips/mips.h"
  
  #undef MULTILIB_DEFAULTS
! #define MULTILIB_DEFAULTS { MULTILIB_ENDIAN_DEFAULT, "mips3" }
  
  #undef CPP_PREDEFINES
  #define CPP_PREDEFINES "-Dmips -DMIPSEB -DR4000 -D_mips -D_MIPSEB -D_R4000"
Index: gcc/config/mips/mips.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/mips/mips.h,v
retrieving revision 1.49
diff -c -r1.49 mips.h
*** gcc/config/mips/mips.h	1999/03/16 08:03:58	1.49
--- gcc/config/mips/mips.h	1999/09/04 20:18:57
***************
*** 534,545 ****
  #endif
  #endif
  
! #ifndef MULTILIB_DEFAULTS
  #if TARGET_ENDIAN_DEFAULT == 0
! #define MULTILIB_DEFAULTS { "EL", "mips1" }
  #else
! #define MULTILIB_DEFAULTS { "EB", "mips1" }
  #endif
  #endif
  
  /* We must pass -EL to the linker by default for little endian embedded
--- 534,549 ----
  #endif
  #endif
  
! #ifndef MULTILIB_ENDIAN_DEFAULT
  #if TARGET_ENDIAN_DEFAULT == 0
! #define MULTILIB_ENDIAN_DEFAULT "EL"
  #else
! #define MULTILIB_ENDIAN_DEFAULT "EB"
! #endif
  #endif
+ 
+ #ifndef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS { MULTILIB_ENDIAN_DEFAULT, "mips1" }
  #endif
  
  /* We must pass -EL to the linker by default for little endian embedded
Index: gcc/config/mips/r3900.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/mips/r3900.h,v
retrieving revision 1.6
diff -c -r1.6 r3900.h
*** gcc/config/mips/r3900.h	1998/12/16 21:09:24	1.6
--- gcc/config/mips/r3900.h	1999/09/04 20:18:58
***************
*** 46,52 ****
  #define MIPS_CPU_STRING_DEFAULT "R3900"
  #define MIPS_ISA_DEFAULT 1
  
! #define MULTILIB_DEFAULTS { "EB", "msoft-float" }
  
  /* We use the MIPS EABI by default.  */
  #define MIPS_ABI_DEFAULT ABI_EABI
--- 46,52 ----
  #define MIPS_CPU_STRING_DEFAULT "R3900"
  #define MIPS_ISA_DEFAULT 1
  
! #define MULTILIB_DEFAULTS { MULTILIB_ENDIAN_DEFAULT, "msoft-float" }
  
  /* We use the MIPS EABI by default.  */
  #define MIPS_ABI_DEFAULT ABI_EABI


More information about the Gcc-patches mailing list