-
Notifications
You must be signed in to change notification settings - Fork 102
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
Try building static *.so file #45
Comments
Ah, now I remember why you don't statically link glibc: it is licensed under LGPL, allowing you to link it dynamically but not include and ship it as part of a statically linked library. See e.g. https://lwn.net/Articles/117972/ |
I tried using musl libc, but it seems to hit a bug with wasmer: wasmerio/wasmer#1173 Marked blocked until that issue is resolved. |
Looks like this was fixed in wasmer master (fast response guys!): wasmerio/wasmer#1180 TODO: test if this works and wait for a new release. (something after 0.13.1) |
I wonder if this can ever work without forcing the Go binary to be built with musl as well (wich probably can be done with sme limitations). If the If a musl compiled Go blockchain sounds like an option, out best bet for a build environment is probably Alpine, where musl is the system's standard libc. |
That may make this easier than trying to do so on Ubuntu. You commented on the PR, and I had broken it into two pieces... first compile with |
I doubt this can work. It would imply you have the same symbol names twice (in the .so and the system's libc). |
Closed by #106 This shows how to build a static binary in alpine, which works in Docker or as a universal binary. We do not commit it to the repo, and can use the standard *.so builds locally (in OSX or Linux) for development. |
Added contract state query to rest
To avoid issues with linking to glibc on different architectures and to produce a more portable binary when embedded in a go app, let's try fully static linking on the dll.
https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/musl-support-for-fully-static-binaries.html suggests it is simply using the
x86_64-unknown-linux-musl
target. Try to build this and ensure the same compiledlibgo_cosmwasm.so
file can run without changes on:(This can be tested via docker containers)
Also check the size difference. It can be larger, but ideally no more than say 10MB (it is around 3MB now).
The text was updated successfully, but these errors were encountered: