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]

Patch to fix sparc-sun-solaris2.7 bootstrap


Attempting to bootstrap on Solaris SPARC fails with:

/usr/local/build/sparc-sun-solaris2.7/GNU/gcc-current/gcc/xgcc -B/usr/local/build/sparc-sun-solaris2.7/GNU/gcc-current/gcc/ -B/usr/local/sparc-sun-solaris2.7/bin/ -B/usr/local/sparc-sun-solaris2.7/lib/ -isystem /usr/local/sparc-sun-solaris2.7/include -fgnu-runtime -c -I. -I../../../../../../src/GNU/gcc-current/libobjc -g -O2 -DHAVE_GTHR_DEFAULT -DIN_GCC -DIN_TARGET_LIBS -I../../../../../../src/GNU/gcc-current/libobjc/objc -I../../../../../../src/GNU/gcc-current/libobjc/../gcc -I../../../../../../src/GNU/gcc-current/libobjc/../gcc/config -I../../gcc -I../../../../../../src/GNU/gcc-current/libobjc/../include ../../../../../../src/GNU/gcc-current/libobjc/linking.m -o linking.o
/usr/ccs/bin/as: "/var/tmp//ccwjdWLL.s", line 171: error: cannot use v9 instructions in a non-v9 target binary
make[2]: *** [linking.lo] Error 1

due to gcc outputing .uaxword which the Sun assembler dislikes when targeting
the 32 bit instruction set.

This patch allows Solaris 7 SPARC to bootstrap and passes
make bootstrap and make check on Solaris 7 x86.

ChangeLog:

Wed Sep 12 22:50:19 EDT 2001  John Wehle  (john@feith.com)

	* dwarf2asm.c (unaligned_integer_asm_op): Delete.
	(dw2_asm_output_data): Use assemble_integer in place
	of unaligned_integer_asm_op.
	(dw2_asm_output_delta): Likewise.
	(dw2_asm_output_offset): Likewise.
	(dw2_asm_output_pcrel): Likewise.
	(dw2_asm_output_addr): Likewise.
	(dw2_asm_output_addr_rtx): Likewise.
	(dw2_asm_output_encoded_addr_rtx): Likewise.
	* sparc/sysv4.h (UNALIGNED_DOUBLE_INT_ASM_OP): Use
	only if TARGET_ARCH64.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/dwarf2asm.c.ORIGINAL	Wed Aug 29 17:23:23 2001
--- gcc/dwarf2asm.c	Wed Sep 12 16:55:45 2001
*************** Software Foundation, 59 Temple Place - S
*** 44,83 ****
  #endif
  
  
- /* Despite the fact that assemble_integer handles unaligned data,
-    continue emitting things by hand when possible, since that makes
-    the assembler commentary come out prettier.  */
- #ifdef UNALIGNED_INT_ASM_OP
- static const char * unaligned_integer_asm_op  PARAMS ((int));
- 
- static inline const char *
- unaligned_integer_asm_op (size)
-      int size;
- {
-   const char *op;
-   switch (size)
-     {
-     case 1:
-       op = ASM_BYTE_OP;
-       break;
-     case 2:
-       op = UNALIGNED_SHORT_ASM_OP;
-       break;
-     case 4:
-       op = UNALIGNED_INT_ASM_OP;
-       break;
-     case 8:
- #ifdef UNALIGNED_DOUBLE_INT_ASM_OP
-       op = UNALIGNED_DOUBLE_INT_ASM_OP;
-       break;
- #endif
-     default:
-       abort ();
-     }
-   return op;
- }
- #endif /* UNALIGNED_INT_ASM_OP */
- 
  /* Output an immediate constant in a given size.  */
  
  void
--- 44,49 ----
*************** dw2_asm_output_data VPARAMS ((int size, 
*** 92,103 ****
    if (size * 8 < HOST_BITS_PER_WIDE_INT)
      value &= ~(~(unsigned HOST_WIDE_INT)0 << (size * 8));
  
- #ifdef UNALIGNED_INT_ASM_OP
-   fputs (unaligned_integer_asm_op (size), asm_out_file);
-   fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, value);
- #else
    assemble_integer (GEN_INT (value), size, BITS_PER_UNIT, 1);
- #endif
  
    if (flag_debug_asm && comment)
      {
--- 58,64 ----
*************** dw2_asm_output_delta VPARAMS ((int size,
*** 125,140 ****
    VA_FIXEDARG (ap, const char *, lab2);
    VA_FIXEDARG (ap, const char *, comment);
  
- #ifdef UNALIGNED_INT_ASM_OP
-   fputs (unaligned_integer_asm_op (size), asm_out_file);
-   assemble_name (asm_out_file, lab1);
-   fputc ('-', asm_out_file);
-   assemble_name (asm_out_file, lab2);
- #else
    assemble_integer (gen_rtx_MINUS (Pmode, gen_rtx_SYMBOL_REF (Pmode, lab1),
  				   gen_rtx_SYMBOL_REF (Pmode, lab2)),
  		    size, BITS_PER_UNIT, 1);
- #endif
  
    if (flag_debug_asm && comment)
      {
--- 86,94 ----
*************** dw2_asm_output_offset VPARAMS ((int size
*** 164,176 ****
  #ifdef ASM_OUTPUT_DWARF_OFFSET
    ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label);
  #else
- #ifdef UNALIGNED_INT_ASM_OP
-   fputs (unaligned_integer_asm_op (size), asm_out_file);
-   assemble_name (asm_out_file, label);
- #else
    assemble_integer (gen_rtx_SYMBOL_REF (Pmode, label), size, BITS_PER_UNIT, 1);
  #endif
- #endif
  
    if (flag_debug_asm && comment)
      {
--- 118,125 ----
*************** dw2_asm_output_pcrel VPARAMS ((int size,
*** 197,210 ****
  #ifdef ASM_OUTPUT_DWARF_PCREL
    ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, label);
  #else
! #ifdef UNALIGNED_INT_ASM_OP
!   fputs (unaligned_integer_asm_op (size), asm_out_file);
!   assemble_name (asm_out_file, label);
!   fputc ('-', asm_out_file);
!   fputc ('.', asm_out_file);
! #else
!   abort ();
! #endif
  #endif
  
    if (flag_debug_asm && comment)
--- 146,154 ----
  #ifdef ASM_OUTPUT_DWARF_PCREL
    ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, label);
  #else
!   assemble_integer (gen_rtx_MINUS (Pmode, gen_rtx_SYMBOL_REF (Pmode, label),
! 				   pc_rtx),
! 		    size, BITS_PER_UNIT, 1);
  #endif
  
    if (flag_debug_asm && comment)
*************** dw2_asm_output_addr VPARAMS ((int size, 
*** 228,239 ****
    VA_FIXEDARG (ap, const char *, label);
    VA_FIXEDARG (ap, const char *, comment);
  
- #ifdef UNALIGNED_INT_ASM_OP
-   fputs (unaligned_integer_asm_op (size), asm_out_file);
-   assemble_name (asm_out_file, label);
- #else
    assemble_integer (gen_rtx_SYMBOL_REF (Pmode, label), size, BITS_PER_UNIT, 1);
- #endif
  
    if (flag_debug_asm && comment)
      {
--- 172,178 ----
*************** dw2_asm_output_addr_rtx VPARAMS ((int si
*** 256,267 ****
    VA_FIXEDARG (ap, rtx, addr);
    VA_FIXEDARG (ap, const char *, comment);
  
- #ifdef UNALIGNED_INT_ASM_OP
-   fputs (unaligned_integer_asm_op (size), asm_out_file);
-   output_addr_const (asm_out_file, addr);
- #else
    assemble_integer (addr, size, BITS_PER_UNIT, 1);
- #endif
  
    if (flag_debug_asm && comment)
      {
--- 195,201 ----
*************** dw2_asm_output_encoded_addr_rtx VPARAMS 
*** 856,867 ****
        switch (encoding & 0xF0)
  	{
  	case DW_EH_PE_absptr:
- #ifdef UNALIGNED_INT_ASM_OP
- 	  fputs (unaligned_integer_asm_op (size), asm_out_file);
- 	  output_addr_const (asm_out_file, addr);
- #else
  	  assemble_integer (addr, size, BITS_PER_UNIT, 1);
- #endif
  	  break;
  
  	case DW_EH_PE_pcrel:
--- 790,796 ----
*************** dw2_asm_output_encoded_addr_rtx VPARAMS 
*** 870,883 ****
  #ifdef ASM_OUTPUT_DWARF_PCREL
  	  ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, XSTR (addr, 0));
  #else
! #ifdef UNALIGNED_INT_ASM_OP
! 	  fputs (unaligned_integer_asm_op (size), asm_out_file);
! 	  assemble_name (asm_out_file, XSTR (addr, 0));
! 	  fputc ('-', asm_out_file);
! 	  fputc ('.', asm_out_file);
! #else
! 	  abort ();
! #endif
  #endif
  	  break;
  
--- 799,809 ----
  #ifdef ASM_OUTPUT_DWARF_PCREL
  	  ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, XSTR (addr, 0));
  #else
! 	  assemble_integer (gen_rtx_MINUS (Pmode,
! 					   gen_rtx_SYMBOL_REF (Pmode,
! 							       XSTR (addr, 0)),
! 					   pc_rtx),
! 			    size, BITS_PER_UNIT, 1);
  #endif
  	  break;
  
*** gcc/config/sparc/sysv4.h.ORIGINAL	Tue Sep 11 15:05:01 2001
--- gcc/config/sparc/sysv4.h	Wed Sep 12 17:14:53 2001
*************** Boston, MA 02111-1307, USA.  */
*** 96,102 ****
  #define STRING_ASM_OP		"\t.asciz\t"
  #define COMMON_ASM_OP		"\t.common\t"
  #define SKIP_ASM_OP		"\t.skip\t"
! #define UNALIGNED_DOUBLE_INT_ASM_OP "\t.uaxword\t"
  #define UNALIGNED_INT_ASM_OP	"\t.uaword\t"
  #define UNALIGNED_SHORT_ASM_OP	"\t.uahalf\t"
  #define PUSHSECTION_ASM_OP	"\t.pushsection\t"
--- 96,102 ----
  #define STRING_ASM_OP		"\t.asciz\t"
  #define COMMON_ASM_OP		"\t.common\t"
  #define SKIP_ASM_OP		"\t.skip\t"
! #define UNALIGNED_DOUBLE_INT_ASM_OP (TARGET_ARCH64 ? "\t.uaxword\t" : NULL)
  #define UNALIGNED_INT_ASM_OP	"\t.uaword\t"
  #define UNALIGNED_SHORT_ASM_OP	"\t.uahalf\t"
  #define PUSHSECTION_ASM_OP	"\t.pushsection\t"
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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