Skip to content

ghc-HEAD fails to build on powerpc64-unknown-linux-gnu: stg_ap_0_fast does not evaluate to a constant

Steps to reproduce

$ ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=powerpc64-unknown-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/ghc-9999 --htmldir=/usr/share/doc/ghc-9999/html --libdir=/usr/lib64 AR=powerpc64-unknown-linux-gnu-ar CC=powerpc64-unknown-linux-gnu-gcc Windres=powerpc64-unknown-linux-gnu-windres DllWrap=powerpc64-unknown-linux-gnu-dllwrap --disable-ld-override LD=powerpc64-unknown-linux-gnu-ld --enable-bootstrap-with-devel-snapshot --disable-dwarf-unwind --disable-numa

$ cat mk/build.mk
# Gentoo changes
docdir = /usr/share/doc/powerpc64-unknown-linux-gnu-ghc-9999
htmldir = /usr/share/doc/powerpc64-unknown-linux-gnu-ghc-9999
SRC_HC_OPTS+=-O1 -O1
SRC_CC_OPTS+=-O2 -pipe
SRC_LD_OPTS+=-Wl,-O1
utils/ghc-cabal_dist_EXTRA_HC_OPTS+=-j4 +RTS -A256M -qb0 -RTS
BUILD_SPHINX_PDF  = NO
BUILD_SPHINX_HTML = NO
BUILD_MAN = NO
HADDOCK_DOCS       = YES
BUILD_DPH = NO
HADDOCK_DOCS=NO
BUILD_SPHINX_HTML=NO
BUILD_SPHINX_PDF=NO
Stage1Only=YES
BUILD_PROF_LIBS = NO
INTEGER_LIBRARY = integer-gmp
STRIP_CMD = :

$ make
...
"inplace/bin/ghc-stage1" -static  -H32m -O -O1 -O1  -Wall  -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Iincludes/dist-install/build -Irts -Irts/dist/build -DCOMPILING_RTS -DFS_NAMESPACE=rts -this-unit-id rts -dcmm-lint      -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen            -O2 -Wcpp-undef   -Wnoncanonical-monad-instances  -c rts/Apply.cmm -o rts/dist/build/Apply.o -keep-tmp-files
/tmp/ghc613157_0/ghc_4.s: Assembler messages:
/tmp/ghc613157_0/ghc_4.s: Error: .size expression for stg_ap_0_fast does not evaluate to a constant
/tmp/ghc613157_0/ghc_4.s: Error: .size expression for stg_PAP_entry does not evaluate to a constant
/tmp/ghc613157_0/ghc_4.s: Error: .size expression for stg_PAP_apply does not evaluate to a constant
/tmp/ghc613157_0/ghc_4.s: Error: .size expression for stg_AP_entry does not evaluate to a constant
/tmp/ghc613157_0/ghc_4.s: Error: .size expression for stg_AP_NOUPD_entry does not evaluate to a constant
/tmp/ghc613157_0/ghc_4.s: Error: .size expression for stg_AP_STACK_entry does not evaluate to a constant
/tmp/ghc613157_0/ghc_4.s: Error: .size expression for stg_AP_STACK_NOUPD_entry does not evaluate to a constant

Environment

$ "inplace/bin/ghc-stage1" --info
 [("Project name","The Glorious Glasgow Haskell Compilation System")
 ,("GCC extra via C opts","")
 ,("C compiler command","powerpc64-unknown-linux-gnu-gcc")
 ,("C compiler flags","")
 ,("C++ compiler flags","")
 ,("C compiler link flags","")
 ,("C compiler supports -no-pie","YES")
 ,("Haskell CPP command","powerpc64-unknown-linux-gnu-gcc")
 ,("Haskell CPP flags","-E -undef -traditional")
 ,("ld command","powerpc64-unknown-linux-gnu-ld")
 ,("ld flags","")
 ,("ld supports compact unwind","YES")
 ,("ld supports build-id","YES")
 ,("ld supports filelist","NO")
 ,("ld is GNU ld","YES")
 ,("ar command","powerpc64-unknown-linux-gnu-ar")
 ,("ar flags","q")
 ,("ar supports at file","YES")
 ,("ranlib command","powerpc64-unknown-linux-gnu-ranlib")
 ,("touch command","touch")
 ,("dllwrap command","powerpc64-unknown-linux-gnu-dllwrap")
 ,("windres command","powerpc64-unknown-linux-gnu-windres")
 ,("libtool command","libtool")
 ,("unlit command","/tmp/portage/cross-powerpc64-unknown-linux-gnu/ghc-9999/work/ghc-9999/inplace/lib/bin/unlit")
 ,("cross compiling","YES")
 ,("target platform string","powerpc64-unknown-linux")
 ,("target os","OSLinux")
 ,("target arch","ArchPPC_64 {ppc_64ABI = ELF_V1}")
 ,("target word size","8")
 ,("target word big endian","YES")
 ,("target has GNU nonexec stack","YES")
 ,("target has .ident directive","YES")
 ,("target has subsections via symbols","NO")
 ,("target has RTS linker","NO")
 ,("Unregisterised","NO")
 ,("LLVM target","powerpc64-unknown-linux")
 ,("LLVM llc command","llc")
 ,("LLVM opt command","opt")
 ,("LLVM clang command","clang")
 ,("integer library","integer-gmp")
 ,("Use interpreter","YES")
 ,("Use native code generator","YES")
 ,("Support SMP","YES")
 ,("RTS ways","l debug thr thr_debug thr_l  dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn ")
 ,("Tables next to code","NO")
 ,("Leading underscore","NO")
 ,("Use LibFFI","YES")
 ,("Use Threads","YES")
 ,("Use Debugging","NO")
 ,("RTS expects libdw","NO")
 ,("Project version","8.11.0.20200526")
 ,("Project Git commit id","5683acf50a01c3e71c7f150aea7062342ec21e42")
 ,("Booter version","8.10.1")
 ,("Stage","1")
 ,("Build platform","x86_64-unknown-linux")
 ,("Host platform","x86_64-unknown-linux")
 ,("Target platform","powerpc64-unknown-linux")
 ,("Have interpreter","YES")
 ,("Object splitting supported","NO")
 ,("Have native code generator","YES")
 ,("Support dynamic-too","YES")
 ,("Support parallel --make","YES")
 ,("Support reexported-modules","YES")
 ,("Support thinning and renaming package flags","YES")
 ,("Support Backpack","YES")
 ,("Requires unified installed package IDs","YES")
 ,("Uses package keys","YES")
 ,("Uses unit IDs","YES")
 ,("Dynamic by default","NO")
 ,("GHC Dynamic","NO")
 ,("GHC Profiled","NO")
 ,("Debug on","NO")
 ,("LibDir","/tmp/portage/cross-powerpc64-unknown-linux-gnu/ghc-9999/work/ghc-9999/inplace/lib")
 ,("Global Package DB","/tmp/portage/cross-powerpc64-unknown-linux-gnu/ghc-9999/work/ghc-9999/inplace/lib/package.conf.d")
 ]

Optional:

  • Operating System: Gentoo Linux
  • System Architecture: x86_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information