egcs-CVS19980627, mips-sgi-irix6.2 bootstrap problem ...

Jim Wilson wilson@cygnus.com
Mon Jun 29 17:00:00 GMT 1998


Apparently, the new SGI assembler requires that assembler files end with a .s.
If there is no .s extension, then the assembler does the same thing the
compiler would, it treats it as an object file that should be passed to the
linker.  The linker then gives an error because an assembler file is not
a valid object file.

This is a result of the recent mkstemp change, which dropped the extensions
from the intermediate files used during compilation.  If I use --save-temps,
then the compile succeeds, because we still have the .s extension in this case.

This appears to be a bug in the mkstemp changes.  It is incrementing p for
no apparent reason, and it is this change to p which causes the suffix to be
lost.

If it is necessary to drop the extension for security reasons, then we have
a problem.  It looks very hard to fix this in the irix6 port.  Easiest solution
would be a way to disable this gcc.c feature for targets that have
inconvenient assemblers, if GNU as if not being used.

This patch gets my irix6 build going again.  Reversing the uses of suffix
and p would probably be more elegant.

Mon Jun 29 16:55:05 1998  Jim Wilson  <wilson@cygnus.com>

	* gcc.c (do_spec_1, case 'g'): Delete redundant setting of
	delete_this_arg.  Restore p at end of MKTEMP_EACH_FILE code.

Index: gcc.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/gcc.c,v
retrieving revision 1.42
diff -p -r1.42 gcc.c
*** gcc.c	1998/06/28 20:07:32	1.42
--- gcc.c	1998/06/29 23:54:37
*************** do_spec_1 (spec, inswitch, soft_matched_
*** 3524,3530 ****
  		  }
  
  		obstack_grow (&obstack, t->filename, t->filename_length);
! 		delete_this_arg = 1;
  #else
  		obstack_grow (&obstack, temp_filename, temp_filename_length);
  		if (c == 'u' || c == 'U')
--- 3524,3532 ----
  		  }
  
  		obstack_grow (&obstack, t->filename, t->filename_length);
! 		/* Restore the original pointer into the specs, so that the
! 		   suffix will be added to the filename.  */
! 		p = suffix;
  #else
  		obstack_grow (&obstack, temp_filename, temp_filename_length);
  		if (c == 'u' || c == 'U')





More information about the Gcc-bugs mailing list