GHC cross-compilers do not support TH (nor annotations) out-of-the-box. You need to build an external interpreter program (called iserv) for the target, to run it into qemu or on a real aarch64 playform, to setup an iserv-proxy for ghc to communicate with it… haskell.nix does this automatically afaik, so it may be easier to use it.
Run remote-iserv on some aarch64 host (virtual or not)
Use GHC cross-compiler with the following flags: -fexternal-interpreter -pgmi path/to/iserv-proxy -opti10.0.1.21 -opti500 (adapt the arguments to the ip/port of the remote-iserv host).
cabal install -flibrary -fproxy -w aarch64-linux-gnu-ghc. But got the below error:
src/Cli.hs:3:1: error:
Could not find module ‘Remote.Slave’
Use -v (or :set -v in ghci) to see a list of the files searched for.
|
3 | import Remote.Slave (startSlave’)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: cabal: Failed to build exe:remote-iserv from remote-iserv-9.6.3. See