-
Notifications
You must be signed in to change notification settings - Fork 13.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
Provide a way of linking libgcc statically #29527
Comments
I'd personally be interested in just doing this unconditionally, I don't recall if there's a technical reason to link to the dynamic version beyond "just because", but there may be a good reason to! |
I seem to remember that libgcc keeps some singleton state around, so there's questions of how dynlibs avoid getting their own state. I could be wrong. |
Once upon a time, it was necessary to use libgcc_s in order to throw a C++ exception from one shared library to another. That is no longer true on systems that use the GNU linker or gold. See http://www.airs.com/blog/archives/166 for background. |
Triage: no changes i'm aware of |
@alexcrichton: Could you please assess how hard it would be to implement this / provide instructions if you prefer for others to pick it up? Thanks. |
Sorry I don't think I understand enough about how this change would be done in Rust to write up such instructions or evaluate it. |
After inspecting the output from ...
... a plausible workaround for this issue (tested on Linux only) could be:
|
The current version of the Steam runtime provides a build of GCC 9 that does not include a dynamic libgcc at all, so this would be nice for being able to use a consistent, modern gcc build in that environment. @nehaljwani's workaround, slightly tweaked to replace |
This looks like a general request for the binaries rustc generates, it's not specific to bootstrapping. @rustbot label -T-bootstrap |
Here's a (much) more simplified version of this workaround wrapper using well-known Bashisms: #!/bin/bash
exec "${CC:-cc}" "${@/-lgcc_s/-lgcc_eh}" |
gcc et al provide "-static-libgcc" for platforms where a link to libgcc_s.so is undesirable. I need similar functionality in rustc because the cloud I'm deploying to doesn't have that in its runtime.
See issue #29482 for some background.
/cc @alexcrichton
The text was updated successfully, but these errors were encountered: