Move ghc{autoconf,platform,version}.h to includes/dist; hide includes/ from stage0 compiler
Needs RevisionPublic

Authored by jrtc27 on Oct 19 2017, 7:36 PM.


Trac Issues

This obsoletes D3741. By moving the generated headers into a separate
directory and not adding includes/ to the include path when building the stage1
compiler, the generated headers can be made available without shadowing the
system Stg.h and others. Since the system generated headers are in the same
directory as the files including them, the system ones will still correctly be
used over the just-generated ones when included from other system headers like

jrtc27 created this revision.Oct 19 2017, 7:36 PM
trofi accepted this revision.Oct 20 2017, 1:58 AM
trofi added a subscriber: trofi.

Looks good! Thank you!

This revision is now accepted and ready to land.Oct 20 2017, 1:58 AM
jrtc27 updated this revision to Diff 14434.Oct 20 2017, 5:19 AM

Added includes/dist to rts/, hopefully fixing build errors.

Don't forget to do this in Hadrian, cc @snowleopard

Don't forget to do this in Hadrian, cc @snowleopard

Thanks! Note that Hadrian already tries to put all build artefacts into the _build directory, in particular, generated files go into _build/generated, so there is _build/generated/ghcautoconf.h as an example. I think the only in-tree build results are due various configure scripts that are typically run in place.

Migrating this patch to Hadrian may be either trivial (nothing needs to be done) or non-trivial (if we do want to follow the includes/dist convention). Happy to help.

I'm still struggling to find the cause of the segfaults locally; I can't seem to do anything to make the stage2 compiler *not* crash, even if I add -Iincludes to compiler_stage1_HC_OPTS. Hopefully I can get to the bottom of this soon, as it's rather tedious...

bgamari requested changes to this revision.Oct 30 2017, 4:28 PM

Bumping out of merge queue in light of issues. Perhaps I'll be able to have a look this week.

This revision now requires changes to proceed.Oct 30 2017, 4:28 PM
austin resigned from this revision.Nov 9 2017, 5:44 PM