phoityne / ghci-dap

ghci having DAP interface.
https://hackage.haskell.org/package/ghci-dap
Other
19 stars 3 forks source link

does not work on aarch64(raspi4_centos). #10

Open phoityne opened 1 year ago

phoityne commented 1 year ago

VSCode

Configuration read.
Starting GHCi.
Wait for a moment.

CWD: /work/haskell/sample-cabal
CMD: cabal repl -w ghci-dap --repl-no-load --builddir=/work/haskell/sample-cabal/.vscode/dist-cabal-repl

Now, waiting for an initial prompt("> ") from ghci.

Resolving dependencies...
Build profile: -w ghc-9.4.3 -O1
In order, the following will be built (use -v for more details):
 - sample-cabal-0.1.0.0 (lib) (first run)
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-pkg-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-pkg-9.4.3)
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-pkg-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/../lib/aarch64-linux-ghc-9.4.3/libHSterminfo-0.4.1.5-ghc9.4.3.so)
Configuring library for sample-cabal-0.1.0.0..
[DAP][INFO] start ghci-dap-0.0.20.0.
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-pkg-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-pkg-9.4.3)
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-pkg-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/../lib/aarch64-linux-ghc-9.4.3/libHSterminfo-0.4.1.5-ghc9.4.3.so)
Preprocessing library for sample-cabal-0.1.0.0..
[DAP][INFO] start ghci-dap-0.0.20.0.
GHCi, version 9.4.3: https://www.haskell.org/ghc/  :? for help
ghci-dap: internal error: ASSERTION FAILED: file rts/linker/elf_reloc_aarch64.c, line 118

    (GHC version 9.4.3 for aarch64_unknown_linux)
    Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug
Error: cabal: repl failed for sample-cabal-0.1.0.0. The build process
terminated with exit code -6
3

invalid HANDLE. eof.

CLI.

[root@localhost sample-cabal]# cabal repl -w ghci-dap --repl-no-load --builddir=/work/haskell/sample-cabal/.vscode/dist-cabal-repl
Build profile: -w ghc-9.4.3 -O1
In order, the following will be built (use -v for more details):
 - sample-cabal-0.1.0.0 (lib) (first run)
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-pkg-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-pkg-9.4.3)
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-pkg-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/../lib/aarch64-linux-ghc-9.4.3/libHSterminfo-0.4.1.5-ghc9.4.3.so)
Preprocessing library for sample-cabal-0.1.0.0..
[DAP][INFO] start ghci-dap-0.0.20.0.
GHCi, version 9.4.3: https://www.haskell.org/ghc/  :? for help
ghci-dap: internal error: ASSERTION FAILED: file rts/linker/elf_reloc_aarch64.c, line 118

    (GHC version 9.4.3 for aarch64_unknown_linux)
    Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug
Error: cabal: repl failed for sample-cabal-0.1.0.0. The build process
terminated with exit code -6

[root@localhost sample-cabal]# 

works well with the ghci.

[root@localhost sample-cabal]# 
[root@localhost sample-cabal]# cabal repl --repl-no-load --builddir=/work/haskell/sample-cabal/.vscode/dist-cabal-repl
Resolving dependencies...
Build profile: -w ghc-9.4.3 -O1
In order, the following will be built (use -v for more details):
 - sample-cabal-0.1.0.0 (lib) (configuration changed)
Configuring library for sample-cabal-0.1.0.0..
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/../lib/aarch64-linux-ghc-9.4.3/libHShaskeline-0.8.2-ghc9.4.3.so)
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/../lib/aarch64-linux-ghc-9.4.3/libHSghc-9.4.3-ghc9.4.3.so)
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/../lib/aarch64-linux-ghc-9.4.3/libHSterminfo-0.4.1.5-ghc9.4.3.so)
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-pkg-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-pkg-9.4.3)
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-pkg-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/../lib/aarch64-linux-ghc-9.4.3/libHSterminfo-0.4.1.5-ghc9.4.3.so)
Preprocessing library for sample-cabal-0.1.0.0..
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/../lib/aarch64-linux-ghc-9.4.3/libHShaskeline-0.8.2-ghc9.4.3.so)
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/../lib/aarch64-linux-ghc-9.4.3/libHSghc-9.4.3-ghc9.4.3.so)
/root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/./ghc-9.4.3: /lib64/libtinfo.so.6: no version information available (required by /root/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/bin/../lib/aarch64-linux-ghc-9.4.3/libHSterminfo-0.4.1.5-ghc9.4.3.so)
GHCi, version 9.4.3: https://www.haskell.org/ghc/  :? for help
ghci> :q
Leaving GHCi.
[root@localhost sample-cabal]# 

ghc-9.4.3 file rts/linker/elf_reloc_aarch64.c, line 116-125

        case COMPAT_R_AARCH64_ADR_GOT_PAGE: {
            /* range is -2^32 <= X < 2^32 */
            CHECK(isInt64(21+12, addend)); /* X in range */
            CHECK((addend & 0xfff) == 0); /* page relative */

            *(inst_t *)P = (*(inst_t *)P & 0x9f00001f)
               | (inst_t)(((uint64_t)addend << 17) & 0x60000000)  // lo
               | (inst_t)(((uint64_t)addend >> 9)  & 0x00ffffe0); // hi
            break;
        }