-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
libiconv
is still unconditionally linked to all binaries on macOS
#2870
Comments
The problem is that I don't have a macOS machine to debug, cc @goffrie (again). |
I don't think rustc cares about if functions in an extern block are used, but unconditionally considers the library referenced by the extern block used. |
Interesting, I'm pretty sure you're correct. I thought I tested #2150 manually but I might have fooled myself. In that case I'm not sure that we can actually do anything. libiconv is part of the macOS base system at least so it shouldn't pose a problem at runtime. |
Rust binaries are unconditionally linked to libiconv on Darwin (see rust-lang/libc#2870). We already add it as a dependency in `buildRustPackage`, so let's go a step further and propagate it.
It poses a problem in several cases any build system that tries to accurately track dependencies or linkage has to deal with this -- you see this with the Nix discussion that seems to have referenced the issue. It causes various conflicts with C code occasionally, slows down linking/loading/startup/dlsym/etc, and so on. It would also cause massive issues for all Rust programs if Additionally, it's also essentially pointless -- nobody uses the Concretely: I suppose ideally, there might be a I thought it was weirdly needed for unwinding or something, but it's not, so it's pointless to pull this into all Rust programs. As a first step, I'll put up |
The
libc
version in this compiler'sstd
is 0.2.126, which includes #2150, which should have fixed this.The text was updated successfully, but these errors were encountered: