Opened 6 years ago

Last modified 10 months ago

#8040 new bug

installed include/HsVersions.h wants to #include "../includes/ghcautoconf.h"

Reported by: hvr Owned by:
Priority: normal Milestone: 8.2.1
Component: Build System (make) Version: 7.6.3
Keywords: Cc: juhpetersen
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D2530
Wiki Page:


The header file ${PREFIX}/lib/ghc-7.6.3/ghc-7.6.3/include/HsVersions.h of a GHC installation, contains the following #include

/* Pull in the autoconf defines (HAVE_FOO), but don't include
 * ghcconfig.h, because that will include ghcplatform.h which has the
 * wrong platform settings for the compiler (it has the platform
 * settings for the target plat instead). */
#include "../includes/ghcautoconf.h"

however, there is no ../includes/ folder; the ghcautoconf.h does actually exist, but is located in the same folder as HsVersions.h.

This makes it impossible to use HsVersion.hs without patching the GHC installation.

Change History (10)

comment:1 Changed 4 years ago by thomie

Component: GHC APIBuild System

Theres' a TODO in includes/ about this:

# Header files built from the configure script's findings
# XXX: these should go in includes/dist/build?
includes_H_CONFIG   = includes/ghcautoconf.h
includes_H_PLATFORM = includes/ghcplatform.h
includes_H_VERSION  = includes/ghcversion.h

comment:2 Changed 4 years ago by angerman

This has also come up in the shaking-up-ghc[1] project, when trying to move the build products out of the source tree[2].



comment:3 Changed 3 years ago by bgamari

Differential Rev(s): Phab:D2530
Status: newpatch

See Phab:D2530 for a possible fix.

comment:4 Changed 3 years ago by bgamari

Milestone: 8.2.1

comment:5 Changed 3 years ago by Ben Gamari <ben@…>

In ea310f9/ghc:

Remove directories from include paths

Previously this was a relative path which worked in the GHC tree, but
failed elsewhere. This caused trouble for out-of-tree users as well as
Hadrian, which wants to move build artifacts out of the working
directory. Fixes #8040.

Test Plan: Validate

Reviewers: thomie, austin, snowleopard, hvr

Reviewed By: snowleopard, hvr

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #8040

comment:6 Changed 3 years ago by bgamari

Resolution: fixed
Status: patchclosed

comment:7 Changed 3 years ago by Ben Gamari <ben@…>

In e9104d46/ghc:

DynFlags: Fix absolute import path to generated header

Test Plan: Validate

Reviewers: austin, snowleopard

Reviewed By: snowleopard

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #8040.

comment:8 Changed 2 years ago by bgamari

Resolution: fixed
Status: closednew

As noted in Phab:D3741, we need to reconsider the fix in comment:5. is also relevant here.

comment:9 Changed 11 months ago by bgamari

Component: Build SystemBuild System (make)

The new Hadrian build system has been merged. Relabeling the tickets concerning the legacy make build system to prevent confusion.

comment:10 Changed 11 months ago by juhpetersen

Cc: juhpetersen added

Just noting that this issue is probably preventing me from building ghc-8.6 on (unregisterized) s390x Linux.

"/usr/bin/ghc" -hisuf hi -osuf  o -hcsuf hc -static  -H32m -O -Wall  -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -package-db libraries/bootstrapping.conf  -this-unit-id ghc-8.6.2 -hide-all-packages -i -icompiler/backpack -icompiler/basicTypes -icompiler/cmm -icompiler/codeGen -icompiler/coreSyn -icompiler/deSugar -icompiler/ghci -icompiler/hsSyn -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/stage1/build -Icompiler/stage1/build -icompiler/stage1/build/./autogen -Icompiler/stage1/build/./autogen -Icompiler/. -Icompiler/parser -Icompiler/utils -Icompiler/stage1 -Icompiler/stage1/build/. -Icompiler/stage1/build/parser -Icompiler/stage1/build/utils -Icompiler/stage1/build/stage1    -optP-include -optPcompiler/stage1/build/./autogen/cabal_macros.h -package-id array- -package-id base- -package-id binary- -package-id bytestring- -package-id containers- -package-id deepseq- -package-id directory- -package-id filepath- -package-id ghc-boot-8.6.2 -package-id ghc-boot-th-8.6.2 -package-id ghc-heap-8.6.2 -package-id ghci-8.6.2 -package-id hpc- -package-id process- -package-id template-haskell- -package-id terminfo- -package-id time- -package-id transformers- -package-id unix- -Wall -Wno-name-shadowing -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -Wnoncanonical-monoid-instances -this-unit-id ghc -XHaskell2010 -XNoImplicitPrelude -DNO_REGS -DNOSMP -optc-DNOSMP -DSTAGE=1 -Rghc-timing  -Wcpp-undef  -no-user-package-db -rtsopts        -odir compiler/stage1/build -hidir compiler/stage1/build -stubdir compiler/stage1/build    -c compiler/utils/Binary.hs -o compiler/stage1/build/Binary.o 
/tmp/ghc24ef_0/ghc_3.hc: In function ‘cNqW_entry’:
/tmp/ghc24ef_0/ghc_3.hc:50988:61: error:
     error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?
     ((struct {W_ x;} __attribute__((packed))*) _sHcZ)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;

This is both with stage0 8.2.2 and 8.4.

Last edited 10 months ago by juhpetersen (previous) (diff)
Note: See TracTickets for help on using tickets.