-
Notifications
You must be signed in to change notification settings - Fork 453
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
flag_if_supported("-lunwind") seems to always fail with ndk25 clang #731
Comments
It's not obvious that this is the right forum to discuss this problem. Because it appears to be a pure Rust problem. At least cc-rs is primarily about compiling C/C++ modules and no C/C++ modules are compiled here. However, cc-rs appears to be invoked exclusively to determine which library to link with to reach out for unwind interface.
In the context it's important to recognize that this |
Just in case, #728 is likely to be related. Maybe even making the current arrangement work? |
Just in case, for completeness and ultimate clarity. cc-rs, or rather the build script, has access to the information about linker configured through .cargo/config.toml, but not one chosen by Rust automatically. "Interrogate" refers to the latter case. |
I add some debug code, and I found that the command line is
clang output is:
and the command in aarch64-linux-android33-clang.cmd is:
And I found that if I remove |
And I found that in cmake-rs, it set no_default_flags when use ndk So I think that unwind in rust also should add no_default_flags to fix it. I know I shouldn't to talk this in here, but I found that although I set is_flag_supported, cc-rust will no respect it and create a new ctx. Line 470 in 53fb72c
I think maybe it should add: cfg.no_default_flags(self.no_default_flags); |
Like #459
I compile A helloworld in windows with nightly-x86_64-pc-windows-msvc target aarch64-linux-android, with
it tell me that
But I found a fix in rust-lang/rust#85806, it check if compiler support lunwind, it will use system-llvm-libunwind.
https://github.com/rust-lang/rust/blob/1536ab1b383f21b38f8d49230a2aecc51daffa3d/library/unwind/build.rs#L19
And I change it to
It will compile and link success, so I think it's a bug that cause flag_if_supported("-lunwind") seems to always fail
And my cargo config:
The text was updated successfully, but these errors were encountered: