Skip to content

Gimli doesn't support Android #351

@alexcrichton

Description

@alexcrichton
Member

same as #350, but for Android

Activity

tesuji

tesuji commented on Oct 29, 2020

@tesuji
Contributor

Starting from lollipop (android 5, api level 21), android defines dl_iterate_phdr in <link.h>.
Currently, rustc supports down to api level 14.
I will investigate more about other possibilities but if you have opinions
on this issue, please make a voice.

alexcrichton

alexcrichton commented on Oct 29, 2020

@alexcrichton
MemberAuthor

It might be possible to use dlsym on Android to cover the differences, although another possibility is to look to increase the API level in rust-lang/rust

s1341

s1341 commented on Apr 7, 2021

@s1341

I'm interested in getting backtraces on Android. Currently I get a list of ""s....

Is there any working solution?

s1341

s1341 commented on Apr 7, 2021

@s1341

I got it working, trick was to add default-features = false and features = [ "std", "libbacktrace" ]

kjvalencik

kjvalencik commented on Apr 7, 2021

@kjvalencik
Contributor

@s1341 Were there any additional steps you needed to take? Switching to backtrace-sys with the libbacktrace feature flag was insufficient.

s1341

s1341 commented on Apr 8, 2021

@s1341

@kjvalencik I had to turn off default-features too. It wasn't enough to turn on libbacktrace.

jrose-signal

jrose-signal commented on Apr 19, 2021

@jrose-signal

I'm not 100% sure this is the same issue but I'll note that Signal has encountered some Android devices that claim to be API22 but still don't have dl_iterate_phdr. A dlsym-based solution would be safest for us.

kjvalencik

kjvalencik commented on Apr 19, 2021

@kjvalencik
Contributor

@jrose-signal That would impact both the backend-sys implementation as well as #415 which both depend on the API version being targeted at compile time to determine if dl_iterate_phdr is available.

Are you able to provide any additional details or link to an issue? Thanks!

jrose-signal

jrose-signal commented on Apr 19, 2021

@jrose-signal

Ah, I take it back: upon further investigation we've had some builds come out that are missing -ldl. I'm not sure how they even linked, honestly. Still looking to see if this is the only issue.

jrose-signal

jrose-signal commented on Apr 22, 2021

@jrose-signal

For anyone curious: I never quite tracked it down, but our Docker build was not including -ldl even though our other builds were, and this only caused problems on some phones because most of them re-export the libdl APIs through libc (or something else that meant it didn't need to be explicitly linked). signalapp/libsignal#274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @alexcrichton@kjvalencik@s1341@tesuji@jrose-signal

      Issue actions

        Gimli doesn't support Android · Issue #351 · rust-lang/backtrace-rs