BIGNUM_BACKEND=native does not compile: libraries/ghc-bignum/src/GHC/Num/BigNat/Native.hs:668:34: error: Variable not in scope
Summary
GHC build fails on mips64-unknown-linux-gnu
(n32
ABI) target with BIGNUM_BACKEND=native
.
Steps to reproduce
$ ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=mips64-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=mips64-unknown-linux-gnu-ar CC=mips64-unknown-linux-gnu-gcc Windres=mips64-unknown-linux-gnu-windres DllWrap=mips64-unknown-linux-gnu-dllwrap --disable-ld-override LD=mips64-unknown-linux-gnu-ld --enable-bootstrap-with-devel-snapshot --disable-dwarf-unwind --disable-numa
$ cat mk/build.mk
# Gentoo changes
docdir = /usr/share/doc/mips64-unknown-linux-gnu-ghc-9999
htmldir = /usr/share/doc/mips64-unknown-linux-gnu-ghc-9999
SRC_HC_OPTS+=
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
BIGNUM_BACKEND = native
STRIP_CMD = :
$ make
...
"inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Wall -this-unit-id ghc-bignum-1.0 -hide-all-packages -i -ilibraries/ghc-bignum/src/ -ilibraries/ghc-bignum/dist-install/build -Ilibraries/ghc-bignum/dist-install/build -ilibraries/ghc-bignum/dist-install/build/./autogen -Ilibraries/ghc-bignum/dist-install/build/./autogen -Ilibraries/ghc-bignum/include/ -Ilibraries/ghc-bignum/include -Ilibraries/ghc-bignum/dist-install/build/include/ -Ilibraries/ghc-bignum/dist-install/build/include -optP-DBIGNUM_NATIVE -optP-include -optPlibraries/ghc-bignum/dist-install/build/./autogen/cabal_macros.h -package-id ghc-prim-0.7.0 -Wall -this-unit-id ghc-bignum -XHaskell2010 -no-user-package-db -rtsopts -Wno-deprecated-flags -Wnoncanonical-monad-instances -outputdir libraries/ghc-bignum/dist-install/build -split-sections -dynamic-too -c libraries/ghc-bignum/src//GHC/Num/BigNat/Native.hs -o libraries/ghc-bignum/dist-install/build/GHC/Num/BigNat/Native.o -dyno libraries/ghc-bignum/dist-install/build/GHC/Num/BigNat/Native.dyn_o
libraries/ghc-bignum/src/GHC/Num/BigNat/Native.hs:668:34: error:
* Variable not in scope:
naturalFromBigNat# :: WordArray# -> Natural
* Perhaps you meant one of these:
`naturalFromBigNat' (imported from GHC.Num.Natural),
`naturalToBigNat' (imported from GHC.Num.Natural)
|
668 | bignat_powmod_word b0 e0 m = go (naturalFromBigNat# b0) (naturalFromBigNat# e0) (naturalFromWord# 1##)
| ^^^^^^^^^^^^^^^^^^
I noticed that CI scripts don't set BIGNUM_BACKEND = native
and still refer now unused variable INTEGER_LIBRARY
:
$ git grep INTEGER_LIBRARY
.gitlab-ci.yml: INTEGER_LIBRARY: integer-simple
.gitlab-ci.yml: INTEGER_LIBRARY: integer-simple
.gitlab-ci.yml: INTEGER_LIBRARY: integer-simple
.gitlab/ci.sh: if [[ -z ${INTEGER_LIBRARY:-} ]]; then INTEGER_LIBRARY=integer-gmp; fi
.gitlab/ci.sh:INTEGER_LIBRARY=$INTEGER_LIBRARY
This probably means no CI coverage for non-gmp.