Stg.h: Reintroduce removed EI_/II_ for bootstrapping
AbandonedPublic

Authored by jrtc27 on Jul 15 2017, 1:17 PM.

Details

Summary

b68697e579d38ca29c2b84377dc2affa04659a28 introduced a regression
stopping existing unregisteristed compilers from being used to compile a
newer version of GHC, as they emit the old EI_/II_. This reintroduces
them to Stg.h as a fix.

jrtc27 created this revision.Jul 15 2017, 1:17 PM
trofi accepted this revision.Jul 15 2017, 1:20 PM
trofi added a subscriber: trofi.

Nice and simple fix. Apologies for caused breakage. Didin't realize
we leak-in new Stg.h even when stage0 is invoked.

Thank you!

includes/Stg.h
228

Perhaps worth explicitly adding a nothe that it:

  • is used by host unregisterised compiler when we are building stage1
  • is needed only when booter ghc is 8.0.x or older
This revision is now accepted and ready to land.Jul 15 2017, 1:20 PM
jrtc27 added inline comments.Jul 15 2017, 1:24 PM
includes/Stg.h
228

Booting with GHC 8.2 will also run into this, as the 8.2 branch doesn't have the change.

simonmar added inline comments.Jul 17 2017, 3:13 AM
includes/Stg.h
228

Why is this header being used by the stage0 compiler, shouldn't it be using its own version of this header?

bgamari requested changes to this revision.Jul 19 2017, 2:02 PM

Yeah, I do think something is wrong here. The stage0 compiler should be using its own version of the header.

This revision now requires changes to proceed.Jul 19 2017, 2:02 PM

Yeah, I do think something is wrong here. The stage0 compiler should be using its own version of the header.

I would agree with that; this was just a local hack, but I was encouraged to send it, so I did. For whatever reason, -Iincludes is given to the stage0 compiler when building stage1. An example of the failure (re-running make after a failed run) can be seen at https://people.debian.org/~jrtc27/ghc-unregisterised-bootstrap-error.log.

The GHC_INCLUDE_DIRS to stage0 was added in ea310f9956179f91ca973bc747b0bc7b061bc174:

# We add these paths to the Haskell compiler's #include search path list since
# we must avoid #including files by paths relative to the source file as Hadrian
# moves the build artifacts out of the source tree. See #8040.
compiler_HC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
simonmar edited edge metadata.Jul 24 2017, 10:40 AM

We should probably revisit that...

Hmm, indeed this is problematic. I have reopened Trac #8040.

jrtc27 abandoned this revision.Oct 19 2017, 7:50 PM

Obsoleted by D4114.