-
Notifications
You must be signed in to change notification settings - Fork 192
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
Has anybody succeeded with static build with dependent C++ library? #65
Comments
I'm sorry to hear about this problem! Unfortunately, you should probably assume that fixing a complicated C or C++ library to build and work with a |
I've had a lot of success with statically linking C++ libs when I ran my build inside a alpine container with an explicit target for alpine musl. For example: https://github.com/superfly/fly.rs/blob/master/Dockerfile |
Hi,
I'm trying to build static binary, which depends on taglib, which is C++ library with C bindings. I use this rust crate, which binds this library - https://github.com/ebassi/taglib-rust.
After bit of playing around I ended up with link failure, where only two symbols are missing
__dso_handle
and__sprintf_chk
- first one seems to be generic problem of static linking of C++ library - as refered here rust-lang/rust#36710 (comment) (with some possible workaround), for second symbol I'm not sure - it looks like some incompatibility between glibc and musl libc? Musl faq says "The existing libstdc++ is actually compatible with musl in most cases and could be used by copying it into the musl library path".Here are steps I've done to compile (using this image):
And got this error:
My question is if somebody has experiences with using C++ library in static build, if I'm doing something wrong or if there are any recommendation how to process, I'm not much expert on c/c++, I saw that possibily of custom build script, but I guess it'll still not solve the problem with second symbol
__sprintf_chk
.Thanks
The text was updated successfully, but these errors were encountered: