"ghc-toolchain" mismatch report on OpenBSD
When I run the ghc build the usual way I do on OpenBSD with the script at the end I recently started getting this report:
configure: WARNING:
There are some differences between the toolchain configured by "configure" (hadrian/cfg/default.target) and the toolchain configured by the "ghc-toolchain" program (hadrian/cfg/default.target.ghc-toolchain).
15,18c15,18
< , tgtCCompiler = Cc {ccProgram = Program { prgPath = "clang" , prgFlags = ["--target=x86_64-unknown-openbsd","-Wl,-z,nobtcfi","-Qunused-arguments"] }}
< , tgtCxxCompiler = Cxx {cxxProgram = Program { prgPath = "clang++" , prgFlags = ["--target=x86_64-unknown-openbsd"] }}
< , tgtCPreprocessor = Cpp {cppProgram = Program { prgPath = "clang" , prgFlags = ["-E"] }}
< , tgtHsCPreprocessor = HsCpp {hsCppProgram = Program { prgPath = "clang" , prgFlags = ["-E","-undef","-traditional","-Wno-invalid-pp-token","-Wno-unicode","-Wno-trigraphs"] }}
---
> , tgtCCompiler = Cc {ccProgram = Program { prgPath = "/usr/bin/clang" , prgFlags = ["--target=x86_64-unknown-openbsd","-Wl,-z,nobtcfi","-Qunused-arguments"] }}
> , tgtCxxCompiler = Cxx {cxxProgram = Program { prgPath = "/usr/bin/clang++" , prgFlags = ["--target=x86_64-unknown-openbsd"] }}
> , tgtCPreprocessor = Cpp {cppProgram = Program { prgPath = "/usr/bin/clang" , prgFlags = ["-E"] }}
> , tgtHsCPreprocessor = HsCpp {hsCppProgram = Program { prgPath = "/usr/bin/clang" , prgFlags = ["-E","-undef","-traditional","-Wno-invalid-pp-token","-Wno-unicode","-Wno-trigraphs"] }}
20c20
< { ccLinkProgram = Program { prgPath = "clang" , prgFlags = ["--target=x86_64-unknown-openbsd","-fuse-ld=lld"] }
---
> { ccLinkProgram = Program { prgPath = "/usr/bin/clang" , prgFlags = ["--target=x86_64-unknown-openbsd","-Wl,--no-as-needed"] }
Don't worry! This won't affect your ghc in any way.
However, in a near future, we will move to configuring toolchains with "ghc-toolchain" by default, so you might have discovered a future bug.
In light of it, if you've spotted this difference, please report a GHC bug at https://www.haskell.org/ghc/reportabug
The build then proceeds as expected and the majority of the tests pass.
#!/bin/ksh
set -eu
export MAKE=gmake
export AUTOCONF_VERSION=2.71 AUTOMAKE_VERSION=1.16
export GHC=/home/greg/ghc-9.6/bin/ghc
./boot
CONF_CC_OPTS_STAGE1='-Wl,-z,nobtcfi' \
CONF_CC_OPTS_STAGE2='-Wl,-z,nobtcfi' \
./configure --with-ffi-includes=/usr/local/include \
--with-ffi-libraries=/usr/local/lib \
--with-gmp-includes=/usr/local/include \
--with-gmp-libraries=/usr/local/lib \
--with-iconv-includes=/usr/local/include \
--with-iconv-libraries=/usr/local/lib \
--with-system-libffi \
--with-compiler=$GHC \
--disable-tables-next-to-code
ulimit -d $((10<<20))
# T4038 needs a bunch of stack
ulimit -s 8192
hadrian/build '*.*.ghc.link.opts+=-L/usr/local/lib' \
--docs=none \
--flavour=validate+no_profiled_libs \
-j test
@alt-romes FYI.