-
Notifications
You must be signed in to change notification settings - Fork 19
Add GCC runtime (libgcc_s.so). #10
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
base: master
Are you sure you want to change the base?
Conversation
Since the scratch image already contains glibc stuff (because it's impossible to use -optl-static binaries truly statically linked if GHC runtime uses glibc), it also makes sense to add the GCC runtime. It makes the image usable as a base for binaries with dynamically-linked GHC runtimes at a price of 88 kilobytes.
See this comment for my reservations about this PR: #7 (comment) |
It is weird that Neither the README, nor the blog post, nor the example Makefile say anything about GHC/Glibc idiosyncrasies wrt static linking (the fact that So, given the README says
I'm merely fixing a bug.
If you'd like I can squeeze proper README updates in this PR. |
The assumption that the scratch image is sufficient for GHC-compiled static executables is not true. At the very least, libgmp needs to be present. Other libraries - like iconv and its resources - need to be present as well. That's what this image is designed to solve. I've already updated the README to clarify that this is for statically compiled executables. The reason this was never called out before is because static compilation is the default for GHC. |
You probably mean static linking of haskell stuff, not "native" stuff. The problem is still there and the gcc runtime must be present:
|
Can you provide the full reproducing case you're using? It's very hard to guess at what's going on here, especially since my tests with the current image have worked for minimalistic examples. |
I simply try to use the provided example and GHC from |
I'm not sure what's going on there. Pinging @dysinger who wrote that example to comment. Also pinging @ketzacoatl who may have experimented with it recently. |
Bumping the thread. I think this matter is still worth pursuing. |
Since the scratch image already contains glibc stuff
(because it's impossible to use -optl-static binaries truly
statically linked if GHC runtime uses glibc), it also makes
sense to add the GCC runtime.
It makes the image usable as a base for binaries with dynamically-linked GHC runtimes
at a price of 88 kilobytes.
Also closes #7.