Skip to content
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

cargo-apk: Work around missing libgcc on NDK r23 with linker script #189

Merged
merged 1 commit into from
Nov 15, 2021

Commits on Nov 12, 2021

  1. cargo-apk: Work around missing libgcc on NDK r23 with linker script

    Rust still searches for libgcc even though [85806] replaces internal use
    with libunwind, especially now that the Android NDK (since r23-beta3)
    doesn't ship with any of gcc anymore.  The apparent solution is to build
    your application with nightly and compile std locally (`-Zbuild-std`),
    but that is not desired for the majority of users.  [7339] suggests to
    provide a local `libgcc.a` as linker script, which simply redirects
    linking to `libunwind` instead - and that has proven to work fine so
    far.
    
    Intead of shipping this file with the crate or writing it to an existing
    link-search directory on the system, we write it to a new directory that
    can be easily passed or removed to `rustc`, say in the event that a user
    switches to an older NDK and builds without cleaning.  For this we need
    to switch from `cargo build` to `cargo rustc`, but the existing
    arguments and desired workflow remain identical.
    
    [85806]: rust-lang/rust#85806
    [7339]: termux/termux-packages#7339 (comment)
    MarijnS95 committed Nov 12, 2021
    Configuration menu
    Copy the full SHA
    61795db View commit details
    Browse the repository at this point in the history