This is the mail archive of the 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]

[patch, bootstrap, hppa] Patch for bootstrap/40338

Since r148080, when we started comparing all staged objects instead of
just the ones under gcc (specifically we started comparing libgcc
objects), the 32 bit HPPA build has not bootstrapped.

There are two issues that cause the libgcc objects not to be identical
between stages.

The first is that we compile C objects with '-fPIC -O2 -g -fexceptions'
and on 32 bit PA SOM files that causes us to call get_file_function_name
with type == 'F' and first_global_object_name not set (because of
-fPIC).  This causes us to generate a random symbol name during
compilation and makes objects different on each compilation.  We could
workaround this by using -frandom-seed='some-string' on our compilations
but that still leaves a second problem.

The second problem is that lib2funcs.asm is compiled by GCC with the
-xassembler-with-cpp and -g flags.  -xassembler-with-cpp causes the file
to be preprocessed and written to a temporary file (with a  random name)
and then assembled.  Due to the way that SOM and STABS work we wind up
writing that random name out to the object file.  Even if the file had a
.file entry in it as the first line, the GNU assembler will write out
the real file name before changing it to the name given in the .file

This could be worked around by preprocessing the file by hand into a known
file name and then assembling it but we might have to do that for all
systems since the rule for building this file is part of the generic
Makefile and not in a t-* fragment specific to hppa.

So after looking at these issues my proposal is not try to make the
objects identical but to allow systems like hppa which know that some
files are not going to compare exactly to ignore those comparisions and
I implemented that by having configure set the string for comparision
differences to ignore and using that in Makefile.tpl instead of having
the list of files hardcoded into Makefile.tpl directly.

Does this approach seem reasonable?  Is it OK to checkin?  Tested on
HPPA to make sure it works and on IA64 HP-UX and IA64 Linux to verify
other platforms still do all the comparisions.  There were no regressions.

Steve Ellcey

2009-06-12  Steve Ellcey  <>

	PR bootstrap/40338
	* (comparestring): Create new variable.
	* Makefile.tpl (comparestring): Use to skip some comparisions.
	* configure: Regenerate.
	* Regenerate.

---	(revision 148407)
+++	(working copy)
@@ -3061,4 +3061,13 @@ AC_SUBST(docdir)
+# Specify the comparision to do during bootstrap.
+comparestring="gcc/cc*-checksum\$(objext) | ./libgcc/* | ./gcc/ada/*tools/*"
+case "$target" in
+  hppa*64*-*-hpux*) ;;
+  hppa*-*-hpux*) comparestring="gcc/cc*-checksum\$(objext) | */libgcc/* | ./gcc/ada/*tools/*" ;;
Index: Makefile.tpl
--- Makefile.tpl	(revision 148407)
+++ Makefile.tpl	(working copy)
@@ -1436,7 +1436,7 @@ do-clean: clean-stage[+id+]
 	  $(do-[+compare-target+]) > /dev/null 2>&1; \
 	  if test $$? -eq 1; then \
 	    case $$file in \
-	      gcc/cc*-checksum$(objext) | ./libgcc/* | ./gcc/ada/*tools/*) \
+	      @comparestring@) \
 	        echo warning: $$file differs ;; \
 	      *) \
 	        echo $$file differs >> .bad_compare ;; \

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