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]

[JAVA] Fix bootstrap failure on Tru64


The following patch fixes the current bootstrap failure building
libjava on alphaev67-dec-osf5.1.  The problem is that the function
write_resource_constructor is directly calling the asm_out.constructor
target hook without checking have_ctors_dtors.  On Tru64 (which uses
collect2), this target method is a null pointer, and so jc1 gets a
segmentation fault.

The following fix restores bootstrap, using the same idiom as in the
almost identical code in emit_register_classes in class.c.  However,
the libjava testsuite looks much worse than the last time I bootstrapped
this platform in February.  I'm not sure if these regressions are related
to the fix below or unrelated changes [Many of failures seem to be caused
by the assembler warning "Length of .lcomm was less than 1: _MT_..."]?


The following patch has been tested on both i686-pc-linux-gnu and
alphaev67-dec-osf5.1 with full bootstraps including java.  On IA-32,
a top-level "make -k check" had no new failures.

Ok for mainline?


2004-04-12  Roger Sayle  <roger@eyesopen.com>

	* resource.c (write_resource_constructor): Guard call to possibly
	NULL targetm.asm_out.constructor with targetm.have_ctors_dtors.


Index: resource.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/resource.c,v
retrieving revision 1.9
diff -c -3 -p -r1.9 resource.c
*** resource.c	26 Nov 2003 01:34:32 -0000	1.9
--- resource.c	12 Apr 2004 13:28:30 -0000
*************** write_resource_constructor (void)
*** 156,163 ****
      flag_inline_functions = saved_flag;
    }
    current_function_decl = NULL_TREE;
!   (* targetm.asm_out.constructor) (XEXP (DECL_RTL (init_decl), 0),
! 				   DEFAULT_INIT_PRIORITY);
    input_location = saved_loc;
  }

--- 156,164 ----
      flag_inline_functions = saved_flag;
    }
    current_function_decl = NULL_TREE;
!   if (targetm.have_ctors_dtors)
!     targetm.asm_out.constructor (XEXP (DECL_RTL (init_decl), 0),
! 				 DEFAULT_INIT_PRIORITY);
    input_location = saved_loc;
  }


Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833



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