PCH merge bootstrap failure on irix6.2 due to missing ftello/fseeko

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Mon Jan 13 05:17:00 GMT 2003


Bootstrapping on mips-sgi-irix6.2 after the recent merge yields an
error in stage1 linking cc1 because ftello and fseeko are missing on
that platform.

Irix6.2 does have regular ftell/fseek which we already use elsewhere
in GCC.

I can either apply something like the patch below, or do autoconf
magic to define e.g. fseeko-> fseek only when the o versions are
missing.

What is your preference?

		Thanks,
		--Kaveh


diff -rup orig/egcc-CVS20030109/gcc/c-pch.c egcc-CVS20030109/gcc/c-pch.c
--- orig/egcc-CVS20030109/gcc/c-pch.c	2003-01-09 21:21:58.000000000 -0500
+++ egcc-CVS20030109/gcc/c-pch.c	2003-01-10 09:45:28.975404000 -0500
@@ -67,7 +67,7 @@ pch_init ()
 	  || strcmp (asm_file_name, "-") == 0)
 	fatal_error ("`%s' is not a valid output file", asm_file_name);
 
-      asm_file_startpos = ftello (asm_out_file);
+      asm_file_startpos = ftell (asm_out_file);
       
       cpp_save_state (parse_in, f);
     }
@@ -83,7 +83,7 @@ c_common_write_pch ()
 
   cpp_write_pch_deps (parse_in, pch_outfile);
 
-  asm_file_end = ftello (asm_out_file);
+  asm_file_end = ftell (asm_out_file);
   h.asm_size = asm_file_end - asm_file_startpos;
   
   if (fwrite (&h, sizeof (h), 1, pch_outfile) != 1)
@@ -92,7 +92,7 @@ c_common_write_pch ()
   buf = xmalloc (16384);
   fflush (asm_out_file);
 
-  if (fseeko (asm_out_file, asm_file_startpos, SEEK_SET) != 0)
+  if (fseek (asm_out_file, asm_file_startpos, SEEK_SET) != 0)
     fatal_io_error ("can't seek in %s", asm_file_name);
 
   for (written = asm_file_startpos; written < asm_file_end; )
diff -rup orig/egcc-CVS20030109/gcc/ggc-common.c egcc-CVS20030109/gcc/ggc-common.c
--- orig/egcc-CVS20030109/gcc/ggc-common.c	2003-01-09 22:15:00.000000000 -0500
+++ egcc-CVS20030109/gcc/ggc-common.c	2003-01-10 09:45:44.370023000 -0500
@@ -496,7 +496,7 @@ gt_pch_save (f)
   /* Pad the PCH file so that the mmaped area starts on a page boundary.  */
   {
     off_t o;
-    o = ftello (state.f) + sizeof (mmi);
+    o = ftell (state.f) + sizeof (mmi);
     if (o == (off_t) -1)
       fatal_io_error ("can't get position in PCH file");
     mmi.offset = page_size - o % page_size;



More information about the Gcc-bugs mailing list