Skip to content

Need a way to load the _rust_crate_map_toplevel from a SO on Android #11731

Closed
@larsbergstrom

Description

@larsbergstrom

For Servo on Android, Rust is unable to find the _rust_crate_map_toplevel because dlsym will not search all of the loaded modules in The Normal Way. This problem has caused us to currently change the implementation of get_crate_map as follows:

        let module = if cfg!(target_os = "android") {
            dl::open_external(&Path::new("/data/data/com.example.ServoAndroid/lib/libservo.so"))
        } else {
            dl::open_internal()
        };

It would be better if there was some way to provide the runtime with the name of the binary that contains the toplevel crate map.

CC: @aydinkim

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions