-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
unable to find Static system library 'gcc_eh' #17268
Comments
You can reproduce this with a basic hello world program in Rust. That should simplify tracking down the cause.
EDIT: I am partially wrong.
|
I'm pretty sure we can (and should) satisfy libgcc_eh by linking Zig's bundled libunwind, just as we do for libgcc_s. |
This is GCC's take on libunwind. We can satisfy it by way of our bundled LLVM libunwind implementation. Closes ziglang#17268.
This is GCC's take on libunwind. We can satisfy it by way of our bundled LLVM libunwind implementation. Closes ziglang#17268.
@alexrp while that will resolve the linking issue, AFAIK Anyone that lands here when this issue is closed will want to still only use Normally you would want to be wary of However even with the ability to opt-out of dynamic linking, I recall another issue with Zig was that it also forcibly linked it's own CRT? |
Is this the only open issue we have tracking static glibc support? If so, the issue title is somewhat suboptimal... |
No, there's a few IIRC. At least this one for static glibc, and another for users that would like dynamic linking for musl (such distros have their |
I don't think it makes sense to support "static glibc" as an explicit feature, and such a use case is not motivating to me in the slightest. However if an argument can be made that the use case is not working due to bugs or other surprising behavior, then perhaps the use case can be made to work. Zig is supposed to support linking against the object files and other build artifacts installed on one's system, so if that includes a static glibc, then it should be possible to do even without Zig having explicit support for it. |
I understand that, and don't really endorse static glibc either. However I think eyra is a valid use-case example which Zig is presently incompatible with. Dynamic linking for musl is also a valid use-case, so having the ability to explicitly request static or dynamic linking would fix these build concerns.
I believe I tried to do that here, but due to the enforced dynamic linking flag, even though there are no libraries dynamically linked on the executable, it segfaults. I'd consider that a bug? The other issue with compatibility with eyra also involves opt-out via linker flag |
Just to be clear, I don't personally care about static glibc either, except to the extent that we're handling some flags wrong or whatever. I was just trying to figure out whether it makes sense to use this particular issue to track that, or if it makes more sense to close it with #22167 (which is what I was intending to do). |
This should be closed for resolving the #4986 is probably sufficient for tracking static glibc (or equivalent fix) support? |
Zig Version
0.11.0
Steps to Reproduce and Observed Behavior
Hi! I am trying to statically cross-compile Ruff from Linux to Linux-ARM (aarch64-unknown-linux-gnu). At the linking stage with command
TARGET=aarch64-unknown-linux-gnu PKG_CONFIG_ALLOW_CROSS=1 cargo zigbuild --release --target=$TARGET --verbose
I get an error
I have config.toml like this:
The maintainer of cargo-zigbuild advised me to open an issue here
rust-cross/cargo-zigbuild#186
Expected Behavior
Successful build as for Linux-x86_64
The text was updated successfully, but these errors were encountered: