Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hsc2hs doesn't work when using constructors in ghc-prim #63

Open
googleson78 opened this issue Oct 18, 2021 · 0 comments
Open

hsc2hs doesn't work when using constructors in ghc-prim #63

googleson78 opened this issue Oct 18, 2021 · 0 comments

Comments

@googleson78
Copy link

When using both hsc2hs and something from ghc-prim (in my case, I can trigger this by matching on any of the Word* or Int*) constructors, my compilation fails.

Output from stack (also occurs with cabal):

blademaster :: ~/git/ghc-prim-hsc-bug ‹main› » stack build
ghc-prim-hsc-bug> build (lib)
Preprocessing library for ghc-prim-hsc-bug-0.1.0.0..
linking .stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0/build/X_hsc_make.o failed (exit code 1)
rsp file was: ".stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0/build/hsc2hscall331714-2.rsp"
command was: /usr/bin/gcc .stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0/build/X_hsc_make.o .stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0/build/X_hsc_utils.o -o .stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0/build/X_hsc_make -fuse-ld=lld -fuse-ld=lld -L/home/googleson78/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/lib/ghc-8.10.7/base-4.14.3.0 -Wl,-R,/home/googleson78/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/lib/ghc-8.10.7/base-4.14.3.0 -L/home/googleson78/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0 -Wl,-R,/home/googleson78/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0 -lgmp -L/home/googleson78/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/lib/ghc-8.10.7/ghc-prim-0.6.1 -Wl,-R,/home/googleson78/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/lib/ghc-8.10.7/ghc-prim-0.6.1 -lc -lm -L/home/googleson78/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/lib/ghc-8.10.7/rts -Wl,-R,/home/googleson78/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/lib/ghc-8.10.7/rts -lm -lrt -ldl -lpthread
error: ld.lld: error: undefined symbol: hsc__
>>> referenced by X_hsc_make.c
>>>               .stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0/build/X_hsc_make.o:(main)
collect2: error: ld returned 1 exit status


--  While building package ghc-prim-hsc-bug-0.1.0.0 (scroll up to its section to see the error) using:
      /home/googleson78/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0 build lib:ghc-prim-hsc-bug --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

Here's a reproducer:
https://github.com/googleson78/ghc-prim-hsc-bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant