Opened 7 years ago

Last modified 7 years ago

#55544 new defect

gcc compiles should only be two stage (not three)

Reported by: eiked Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port:

Description

Compiling a recent version of gcc on a slow machine is a real endeavour. (compiling gcc7 on tiger@400MHz takes about 5 days, oops)

As you know, compiling gcc goes in three stages:

  • stage 1: compile new gcc version with old compiler
  • stage 2: compile new gcc with gcc as produced in stage 1
  • stage 3: compile new gcc with gcc as produced in stage 2

and then:

  • compare results of stage 2 and stage 3 for match to assure correctness

I believe that the third stage is not needed in the context of macports. (But then, making sure that the compiler is really perfect also makes sense)

The first stage should be compiled with the system installed compiler or the macport equivalent (aka macports apple-gcc42 on Tiger) This should give reproducible results.

The second stage should be compiled with the compiler from stage 1 This should give reproducible results.

I believe that the third stage is not needed (given that stage one and stage two should already be fully reproducible in the context of macports)

I believe that the three stage compile is only needed in a gcc development context, but that the third stage (and compare) is not needed to install into a well known context.

--- Another Problem around that:

the compare sh script hangs forever (on Tiger) and needs to be kill -KILL for the make to proceed

Last output before hang was: (ut it might got hung somewhere later, unrelated)

Comparing stages 2 and 3
warning: gcc/cc1obj-checksum.o differs
warning: gcc/cc1objplus-checksum.o differs

sh and kernel ran 50%/50%, I waited like 24hours, I did a ktrace on the sh and there where zero system calls I needed to hard KILL the sh, obviously something was hung

I've had that very same hang from stage 1 to stage 2 and also when compiling libgcc

Suggestion:

Maybe the compare script needs a more recent bash? tiger: #!/bin/bash might be too old?

Maybe we should require a recent bash from macports? (and patch that script to #!/opt/local/bin/bash)

Change History (1)

comment:1 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

The fact that you get a comparison failure between stages 2 and 3 seems to prove that it's a good thing they're checking for that by running the 3rd stage, doesn't it?

Note: See TracTickets for help on using tickets.