Assuming you already know what ghc-debug
is about, and want to use it to debug the ghc
program itself.
A recent ghc-debug
checkout is required, since it contains important fixes not release on Hackage yet.
Apply the following patch:
diff --git a/configure.py b/configure.py | |
index d03db1970f..45a53bec60 100755 | |
--- a/configure.py | |
+++ b/configure.py | |
@@ -1634,7 +1634,8 @@ def configure_library(lib, output, pkgname=None): | |
def configure_v8(o, configs): | |
set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0) | |
- o['variables']['v8_enable_webassembly'] = 0 if options.v8_lite_mode else 1 | |
+ o['variables']['v8_enable_webassembly'] = 1 |
Failed to build basement-0.0.16. | |
Build log ( | |
/workspace/.ghc-wasm/.cabal/logs/ghc-9.11.20240918/basement-0.0.16-38a2e29ba85467680a122da498ba789199a6e5e72f561513cefaa7131a0a9068.log | |
): | |
Configuring library for basement-0.0.16... | |
Preprocessing library for basement-0.0.16... | |
In file included from Size.hsc:14: | |
cbits/foundation_system.h:57:5: error: "foundation: system: Unknown compiler" | |
57 | # error "foundation: system: Unknown compiler" | |
| ^ |
diff --git a/compiler/GHC/SysTools/Terminal.hs b/compiler/GHC/SysTools/Terminal.hs | |
index a3f60e24363..809079b4aea 100644 | |
--- a/compiler/GHC/SysTools/Terminal.hs | |
+++ b/compiler/GHC/SysTools/Terminal.hs | |
@@ -20,10 +20,10 @@ import System.IO.Unsafe | |
#if defined(mingw32_HOST_OS) && !defined(WINAPI) | |
# if defined(i386_HOST_ARCH) | |
# define WINAPI stdcall | |
-# elif defined(x86_64_HOST_ARCH) | |
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) |
{-# LANGUAGE MagicHash #-} | |
{-# LANGUAGE UnboxedTuples #-} | |
{-# OPTIONS_GHC -feager-blackholing #-} | |
module Spark | |
( spark, | |
sparkST, | |
sparkList, | |
) | |
where |
-Wimplicit | |
-include | |
rts/include/ghcversion.h | |
-Irts/include | |
-I_build/stage1/rts/build | |
-I_build/stage1/rts/build/include | |
-Irts/include | |
-I_build/stage1/rts/build | |
-Irts | |
-I_build/stage1/rts/build |
diff --git a/Makefile b/Makefile | |
index 18d664f..6e59274 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -51,8 +51,8 @@ default: build | |
@echo "Use -fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION)" | |
check: | |
- CC="clang --sysroot=$(BUILD_PREFIX)/share/wasi-sysroot -fno-strict-aliasing -msimd128 -mnontrapping-fptoint -msign-ext -mbulk-memory -mmutable-globals -mmultivalue -mreference-types -Xclang -target-abi -Xclang experimental-mv" \ | |
- CXX="clang++ --sysroot=$(BUILD_PREFIX)/share/wasi-sysroot -fno-exceptions -fno-exceptions -fno-strict-aliasing -msimd128 -mnontrapping-fptoint -msign-ext -mbulk-memory -mmutable-globals -mmultivalue -mreference-types -Xclang -target-abi -Xclang experimental-mv" \ |
#!/bin/sh | |
git update-ref -d refs/notes/perf | |
git notes prune | |
rmdir .git/logs/refs/notes |
allow-newer: | |
all:Cabal, | |
all:Cabal-syntax, | |
all:array, | |
all:base, | |
all:binary, | |
all:bytestring, | |
all:containers, | |
all:deepseq, | |
all:directory, |
#!/usr/bin/env bash | |
set -euo pipefail | |
apt update | |
apt install -y automake build-essential curl git gnupg libffi-dev libncurses-dev libgmp-dev python3 libdw-dev | |
curl -f -L --retry 5 https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-snapshot.gpg | |
echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg] https://apt.llvm.org/bullseye llvm-toolchain-bullseye main" >> /etc/apt/sources.list.d/llvm-toolchain.list | |
echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg] https://apt.llvm.org/bullseye llvm-toolchain-bullseye-18 main" >> /etc/apt/sources.list.d/llvm-toolchain.list |