Skip to content

flag_if_supported("-lunwind") seems to always fail with ndk25 clang #731

Open
@plusls

Description

@plusls

Like #459

I compile A helloworld in windows with nightly-x86_64-pc-windows-msvc target aarch64-linux-android, with

cargo +nightly build -vv --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target aarch64-linux-android

it tell me that

  = note: ld: error: unable to find library -lgcc
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

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

        let has_unwind = true;

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:

[target.aarch64-linux-android]
linker = "C:\\Users\\plusls\\AppData\\Local\\Android\\Sdk\\ndk\\25.1.8937393\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin\\aarch64-linux-android33-clang.cmd"
ar = "C:\\Users\\plusls\\AppData\\Local\\Android\\Sdk\\ndk\\25.1.8937393\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin\\llvm-ar.exe"



[target.x86_64-unknown-linux-musl]
linker = "rust-lld"

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-androidOperating system: Android

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions