-
Notifications
You must be signed in to change notification settings - Fork 38
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
default to shared-llvm for ghc 7.8 (so that by default ghci works) #84
Comments
i'll test more this evening |
What goes wrong with --enable-shared but not -fshared-llvm? |
this (note in GHCI in 7.8 RC, which means its using a dylib / dynlinking for ghci)
|
Is this a GHCi thing or a general problem with having a shared llvm-general itself built with static llvm libraries? |
I think its a general thing for shared libs. if i do a rebuild sans -fshared-llvm i get
this is because on x86 / arm, GHCI now uses dylinking rather than static linking, and TH uses GHCI. And LLVM-General uses TH and hence GHCI to build itself. (and some of the modules with TH depend on other modules which link into LLVM) If it weren't for the TH usage, i'd suspect that (at least in compiled code outside of ghci) the static linking would be fine... but ghci and thence TH need dylinking for 7.8 on platforms when applicable (and its kinda awesome being able to use llvm-general in ghci! ) |
Now I'm more confused. I thought that GHCi and hence TH didn't work with llvm-general prior to the new 7.8 stuff at all; so I'd been (hastily, apparently) assuming that the TH usage within llvm-general avoided needing to link against llvm. Did llvm-general + ghci work in any combination prior to 7.8? If so, how did the TH in llvm-general work? |
Hrmmm. Honestly, the answer in my prior remark is largely conjecture, and I find linkers confusing :) It especially doesn't help that the ghci static linker is a unique artifact to ghc, and isn't the standard system static / dynamic linkers. Though you can read the source to see a bit of this https://github.com/ghc/ghc/blob/master/rts/Linker.c#L248-L272 (that seems to touch on part of the issue) and yes, llvm-general + ghci prior to 7.8 didn't work, though i'm happy to do a sandboxed setup sometime tomorrow to double check that if you like |
I asked Austin (thoughtpolice) on IRC and he's got a pretty good explanation (or at least the start of one )
|
looks like this may be a manifestation of https://ghc.haskell.org/trac/ghc/ticket/8696#comment:9 |
I got things building with static linked llvm, BUT then it fails in ghci
|
With GHC 7.8.2 and then starting ghci via cabal repl I got something like Loading package llvm-general ... linking ... segmenation fault or illegal instruction. I had installed the llvm-general with the --enable-shared flag. Installing llvm-general with both the -fshared-llvm and --enable-shared solved the problem for me. I hope this helps anyone with the same problem. |
I wanted to clarify for anyone having trouble (and confirm @hberntsen's comment). With ghc-7.8.3, llvm-general-3.4.4.0, and llvm 3.4.2. (Re)Compile llvm with shared libraries
Install llvm-general so that
|
ghci in 7.8 supports llvm-general, but only if linked against shared-llvm
i'll test if static lnking works for compiled code, but having ghci interaction work by default would be a huge win!
The text was updated successfully, but these errors were encountered: