dbxout.c (gstab.h): Use if CROSS_COMPILE.

Jim Wilson wilson@cygnus.com
Wed Feb 24 21:05:00 GMT 1999


I have installed this patch.

This fixes a cross-compiler build failure.  While building an alpha-x-m32r-elf
cross compiler, I get an error while compiling dbxout.c, because N_BINCL is
not defined.

The problem here is that dbxout.c is using the host's stab.h file, when
it should be using the target's stab.h file.  This was broken by a change
Kenner installed into gcc2 on Apr 19 1998.  This is when he added the
HAVE_STAB_H configure support.  Before that, there was a test for
CROSS_COMPILER to force use of gstab.h.  I put that test back, and added
a comment explaining why.

In the long term, we might just want to get rid of HAVE_STAB_H.

Wed Feb 24 19:49:46 1999  Jim Wilson  <wilson@cygnus.com>

	* dbxout.c (gstab.h): Use if CROSS_COMPILE.

Index: dbxout.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/dbxout.c,v
retrieving revision 1.32
diff -p -r1.32 dbxout.c
*** dbxout.c	1998/12/16 20:54:50	1.32
--- dbxout.c	1999/02/25 03:49:32
*************** static int source_label_number = 1;
*** 164,171 ****
  #endif
  
  /* If there is a system stab.h, use it.  Otherwise, use our own.  */
! 
! #if defined (USG) || !defined (HAVE_STAB_H)
  #include "gstab.h" /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>
--- 164,173 ----
  #endif
  
  /* If there is a system stab.h, use it.  Otherwise, use our own.  */
! /* ??? This is supposed to describe the target's stab format, so using
!    the host HAVE_STAB_H appears to be wrong.  For now, we use our own file
!    when cross compiling.  */
! #if defined (USG) || !defined (HAVE_STAB_H) || defined (CROSS_COMPILE)
  #include "gstab.h" /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>





More information about the Gcc-patches mailing list