-
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
Looks for static musl despite -C target-feature=-crt-static #691
Comments
The way this the crt-static feature is implemented it'll still need to find |
That's a bit surprising behaviour O:-). If I asked how large a task it would be to make it not need that Anyway, to answer the question, it helps (actually, |
At this point "make it not need libc.a" would be a change to the language essentially, so I think it's a bit beyond the scope of a bug fix int he compiler. |
OK, I finally managed to compile it (with some other, unrelated problems). I can confirm the resulting binary is dynamically linked, so that thing works. What do you mean by a change to the language? Do you mean from the user point of view? I think this would be OK, as the user obviously asks for a dynamic linkage and the only difference would be that it would fail before the fix and succeed after. Or, is there a use case I don't see for requiring the static library and then throwing it away later on? Or do you mean the fix would be too complex and would require a language change for it to be possible? |
Oh I just mean that the semantics of the attribute are defined by the compiler, not by the libc crate. Any change to these semantics would require upstream work in rustc. |
I see now this issue is opened on the wrong repository. Thanks for all the help, I'll try digging in the code a bit more or asking on #rust-internals if I can pin it down. If not, I'll open an issue in rustc. |
Hello
I'm not entirely sure the issue belongs in this repository, but it is where the problem manifests. Also, it might be something I do incorrectly. I apologize if it is so.
I have an SDK for an OpenWRT device, and the system is musl-based. If I compile with the usual
armv7-unknown-linux-musleabihf
, the result works, but it bundles its own statically liked copy of musl, which is not nice on embedded. Therefore, I'm attempting to use xargo and my own target config to produce a dynamically linked binary. AFAIK the recently stabilized-C target-feature=-crt-static
should allow me doing that. However, for reasons I'm unable to track down, I still get this error about static libraryc
when compiling the libc crate:I made a repository which reproduces the problem: https://github.com/vorner/xcompile. When the
./build
script is run, it downloads the SDK (unfortunately, that's 425MBs of download and 1.5GB unpacked :-( ) and runs the failing build.As far as I understand the parameters, the command line of rustc should be correct and ask for dynamic linking:
The rustc should be new enough, and the libc sources come from the same batch provided by rustup:
I'd really like to track this down, but I have no idea where to look. I believe it is not related to this #685 and I don't think there's another place where to ask for dynamic crt.
Thank you
The text was updated successfully, but these errors were encountered: