HSghc-prim-0.3.1.0.o: unknown symbol 'memcpy'

I just built stock ghc 7.8.1 against musl on Linux x86_64. I get this: $ ghci GHCi, version 7.8.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... ghc: /lib/ghc-7.8.1/ghc-prim-0.3.1.0/HSghc-prim-0.3.1.0.o: unknown symbol `memcpy' ghc: unable to load package `ghc-prim' $ memcpy is defined in /lib/libc.a; how can I link it in? I tried -lc and -opt-lc options to ghci, in vain.

* M Farkas-Dyck
I just built stock ghc 7.8.1 against musl on Linux x86_64. I get this:
$ ghci GHCi, version 7.8.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... ghc: /lib/ghc-7.8.1/ghc-prim-0.3.1.0/HSghc-prim-0.3.1.0.o: unknown symbol `memcpy' ghc: unable to load package `ghc-prim' $
memcpy is defined in /lib/libc.a; how can I link it in? I tried -lc and -opt-lc options to ghci, in vain.
Don't know if it helps, but I think ghci loads the dynamic library, not the static one. Roman

I rebuilt ghc with clang and gcc; same problem. It works if I add memcpy et al. to libraries/ghc-prim/cbits, but that seems a bad method, as they're available in libc. It seems that I must somehow tell GHC to pull in libc whenever it links against ghc-prim, or to include all needed code from libc in HSghc-prim-0.3.1.0.o. How can I do so? I tried "extra-libraries: c" in ghc-prim.cabal, which fails perplexively, with addDLL: unknown error, tho I disabled building dynamic libraries.
participants (2)
-
M Farkas-Dyck
-
Roman Cheplyaka