[Git][ghc/ghc][wip/ghc-toolchain-fixes] 9 commits: EPA: Simplify GHC/Parser.y comb4/comb5
Matthew Pickering (@mpickering)
gitlab at gitlab.haskell.org
Wed Jul 26 14:37:40 UTC 2023
Matthew Pickering pushed to branch wip/ghc-toolchain-fixes at Glasgow Haskell Compiler / GHC
Commits:
355e1792 by Alan Zimmerman at 2023-07-26T10:17:32-04:00
EPA: Simplify GHC/Parser.y comb4/comb5
Use the HasLoc instance from Ast.hs to allow comb4/comb5 to work with
anything with a SrcSpan
Also get rid of some more now unnecessary reLoc calls.
- - - - -
9393df83 by Gavin Zhao at 2023-07-26T10:18:16-04:00
compiler: make -ddump-asm work with wasm backend NCG
Fixes #23503.
Now the `-ddump-asm` flag is respected in the wasm backend
NCG, so developers can directly view the generated ASM instead of
needing to pass `-S` or `-keep-tmp-files` and manually find & open
the assembly file.
Ideally, we should be able to output the assembly files in smaller
chunks like in other NCG backends. This would also make dumping assembly
stats easier. However, this would require a large refactoring, so for
short-term debugging purposes I think the current approach works fine.
Signed-off-by: Gavin Zhao <git at gzgz.dev>
- - - - -
79463036 by Krzysztof Gogolewski at 2023-07-26T10:18:54-04:00
llvm: Restore accidentally deleted code in 0fc5cb97
Fixes #23711
- - - - -
20db7e26 by Rodrigo Mesquita at 2023-07-26T10:19:33-04:00
configure: Default missing options to False when preparing ghc-toolchain Targets
This commit fixes building ghc with 9.2 as the boostrap compiler.
The ghc-toolchain patch assumed all _STAGE0 options were available, and
forgot to account for this missing information in 9.2.
Ghc 9.2 does not have in settings whether ar supports -l, hence can't
report it with --info (unliked 9.4 upwards).
The fix is to default the missing information (we default "ar supports
-l" and other missing options to False)
- - - - -
fac9e84e by Naïm Favier at 2023-07-26T10:20:16-04:00
docs: Fix typo
- - - - -
6abb12e2 by Matthew Pickering at 2023-07-26T14:37:26+00:00
ghc-toolchain: Match CPP args with configure script
At the moment we need ghc-toolchain to precisely match the output as
provided by the normal configure script. The normal configure script
(FP_HSCPP_CMD_WITH_ARGS) branches on whether we are using clang or gcc
so we match that logic exactly in ghc-toolchain.
The old implementation (which checks if certain flags are supported) is
better but for now we have to match to catch any potential errors in the
configuration.
Ticket: #23720
- - - - -
b4405aa6 by Matthew Pickering at 2023-07-26T14:37:26+00:00
configure: Fix `-Wl,--no-as-needed` check
The check was failing because the args supplied by $$1 were quoted which
failed because then the C compiler thought they were an input file.
Fixes #23720
- - - - -
b812748b by Matthew Pickering at 2023-07-26T14:37:26+00:00
configure: Add flag which turns ghc-toolchain check into error
We want to catch these errors in CI, but first we need to a flag which
turns this check into an error.
- - - - -
e485d938 by Matthew Pickering at 2023-07-26T14:37:26+00:00
ci: Enable --enable-strict-ghc-toolchain-check for all CI jobs
This will cause any CI job to fail if we have a mismatch between what
ghc-toolchain reports and what ./configure natively reports. Fixing
these kinds of issues is highest priority for 9.10 release.
- - - - -
12 changed files:
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/Wasm.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Parser.y
- configure.ac
- libraries/template-haskell/Language/Haskell/TH/Syntax.hs
- m4/fp_link_supports_no_as_needed.m4
- m4/ghc_toolchain.m4
- m4/prep_target_file.m4
- utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cpp.hs
Changes:
=====================================
.gitlab/generate-ci/gen_ci.hs
=====================================
@@ -157,6 +157,7 @@ configureArgsStr bc = unwords $
++ ["--with-intree-gmp" | Just _ <- pure (crossTarget bc) ]
++ ["--with-system-libffi" | crossTarget bc == Just "wasm32-wasi" ]
++ ["--enable-ipe-data-compression" | withZstd bc ]
+ ++ ["--enable-strict-ghc-toolchain-check"]
-- Compute the hadrian flavour from the BuildConfig
mkJobFlavour :: BuildConfig -> Flavour
=====================================
.gitlab/jobs.yaml
=====================================
@@ -56,7 +56,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-aarch64-darwin-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi ",
+ "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--docs=no-sphinx",
"LANG": "en_US.UTF-8",
"MACOSX_DEPLOYMENT_TARGET": "11.0",
@@ -121,7 +121,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "aarch64-linux-deb10-validate"
}
@@ -182,7 +182,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-i386-linux-deb10-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "i386-linux-deb10-validate"
}
@@ -243,7 +243,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-aarch64-darwin-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi ",
+ "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--docs=no-sphinx",
"LANG": "en_US.UTF-8",
"MACOSX_DEPLOYMENT_TARGET": "11.0",
@@ -309,7 +309,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "aarch64-linux-deb10-validate",
"XZ_OPT": "-9"
@@ -371,7 +371,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate+llvm",
"BUILD_FLAVOUR": "validate+llvm",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "aarch64-linux-deb10-validate+llvm",
"XZ_OPT": "-9"
@@ -433,7 +433,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-i386-linux-deb10-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "i386-linux-deb10-validate",
"XZ_OPT": "-9"
@@ -495,7 +495,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-darwin-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi ",
+ "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--docs=no-sphinx",
"LANG": "en_US.UTF-8",
"MACOSX_DEPLOYMENT_TARGET": "10.10",
@@ -564,7 +564,7 @@
"BIN_DIST_NAME": "ghc-x86_64-freebsd13-validate",
"BUILD_FLAVOUR": "validate",
"CABAL_INSTALL_VERSION": "3.8.1.0",
- "CONFIGURE_ARGS": "--with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib ",
+ "CONFIGURE_ARGS": "--with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check",
"GHC_VERSION": "9.4.3",
"HADRIAN_ARGS": "--docs=no-sphinx",
"RUNTEST_ARGS": "",
@@ -629,7 +629,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-int_native-validate+fully_static",
"BROKEN_TESTS": "ghcilink002 encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "validate+fully_static",
- "CONFIGURE_ARGS": "--disable-ld-override ",
+ "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--docs=no-sphinx",
"INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
"RUNTEST_ARGS": "",
@@ -694,7 +694,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-validate",
"BROKEN_TESTS": "encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--disable-ld-override ",
+ "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--docs=no-sphinx",
"INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
"RUNTEST_ARGS": "",
@@ -759,7 +759,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-validate+fully_static",
"BROKEN_TESTS": "ghcilink002 encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "validate+fully_static",
- "CONFIGURE_ARGS": "--disable-ld-override ",
+ "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--docs=no-sphinx",
"INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
"RUNTEST_ARGS": "",
@@ -823,7 +823,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_17-wasm-cross_wasm32-wasi-release+fully_static",
"BUILD_FLAVOUR": "release+fully_static",
- "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi",
+ "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"CROSS_TARGET": "wasm32-wasi",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
@@ -887,7 +887,7 @@
"BIGNUM_BACKEND": "native",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_17-wasm-int_native-cross_wasm32-wasi-release+fully_static",
"BUILD_FLAVOUR": "release+fully_static",
- "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi",
+ "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"CROSS_TARGET": "wasm32-wasi",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
@@ -951,7 +951,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_17-wasm-unreg-cross_wasm32-wasi-release+fully_static",
"BUILD_FLAVOUR": "release+fully_static",
- "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi",
+ "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"CROSS_TARGET": "wasm32-wasi",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
@@ -1015,7 +1015,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-centos7-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--docs=no-sphinx",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-centos7-validate",
@@ -1078,7 +1078,7 @@
"BIGNUM_BACKEND": "native",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-int_native-validate",
"XZ_OPT": "-9"
@@ -1140,7 +1140,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--disable-tables-next-to-code",
+ "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-no_tntc-validate",
"XZ_OPT": "-9"
@@ -1202,7 +1202,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate",
"BUILD_FLAVOUR": "slow-validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"ENABLE_NUMA": "1",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-numa-slow-validate",
@@ -1265,7 +1265,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--enable-unregisterised",
+ "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-unreg-validate",
"XZ_OPT": "-9"
@@ -1327,7 +1327,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-validate",
"XZ_OPT": "-9"
@@ -1389,7 +1389,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info",
"BUILD_FLAVOUR": "validate+debug_info",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-validate+debug_info",
"XZ_OPT": "-9"
@@ -1451,7 +1451,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+llvm",
"BUILD_FLAVOUR": "validate+llvm",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-validate+llvm",
"XZ_OPT": "-9"
@@ -1513,7 +1513,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+thread_sanitizer",
"BUILD_FLAVOUR": "validate+thread_sanitizer",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-validate+thread_sanitizer",
@@ -1577,7 +1577,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--with-intree-gmp",
+ "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu",
"CROSS_TARGET": "aarch64-linux-gnu",
"RUNTEST_ARGS": "",
@@ -1641,7 +1641,7 @@
"BIGNUM_BACKEND": "native",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--with-intree-gmp",
+ "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CONFIGURE_WRAPPER": "emconfigure",
"CROSS_EMULATOR": "js-emulator",
"CROSS_TARGET": "javascript-unknown-ghcjs",
@@ -1706,7 +1706,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb11-validate",
"XZ_OPT": "-9"
@@ -1768,7 +1768,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc",
"BUILD_FLAVOUR": "validate+boot_nonmoving_gc",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity",
"TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc",
"XZ_OPT": "-9"
@@ -1830,7 +1830,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb9-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb9-validate",
"XZ_OPT": "-9"
@@ -1892,7 +1892,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-fedora33-release",
"BUILD_FLAVOUR": "release",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"LLC": "/bin/false",
"OPT": "/bin/false",
"RUNTEST_ARGS": "",
@@ -1956,7 +1956,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-fedora33-release",
"BUILD_FLAVOUR": "release",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--haddock-base-url",
"LLC": "/bin/false",
"OPT": "/bin/false",
@@ -2021,7 +2021,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-fedora33-validate+debug_info",
"BUILD_FLAVOUR": "validate+debug_info",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"LLC": "/bin/false",
"OPT": "/bin/false",
"RUNTEST_ARGS": "",
@@ -2085,7 +2085,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-rocky8-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--docs=no-sphinx",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-rocky8-validate",
@@ -2148,7 +2148,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-ubuntu18_04-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-ubuntu18_04-validate",
"XZ_OPT": "-9"
@@ -2210,7 +2210,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-ubuntu20_04-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-ubuntu20_04-validate",
"XZ_OPT": "-9"
@@ -2268,7 +2268,7 @@
"BIN_DIST_NAME": "ghc-x86_64-windows-int_native-validate",
"BUILD_FLAVOUR": "validate",
"CABAL_INSTALL_VERSION": "3.8.1.0",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"GHC_VERSION": "9.4.3",
"HADRIAN_ARGS": "--docs=no-sphinx",
"LANG": "en_US.UTF-8",
@@ -2330,7 +2330,7 @@
"BIN_DIST_NAME": "ghc-x86_64-windows-validate",
"BUILD_FLAVOUR": "validate",
"CABAL_INSTALL_VERSION": "3.8.1.0",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"GHC_VERSION": "9.4.3",
"HADRIAN_ARGS": "--docs=no-sphinx",
"LANG": "en_US.UTF-8",
@@ -2396,7 +2396,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-aarch64-darwin-release",
"BUILD_FLAVOUR": "release",
- "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi ",
+ "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"LANG": "en_US.UTF-8",
@@ -2463,7 +2463,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-aarch64-linux-deb10-release+no_split_sections",
"BUILD_FLAVOUR": "release+no_split_sections",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"RUNTEST_ARGS": "",
@@ -2527,7 +2527,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-i386-linux-deb10-release+no_split_sections",
"BUILD_FLAVOUR": "release+no_split_sections",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"RUNTEST_ARGS": "",
@@ -2591,7 +2591,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-darwin-release",
"BUILD_FLAVOUR": "release",
- "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi ",
+ "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"LANG": "en_US.UTF-8",
@@ -2662,7 +2662,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-int_native-release+fully_static",
"BROKEN_TESTS": "ghcilink002 encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "release+fully_static",
- "CONFIGURE_ARGS": "--disable-ld-override ",
+ "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
@@ -2728,7 +2728,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-release+fully_static+no_split_sections",
"BROKEN_TESTS": "ghcilink002 encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "release+fully_static+no_split_sections",
- "CONFIGURE_ARGS": "--disable-ld-override ",
+ "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
@@ -2794,7 +2794,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-release+no_split_sections",
"BROKEN_TESTS": "encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "release+no_split_sections",
- "CONFIGURE_ARGS": "--disable-ld-override ",
+ "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
@@ -2859,7 +2859,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-centos7-release+no_split_sections",
"BUILD_FLAVOUR": "release+no_split_sections",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"RUNTEST_ARGS": "",
@@ -2923,7 +2923,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-release",
"BUILD_FLAVOUR": "release",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"RUNTEST_ARGS": "",
@@ -2987,7 +2987,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-release+debug_info",
"BUILD_FLAVOUR": "release+debug_info",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"RUNTEST_ARGS": "",
@@ -3051,7 +3051,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb11-release",
"BUILD_FLAVOUR": "release",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"RUNTEST_ARGS": "",
@@ -3115,7 +3115,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb11-release+boot_nonmoving_gc",
"BUILD_FLAVOUR": "release+boot_nonmoving_gc",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity",
@@ -3179,7 +3179,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb9-release+no_split_sections",
"BUILD_FLAVOUR": "release+no_split_sections",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"RUNTEST_ARGS": "",
@@ -3243,7 +3243,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-fedora33-release",
"BUILD_FLAVOUR": "release",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"LLC": "/bin/false",
@@ -3309,7 +3309,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-fedora33-release+debug_info",
"BUILD_FLAVOUR": "release+debug_info",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"LLC": "/bin/false",
@@ -3375,7 +3375,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-fedora33-release",
"BUILD_FLAVOUR": "release",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--haddock-base-url --hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"LLC": "/bin/false",
@@ -3441,7 +3441,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-rocky8-release",
"BUILD_FLAVOUR": "release",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"RUNTEST_ARGS": "",
@@ -3505,7 +3505,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-ubuntu18_04-release",
"BUILD_FLAVOUR": "release",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"RUNTEST_ARGS": "",
@@ -3569,7 +3569,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-ubuntu20_04-release",
"BUILD_FLAVOUR": "release",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"RUNTEST_ARGS": "",
@@ -3629,7 +3629,7 @@
"BIN_DIST_NAME": "ghc-x86_64-windows-int_native-release",
"BUILD_FLAVOUR": "release",
"CABAL_INSTALL_VERSION": "3.8.1.0",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"GHC_VERSION": "9.4.3",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
@@ -3692,7 +3692,7 @@
"BIN_DIST_NAME": "ghc-x86_64-windows-release",
"BUILD_FLAVOUR": "release",
"CABAL_INSTALL_VERSION": "3.8.1.0",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"GHC_VERSION": "9.4.3",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
@@ -3759,7 +3759,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-darwin-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi ",
+ "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--docs=no-sphinx",
"LANG": "en_US.UTF-8",
"MACOSX_DEPLOYMENT_TARGET": "10.10",
@@ -3827,7 +3827,7 @@
"BIN_DIST_NAME": "ghc-x86_64-freebsd13-validate",
"BUILD_FLAVOUR": "validate",
"CABAL_INSTALL_VERSION": "3.8.1.0",
- "CONFIGURE_ARGS": "--with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib ",
+ "CONFIGURE_ARGS": "--with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check",
"GHC_VERSION": "9.4.3",
"HADRIAN_ARGS": "--docs=no-sphinx",
"RUNTEST_ARGS": "",
@@ -3891,7 +3891,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-validate+fully_static",
"BROKEN_TESTS": "ghcilink002 encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "validate+fully_static",
- "CONFIGURE_ARGS": "--disable-ld-override ",
+ "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--docs=no-sphinx",
"INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
"RUNTEST_ARGS": "",
@@ -3954,7 +3954,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_17-wasm-cross_wasm32-wasi-release+fully_static",
"BUILD_FLAVOUR": "release+fully_static",
- "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi",
+ "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"CROSS_TARGET": "wasm32-wasi",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
@@ -4018,7 +4018,7 @@
"BIGNUM_BACKEND": "native",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_17-wasm-int_native-cross_wasm32-wasi-release+fully_static",
"BUILD_FLAVOUR": "release+fully_static",
- "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi",
+ "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"CROSS_TARGET": "wasm32-wasi",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
@@ -4082,7 +4082,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_17-wasm-unreg-cross_wasm32-wasi-release+fully_static",
"BUILD_FLAVOUR": "release+fully_static",
- "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi",
+ "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"CROSS_TARGET": "wasm32-wasi",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
@@ -4145,7 +4145,7 @@
"BIGNUM_BACKEND": "native",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-int_native-validate"
}
@@ -4207,7 +4207,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--disable-tables-next-to-code",
+ "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-no_tntc-validate"
}
@@ -4268,7 +4268,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate",
"BUILD_FLAVOUR": "slow-validate",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"ENABLE_NUMA": "1",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-numa-slow-validate"
@@ -4330,7 +4330,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--enable-unregisterised",
+ "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-unreg-validate"
}
@@ -4391,7 +4391,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--enable-ipe-data-compression",
+ "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-validate"
}
@@ -4452,7 +4452,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info",
"BUILD_FLAVOUR": "validate+debug_info",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-validate+debug_info"
}
@@ -4513,7 +4513,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+llvm",
"BUILD_FLAVOUR": "validate+llvm",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-validate+llvm"
}
@@ -4575,7 +4575,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+thread_sanitizer",
"BUILD_FLAVOUR": "validate+thread_sanitizer",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-deb10-validate+thread_sanitizer",
@@ -4638,7 +4638,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--with-intree-gmp",
+ "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu",
"CROSS_TARGET": "aarch64-linux-gnu",
"RUNTEST_ARGS": "",
@@ -4701,7 +4701,7 @@
"BIGNUM_BACKEND": "native",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-validate",
"BUILD_FLAVOUR": "validate",
- "CONFIGURE_ARGS": "--with-intree-gmp",
+ "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CONFIGURE_WRAPPER": "emconfigure",
"CROSS_EMULATOR": "js-emulator",
"CROSS_TARGET": "javascript-unknown-ghcjs",
@@ -4765,7 +4765,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc",
"BUILD_FLAVOUR": "validate+boot_nonmoving_gc",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity",
"TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc"
}
@@ -4826,7 +4826,7 @@
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-fedora33-release",
"BUILD_FLAVOUR": "release",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"LLC": "/bin/false",
"OPT": "/bin/false",
"RUNTEST_ARGS": "",
@@ -4885,7 +4885,7 @@
"BIN_DIST_NAME": "ghc-x86_64-windows-validate",
"BUILD_FLAVOUR": "validate",
"CABAL_INSTALL_VERSION": "3.8.1.0",
- "CONFIGURE_ARGS": "",
+ "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"GHC_VERSION": "9.4.3",
"HADRIAN_ARGS": "--docs=no-sphinx",
"LANG": "en_US.UTF-8",
=====================================
compiler/GHC/CmmToAsm.hs
=====================================
@@ -170,7 +170,7 @@ nativeCodeGen logger ts config modLoc h us cmms
ArchLoongArch64->panic "nativeCodeGen: No NCG for LoongArch64"
ArchUnknown -> panic "nativeCodeGen: No NCG for unknown arch"
ArchJavaScript-> panic "nativeCodeGen: No NCG for JavaScript"
- ArchWasm32 -> Wasm32.ncgWasm platform ts us modLoc h cmms
+ ArchWasm32 -> Wasm32.ncgWasm logger platform ts us modLoc h cmms
-- | Data accumulated during code generation. Mostly about statistics,
-- but also collects debug data for DWARF generation.
=====================================
compiler/GHC/CmmToAsm/Wasm.hs
=====================================
@@ -5,6 +5,7 @@
module GHC.CmmToAsm.Wasm (ncgWasm) where
import Data.ByteString.Builder
+import Data.ByteString.Lazy.Char8 (unpack)
import Data.Maybe
import Data.Semigroup
import GHC.Cmm
@@ -12,15 +13,18 @@ import GHC.CmmToAsm.Wasm.Asm
import GHC.CmmToAsm.Wasm.FromCmm
import GHC.CmmToAsm.Wasm.Types
import GHC.Data.Stream (Stream, StreamS (..), runStream)
+import GHC.Driver.DynFlags
import GHC.Platform
import GHC.Prelude
import GHC.Settings
import GHC.Types.Unique.Supply
import GHC.Unit
-import GHC.Utils.CliOption
+import GHC.Utils.Logger
+import GHC.Utils.Outputable (text)
import System.IO
ncgWasm ::
+ Logger ->
Platform ->
ToolSettings ->
UniqSupply ->
@@ -28,15 +32,24 @@ ncgWasm ::
Handle ->
Stream IO RawCmmGroup a ->
IO a
-ncgWasm platform ts us loc h cmms = do
+ncgWasm logger platform ts us loc h cmms = do
(r, s) <- streamCmmGroups platform us cmms
- hPutBuilder h $ "# " <> string7 (fromJust $ ml_hs_file loc) <> "\n\n"
- hPutBuilder h $ execWasmAsmM do_tail_call $ asmTellEverything TagI32 s
+ outputWasm $ "# " <> string7 (fromJust $ ml_hs_file loc) <> "\n\n"
+ outputWasm $ execWasmAsmM do_tail_call $ asmTellEverything TagI32 s
pure r
where
-- See Note [WasmTailCall]
do_tail_call = doTailCall ts
+ outputWasm builder = do
+ putDumpFileMaybe
+ logger
+ Opt_D_dump_asm
+ "Asm Code"
+ FormatASM
+ (text . unpack $ toLazyByteString builder)
+ hPutBuilder h builder
+
streamCmmGroups ::
Platform ->
UniqSupply ->
=====================================
compiler/GHC/CmmToLlvm/CodeGen.hs
=====================================
@@ -181,6 +181,9 @@ genCall (PrimTarget MO_AcquireFence) _ _ = runStmtsDecls $
genCall (PrimTarget MO_ReleaseFence) _ _ = runStmtsDecls $
statement $ Fence False SyncRelease
+genCall (PrimTarget MO_Touch) _ _ =
+ return (nilOL, [])
+
genCall (PrimTarget (MO_UF_Conv w)) [dst] [e] = runStmtsDecls $ do
dstV <- getCmmRegW (CmmLocal dst)
let ty = cmmToLlvmType $ localRegType dst
=====================================
compiler/GHC/Parser.y
=====================================
@@ -1026,7 +1026,7 @@ exportlist1 :: { OrdList (LIE GhcPs) }
-- No longer allow things like [] and (,,,) to be exported
-- They are built in syntax, always available
export :: { OrdList (LIE GhcPs) }
- : maybeexportwarning qcname_ext export_subspec {% do { let { span = (maybe comb2 comb3 $1) (reLoc $2) $> }
+ : maybeexportwarning qcname_ext export_subspec {% do { let { span = (maybe comb2 comb3 $1) $2 $> }
; impExp <- mkModuleImpExp $1 (fst $ unLoc $3) $2 (snd $ unLoc $3)
; return $ unitOL $ reLocA $ sL span $ impExp } }
| maybeexportwarning 'module' modid {% do { let { span = (maybe comb2 comb3 $1) $2 $>
@@ -1034,7 +1034,7 @@ export :: { OrdList (LIE GhcPs) }
; locImpExp <- acs (\cs -> sL span (IEModuleContents ($1, EpAnn anchor [mj AnnModule $2] cs) $3))
; return $ unitOL $ reLocA $ locImpExp } }
| maybeexportwarning 'pattern' qcon { let span = (maybe comb2 comb3 $1) $2 $>
- in unitOL $ reLocA $ sL span $ IEVar $1 (sLLa $2 (reLocN $>) (IEPattern (glAA $2) $3)) }
+ in unitOL $ reLocA $ sL span $ IEVar $1 (sLLa $2 $> (IEPattern (glAA $2) $3)) }
maybeexportwarning :: { Maybe (LocatedP (WarningTxt GhcPs)) }
: '{-# DEPRECATED' strings '#-}'
@@ -1079,7 +1079,7 @@ qcname_ext_w_wildcard :: { Located ([AddEpAnn], LocatedA ImpExpQcSpec) }
qcname_ext :: { LocatedA ImpExpQcSpec }
: qcname { sL1a $1 (ImpExpQcName $1) }
| 'type' oqtycon {% do { n <- mkTypeImpExp $2
- ; return $ sLLa $1 (reLocN $>) (ImpExpQcType (glAA $1) n) }}
+ ; return $ sLLa $1 $> (ImpExpQcType (glAA $1) n) }}
qcname :: { LocatedN RdrName } -- Variable or type constructor
: qvar { $1 } -- Things which look like functions
@@ -1134,7 +1134,7 @@ importdecl :: { LImportDecl GhcPs }
, importDeclAnnPackage = fst $5
, importDeclAnnAs = fst $8
}
- ; fmap reLocA $ acs (\cs -> L (comb5 $1 (reLoc $6) $7 (snd $8) $9) $
+ ; fmap reLocA $ acs (\cs -> L (comb5 $1 $6 $7 (snd $8) $9) $
ImportDecl { ideclExt = XImportDeclPass (EpAnn (glR $1) anns cs) (snd $ fst $2) False
, ideclName = $6, ideclPkgQual = snd $5
, ideclSource = snd $2, ideclSafe = snd $3
@@ -1211,7 +1211,7 @@ importlist1 :: { OrdList (LIE GhcPs) }
import :: { OrdList (LIE GhcPs) }
: qcname_ext export_subspec {% fmap (unitOL . reLocA . (sLL $1 $>)) $ mkModuleImpExp Nothing (fst $ unLoc $2) $1 (snd $ unLoc $2) }
| 'module' modid {% fmap (unitOL . reLocA) $ acs (\cs -> sLL $1 $> (IEModuleContents (Nothing, EpAnn (glR $1) [mj AnnModule $1] cs) $2)) }
- | 'pattern' qcon { unitOL $ reLocA $ sLL $1 $> $ IEVar Nothing (sLLa $1 (reLocN $>) (IEPattern (glAA $1) $2)) }
+ | 'pattern' qcon { unitOL $ reLocA $ sLL $1 $> $ IEVar Nothing (sLLa $1 $> (IEPattern (glAA $1) $2)) }
-----------------------------------------------------------------------------
-- Fixity Declarations
@@ -1314,7 +1314,7 @@ ty_decl :: { LTyClDecl GhcPs }
where_type_family
-- Note the use of type for the head; this allows
-- infix type constructors to be declared
- {% mkFamDecl (comb5 $1 (reLoc $3) $4 $5 $6) (snd $ unLoc $6) TopLevel $3
+ {% mkFamDecl (comb5 $1 $3 $4 $5 $6) (snd $ unLoc $6) TopLevel $3
(snd $ unLoc $4) (snd $ unLoc $5)
(mj AnnType $1:mj AnnFamily $2:(fst $ unLoc $4)
++ (fst $ unLoc $5) ++ (fst $ unLoc $6)) }
@@ -1576,13 +1576,13 @@ opt_kind_sig :: { Located ([AddEpAnn], Maybe (LHsKind GhcPs)) }
opt_datafam_kind_sig :: { Located ([AddEpAnn], LFamilyResultSig GhcPs) }
: { noLoc ([] , noLocA (NoSig noExtField) )}
- | '::' kind { sLL $1 $> ([mu AnnDcolon $1], sLLa $1 (reLoc $>) (KindSig noExtField $2))}
+ | '::' kind { sLL $1 $> ([mu AnnDcolon $1], sLLa $1 $> (KindSig noExtField $2))}
opt_tyfam_kind_sig :: { Located ([AddEpAnn], LFamilyResultSig GhcPs) }
: { noLoc ([] , noLocA (NoSig noExtField) )}
- | '::' kind { sLL $1 $> ([mu AnnDcolon $1], sLLa $1 (reLoc $>) (KindSig noExtField $2))}
+ | '::' kind { sLL $1 $> ([mu AnnDcolon $1], sLLa $1 $> (KindSig noExtField $2))}
| '=' tv_bndr {% do { tvb <- fromSpecTyVarBndr $2
- ; return $ sLL $1 $> ([mj AnnEqual $1], sLLa $1 (reLoc $>) (TyVarSig noExtField tvb))} }
+ ; return $ sLL $1 $> ([mj AnnEqual $1], sLLa $1 $> (TyVarSig noExtField tvb))} }
opt_at_kind_inj_sig :: { Located ([AddEpAnn], ( LFamilyResultSig GhcPs
, Maybe (LInjectivityAnn GhcPs)))}
@@ -1592,7 +1592,7 @@ opt_at_kind_inj_sig :: { Located ([AddEpAnn], ( LFamilyResultSig GhcPs
| '=' tv_bndr_no_braces '|' injectivity_cond
{% do { tvb <- fromSpecTyVarBndr $2
; return $ sLL $1 $> ([mj AnnEqual $1, mj AnnVbar $3]
- , (sLLa $1 (reLoc $2) (TyVarSig noExtField tvb), Just $4))} }
+ , (sLLa $1 $2 (TyVarSig noExtField tvb), Just $4))} }
-- tycl_hdr parses the header of a class or data type decl,
-- which takes the form
@@ -2128,7 +2128,7 @@ opt_tyconsig :: { ([AddEpAnn], Maybe (LocatedN RdrName)) }
sigktype :: { LHsSigType GhcPs }
: sigtype { $1 }
| ctype '::' kind {% acsA (\cs -> sLL $1 $> $ mkHsImplicitSigType $
- sLLa (reLoc $1) (reLoc $>) $ HsKindSig (EpAnn (glAR $1) [mu AnnDcolon $2] cs) $1 $3) }
+ sLLa $1 $> $ HsKindSig (EpAnn (glAR $1) [mu AnnDcolon $2] cs) $1 $3) }
-- Like ctype, but for types that obey the forall-or-nothing rule.
-- See Note [forall-or-nothing rule] in GHC.Hs.Type. To avoid duplicating the
@@ -2172,7 +2172,7 @@ ktype :: { LHsType GhcPs }
-- A ctype is a for-all type
ctype :: { LHsType GhcPs }
- : forall_telescope ctype { reLocA $ sLL $1 (reLoc $>) $
+ : forall_telescope ctype { sLLa $1 $> $
HsForAllTy { hst_tele = unLoc $1
, hst_xforall = noExtField
, hst_body = $2 } }
@@ -2305,13 +2305,13 @@ atype :: { LHsType GhcPs }
-- so you have to quote those.)
| '[' ktype ',' comma_types1 ']' {% do { h <- addTrailingCommaA $2 (gl $3)
; acsA (\cs -> sLL $1 $> $ HsExplicitListTy (EpAnn (glR $1) [mos $1,mcs $5] cs) NotPromoted (h:$4)) }}
- | INTEGER { reLocA $ sLL $1 $> $ HsTyLit noExtField $ HsNumTy (getINTEGERs $1)
+ | INTEGER { sLLa $1 $> $ HsTyLit noExtField $ HsNumTy (getINTEGERs $1)
(il_value (getINTEGER $1)) }
- | CHAR { reLocA $ sLL $1 $> $ HsTyLit noExtField $ HsCharTy (getCHARs $1)
+ | CHAR { sLLa $1 $> $ HsTyLit noExtField $ HsCharTy (getCHARs $1)
(getCHAR $1) }
- | STRING { reLocA $ sLL $1 $> $ HsTyLit noExtField $ HsStrTy (getSTRINGs $1)
+ | STRING { sLLa $1 $> $ HsTyLit noExtField $ HsStrTy (getSTRINGs $1)
(getSTRING $1) }
- | '_' { reLocA $ sL1 $1 $ mkAnonWildCardTy }
+ | '_' { sL1a $1 $ mkAnonWildCardTy }
-- Type variables are never exported, so `M.tyvar` will be rejected by the renamer.
-- We let it pass the parser because the renamer can generate a better error message.
| QVARID {% let qname = mkQual tvName (getQVARID $1)
@@ -2470,8 +2470,8 @@ constrs1 :: { Located [LConDecl GhcPs] }
constr :: { LConDecl GhcPs }
: forall context '=>' constr_stuff
{% acsA (\cs -> let (con,details) = unLoc $4 in
- (L (comb4 $1 (reLoc $2) $3 $4) (mkConDeclH98
- (EpAnn (spanAsAnchor (comb4 $1 (reLoc $2) $3 $4))
+ (L (comb4 $1 $2 $3 $4) (mkConDeclH98
+ (EpAnn (spanAsAnchor (comb4 $1 $2 $3 $4))
(mu AnnDarrow $3:(fst $ unLoc $1)) cs)
con
(snd $ unLoc $1)
@@ -2763,7 +2763,7 @@ exp_prag(e) :: { ECP }
: prag_e e -- See Note [Pragmas and operator fixity]
{% runPV (unECP $2) >>= \ $2 ->
fmap ecpFromExp $
- return $ (reLocA $ sLL $1 $> $ HsPragE noExtField (unLoc $1) $2) }
+ return $ (sLLa $1 $> $ HsPragE noExtField (unLoc $1) $2) }
exp10 :: { ECP }
-- See Note [%shift: exp10 -> '-' fexp]
@@ -2877,8 +2877,8 @@ aexp :: { ECP }
{ ECP $
unECP $4 >>= \ $4 ->
mkHsLamPV (comb2 $1 $>) (\cs -> mkMatchGroup FromSource
- (reLocA $ sLL $1 $>
- [reLocA $ sLL $1 $>
+ (sLLa $1 $>
+ [sLLa $1 $>
$ Match { m_ext = EpAnn (glR $1) [mj AnnLam $1] cs
, m_ctxt = LambdaExpr
, m_pats = $2
@@ -2934,7 +2934,7 @@ aexp :: { ECP }
{% (checkPattern <=< runPV) (unECP $2) >>= \ p ->
runPV (unECP $4) >>= \ $4 at cmd ->
fmap ecpFromExp $
- acsA (\cs -> sLL $1 $> $ HsProc (EpAnn (glR $1) [mj AnnProc $1,mu AnnRarrow $3] cs) p (sLLa $1 (reLoc $>) $ HsCmdTop noExtField cmd)) }
+ acsA (\cs -> sLL $1 $> $ HsProc (EpAnn (glR $1) [mj AnnProc $1,mu AnnRarrow $3] cs) p (sLLa $1 $> $ HsCmdTop noExtField cmd)) }
| aexp1 { $1 }
@@ -2951,7 +2951,7 @@ aexp1 :: { ECP }
| aexp1 TIGHT_INFIX_PROJ field
{% runPV (unECP $1) >>= \ $1 ->
fmap ecpFromExp $ acsa (\cs ->
- let fl = sLLa $2 (reLoc $>) (DotFieldOcc ((EpAnn (glR $2) (AnnFieldLabel (Just $ glAA $2)) emptyComments)) $3) in
+ let fl = sLLa $2 $> (DotFieldOcc ((EpAnn (glR $2) (AnnFieldLabel (Just $ glAA $2)) emptyComments)) $3) in
mkRdrGetField (noAnnSrcSpan $ comb2 $1 $>) $1 fl (EpAnn (glAR $1) NoEpAnns cs)) }
@@ -3037,8 +3037,8 @@ projection :: { Located (NonEmpty (LocatedAn NoEpAnns (DotFieldOcc GhcPs))) }
projection
-- See Note [Whitespace-sensitive operator parsing] in GHC.Parsing.Lexer
: projection TIGHT_INFIX_PROJ field
- {% acs (\cs -> sLL $1 $> ((sLLa $2 (reLoc $>) $ DotFieldOcc (EpAnn (glR $1) (AnnFieldLabel (Just $ glAA $2)) cs) $3) `NE.cons` unLoc $1)) }
- | PREFIX_PROJ field {% acs (\cs -> sLL $1 $> ((sLLa $1 (reLoc $>) $ DotFieldOcc (EpAnn (glR $1) (AnnFieldLabel (Just $ glAA $1)) cs) $2) :| [])) }
+ {% acs (\cs -> sLL $1 $> ((sLLa $2 $> $ DotFieldOcc (EpAnn (glR $1) (AnnFieldLabel (Just $ glAA $2)) cs) $3) `NE.cons` unLoc $1)) }
+ | PREFIX_PROJ field {% acs (\cs -> sLL $1 $> ((sLLa $1 $> $ DotFieldOcc (EpAnn (glR $1) (AnnFieldLabel (Just $ glAA $1)) cs) $2) :| [])) }
splice_exp :: { LHsExpr GhcPs }
: splice_untyped { fmap (HsUntypedSplice noAnn) (reLocA $1) }
@@ -3062,7 +3062,7 @@ cmdargs :: { [LHsCmdTop GhcPs] }
acmd :: { LHsCmdTop GhcPs }
: aexp {% runPV (unECP $1) >>= \ (cmd :: LHsCmd GhcPs) ->
runPV (checkCmdBlockArguments cmd) >>= \ _ ->
- return (sL1a (reLoc cmd) $ HsCmdTop noExtField cmd) }
+ return (sL1a cmd $ HsCmdTop noExtField cmd) }
cvtopbody :: { ([AddEpAnn],[LHsDecl GhcPs]) }
: '{' cvtopdecls0 '}' { ([mj AnnOpenC $1
@@ -3098,7 +3098,7 @@ texp :: { ECP }
runPV (rejectPragmaPV $1) >>
runPV $2 >>= \ $2 ->
return $ ecpFromExp $
- reLocA $ sLL $1 $> $ SectionL noAnn $1 (n2l $2) }
+ sLLa $1 $> $ SectionL noAnn $1 (n2l $2) }
| qopm infixexp { ECP $
superInfixOp $
unECP $2 >>= \ $2 ->
@@ -3350,7 +3350,7 @@ ralt :: { forall b. DisambECP b => PV (Located [LGRHS GhcPs (LocatedA b)]) }
gdpats :: { forall b. DisambECP b => PV (Located [LGRHS GhcPs (LocatedA b)]) }
: gdpats gdpat { $1 >>= \gdpats ->
$2 >>= \gdpat ->
- return $ sLL gdpats (reLoc gdpat) (gdpat : unLoc gdpats) }
+ return $ sLL gdpats gdpat (gdpat : unLoc gdpats) }
| gdpat { $1 >>= \gdpat -> return $ sL1 gdpat [gdpat] }
-- layout for MultiWayIf doesn't begin with an open brace, because it's hard to
@@ -3517,7 +3517,7 @@ fieldToUpdate :: { Located [LocatedAn NoEpAnns (DotFieldOcc GhcPs)] }
fieldToUpdate
-- See Note [Whitespace-sensitive operator parsing] in Lexer.x
: fieldToUpdate TIGHT_INFIX_PROJ field {% getCommentsFor (getLocA $3) >>= \cs ->
- return (sLL $1 $> ((sLLa $2 (reLoc $>) (DotFieldOcc (EpAnn (glR $2) (AnnFieldLabel $ Just $ glAA $2) cs) $3)) : unLoc $1)) }
+ return (sLL $1 $> ((sLLa $2 $> (DotFieldOcc (EpAnn (glR $2) (AnnFieldLabel $ Just $ glAA $2) cs) $3)) : unLoc $1)) }
| field {% getCommentsFor (getLocA $1) >>= \cs ->
return (sL1 $1 [sL1a $1 (DotFieldOcc (EpAnn (glNR $1) (AnnFieldLabel Nothing) cs) $1)]) }
@@ -3562,11 +3562,11 @@ name_boolformula :: { LBooleanFormula (LocatedN RdrName) }
: name_boolformula_and { $1 }
| name_boolformula_and '|' name_boolformula
{% do { h <- addTrailingVbarL $1 (gl $2)
- ; return (reLocA $ sLL $1 $> (Or [h,$3])) } }
+ ; return (sLLa $1 $> (Or [h,$3])) } }
name_boolformula_and :: { LBooleanFormula (LocatedN RdrName) }
: name_boolformula_and_list
- { reLocA $ sLL (head $1) (last $1) (And ($1)) }
+ { sLLa (head $1) (last $1) (And ($1)) }
name_boolformula_and_list :: { [LBooleanFormula (LocatedN RdrName)] }
: name_boolformula_atom { [$1] }
@@ -4099,15 +4099,15 @@ comb3 :: (HasLoc a, HasLoc b, HasLoc c) => a -> b -> c -> SrcSpan
comb3 a b c = a `seq` b `seq` c `seq`
combineSrcSpans (getHasLoc a) (combineHasLocs b c)
-comb4 :: Located a -> Located b -> Located c -> Located d -> SrcSpan
+comb4 :: (HasLoc a, HasLoc b, HasLoc c, HasLoc d) => a -> b -> c -> d -> SrcSpan
comb4 a b c d = a `seq` b `seq` c `seq` d `seq`
- (combineSrcSpans (getLoc a) $ combineSrcSpans (getLoc b) $
- combineSrcSpans (getLoc c) (getLoc d))
+ (combineSrcSpans (getHasLoc a) $ combineSrcSpans (getHasLoc b) $
+ combineSrcSpans (getHasLoc c) (getHasLoc d))
-comb5 :: Located a -> Located b -> Located c -> Located d -> Located e -> SrcSpan
+comb5 :: (HasLoc a, HasLoc b, HasLoc c, HasLoc d, HasLoc e) => a -> b -> c -> d -> e -> SrcSpan
comb5 a b c d e = a `seq` b `seq` c `seq` d `seq` e `seq`
- (combineSrcSpans (getLoc a) $ combineSrcSpans (getLoc b) $
- combineSrcSpans (getLoc c) $ combineSrcSpans (getLoc d) (getLoc e))
+ (combineSrcSpans (getHasLoc a) $ combineSrcSpans (getHasLoc b) $
+ combineSrcSpans (getHasLoc c) $ combineSrcSpans (getHasLoc d) (getHasLoc e))
-- strict constructor version:
{-# INLINE sL #-}
@@ -4138,7 +4138,7 @@ sLL :: (HasLoc a, HasLoc b) => a -> b -> c -> Located c
sLL x y = sL (comb2 x y) -- #define LL sL (comb2 $1 $>)
{-# INLINE sLLa #-}
-sLLa :: Located a -> Located b -> c -> LocatedAn t c
+sLLa :: (HasLoc a, HasLoc b) => a -> b -> c -> LocatedAn t c
sLLa x y = sL (noAnnSrcSpan $ comb2 x y) -- #define LL sL (comb2 $1 $>)
{-# INLINE sLLAsl #-}
=====================================
configure.ac
=====================================
@@ -171,6 +171,14 @@ AC_ARG_ENABLE(ghc-toolchain,
)
AC_SUBST([EnableGhcToolchain])
+AC_ARG_ENABLE(strict-ghc-toolchain-check,
+[AS_HELP_STRING([--enable-strict-ghc-toolchain-check],
+ [Whether to raise an error if the output of ghc-toolchain differs from configure])],
+ [FP_CAPITALIZE_YES_NO(["$enableval"], [EnableStrictGhcToolchainCheck])],
+ [EnableStrictGhcToolchainCheck=NO]
+)
+AC_SUBST([EnableStrictGhcToolchainCheck])
+
dnl CC_STAGE0, LD_STAGE0, AR_STAGE0 are like the "previous" variable
dnl CC, LD, AR (inherited by CC_STAGE[123], etc.)
dnl but instead used by stage0 for bootstrapping stage1
=====================================
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
=====================================
@@ -687,7 +687,7 @@ instance heads which unify with @nm tys@, they need not actually be satisfiable.
@B@ themselves implement 'Eq'
- @reifyInstances ''Show [ 'VarT' ('mkName' "a") ]@ produces every available
- instance of 'Eq'
+ instance of 'Show'
There is one edge case: @reifyInstances ''Typeable tys@ currently always
produces an empty list (no matter what @tys@ are given).
=====================================
m4/fp_link_supports_no_as_needed.m4
=====================================
@@ -8,9 +8,9 @@ AC_DEFUN([FP_LINK_SUPPORTS_NO_AS_NEEDED],
AC_MSG_CHECKING([whether Cc linker supports -Wl,--no-as-needed])
echo 'int f(int a) {return 2*a;}' > conftest.a.c
echo 'int f(int a); int main(int argc, char **argv) {return f(0);}' > conftest.b.c
- $CC -c -o conftest.a.o conftest.a.c > /dev/null 2>&1
- $CC -c -o conftest.b.o conftest.b.c > /dev/null 2>&1
- if "$CC" "$$1" -Wl,--no-as-needed -o conftest conftest.a.o conftest.b.o > /dev/null 2>&1
+ $CC -c -o conftest.a.o conftest.a.c 2>&1
+ $CC -c -o conftest.b.o conftest.b.c 2>&1
+ if "$CC" ${$1:+$$1} -Wl,--no-as-needed -o conftest conftest.a.o conftest.b.o 2>&1
then
$1="$$1 -Wl,--no-as-needed"
AC_MSG_RESULT([yes])
=====================================
m4/ghc_toolchain.m4
=====================================
@@ -151,6 +151,11 @@ AC_DEFUN([VALIDATE_GHC_TOOLCHAIN],[
In light of it, if you've spotted this difference, please report a GHC bug at
https://www.haskell.org/ghc/reportabug
])
+
+ case "$EnableStrictGhcToolchainCheck" in
+ YES)
+ AC_MSG_ERROR([Failing due to --enable-strict-ghc-toolchain-check])
+ esac
fi
])
=====================================
m4/prep_target_file.m4
=====================================
@@ -58,7 +58,8 @@ AC_DEFUN([PREP_BOOLEAN],[
$1Bool=False
;;
*)
- AC_MSG_WARN([m4/prep_target_file.m4: Expecting YES/NO but got $$1 in $1])
+ AC_MSG_WARN([m4/prep_target_file.m4: Expecting YES/NO but got $$1 in $1. Defaulting to False.])
+ $1Bool=False
;;
esac
AC_SUBST([$1Bool])
@@ -78,7 +79,8 @@ AC_DEFUN([PREP_NOT_BOOLEAN],[
Not$1Bool=False
;;
*)
- AC_MSG_WARN([m4/prep_target_file.m4: Expecting YES/NO but got $$1 in $1])
+ AC_MSG_WARN([m4/prep_target_file.m4: Expecting YES/NO but got $$1 in $1. Defaulting to False.])
+ Not$1Bool=False
;;
esac
AC_SUBST([Not$1Bool])
=====================================
utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cpp.hs
=====================================
@@ -4,6 +4,7 @@ module GHC.Toolchain.Tools.Cpp (HsCpp(..), findHsCpp, Cpp(..), findCpp) where
import Control.Monad
import System.FilePath
+import Data.List(isInfixOf)
import GHC.Toolchain.Prelude
import GHC.Toolchain.Program
@@ -39,10 +40,29 @@ findHsCpp progOpt cc = checking "for Haskell C preprocessor" $ do
-- Haskell source.
findHsCppArgs :: Program -> M [String]
findHsCppArgs cpp = withTempDir $ \dir -> do
+
+ (_, stdout0, stderr0) <- readProgram cpp ["-x", "c", "/dev/null", "-dM", "-E"]
+
+ if "__clang__" `isInfixOf` stdout0 || "__clang__" `isInfixOf` stderr0
+ then return ["-undef", "-traditional", "-Wno-invalid-pp-token", "-Wno-unicode", "-Wno-trigraphs"]
+ else do
+ (_, stdout1, stderr1) <- readProgram cpp ["-v"]
+ if "gcc" `isInfixOf` stdout1 || "gcc" `isInfixOf` stderr1
+ then return ["-undef", "-traditional"]
+ else do
+ logDebug "Can't recognize your CPP program, you may need to set --with-hs-cpp-flags=FLAGS explicitly"
+ return []
+
+
+{- TODO: We want to just check which flags are accepted rather than branching on which compiler
+ we are using but this does not match what ./configure does (#23720)
+
+ When we retire configure then this more precise logic can be reinstated.
+
let tmp_h = dir </> "tmp.h"
-- Werror to ensure that unrecognized warnings result in an error
- checkFlag flag =
+ let checkFlag flag =
checking ("for "++flag++" support") $ callProgram cpp ["-Werror", flag, tmp_h]
tryFlag flag =
@@ -56,6 +76,7 @@ findHsCppArgs cpp = withTempDir $ \dir -> do
, tryFlag "-Wno-unicode"
, tryFlag "-Wno-trigraphs"
]
+ -}
----- C preprocessor -----
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5480008f170067a9106f37b887492a8771601f80...e485d938fb36d3985571b71cd00ec09e06082cd1
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5480008f170067a9106f37b887492a8771601f80...e485d938fb36d3985571b71cd00ec09e06082cd1
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230726/effdd3b3/attachment-0001.html>
More information about the ghc-commits
mailing list