-
Notifications
You must be signed in to change notification settings - Fork 111
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
Cannot find libgcc.a in the cargo-apk-temp-extra-link-libraries #265
Comments
so if you look at the linker args the |
I update Rust to the 1.60.0, but the error is still reproduced. |
This is a strange but known issue. Our solution was to just get rid of |
Any flags passed directly to `cargo rustc` will only be passed _to the final compiler invocation_. However `cdylib` library targets in transitive (dependency) crates will still be built (despite not being used in the final binary, that's what `rlib`s are for), but our NDK r23 workaround flags will not reach these compiler invocations rendering b912a6b ("cargo-apk: Work around missing libgcc on NDK r23 with linker script (#189)") ineffective. [The same page] that documents this discrepancy suggests to resort to `RUSTFLAGS` if arguments are intended for all compiler invocations, which is our intended use-case and unblocks builds with transitive `cdylib` dependencies such as `hyper` in [#265]. [The same page]: https://doc.rust-lang.org/cargo/commands/cargo-rustc.html#description [#265]: #265
Any flags passed directly to `cargo rustc` will only be passed _to the final compiler invocation_. However `cdylib` library targets in transitive (dependency) crates will still be built (despite not being used in the final binary, that's what `rlib`s are for), but our NDK r23 workaround flags will not reach these compiler invocations rendering b912a6b ("cargo-apk: Work around missing libgcc on NDK r23 with linker script (#189)") ineffective. [The same page] that documents this discrepancy suggests to resort to `RUSTFLAGS` if arguments are intended for all compiler invocations, which is our intended use-case and unblocks builds with transitive `cdylib` dependencies such as `hyper` in [#265]. [The same page]: https://doc.rust-lang.org/cargo/commands/cargo-rustc.html#description [#265]: #265
…270) Any flags passed directly to `cargo rustc` will only be passed _to the final compiler invocation_. However `cdylib` library targets in transitive (dependency) crates will still be built (despite not being used in the final binary, that's what `rlib`s are for), but our NDK r23 workaround flags will not reach these compiler invocations rendering b912a6b ("cargo-apk: Work around missing libgcc on NDK r23 with linker script (#189)") ineffective. [The same page] that documents this discrepancy suggests to resort to `RUSTFLAGS` if arguments are intended for all compiler invocations, which is our intended use-case and unblocks builds with transitive `cdylib` dependencies such as `hyper` in [#265]. [The same page]: https://doc.rust-lang.org/cargo/commands/cargo-rustc.html#description [#265]: #265
When I build my project I get the following error:
But, when I copy the
target/cargo-apk-temp-extra-link-libraries/libgcc.a
file to the~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib
folder, the project builds successfully.The text was updated successfully, but these errors were encountered: