- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.O-androidOperating system: AndroidOperating system: AndroidT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
see rust/src/auxiliary/linkage-visibility.rs
#[no_mangle]
pub fn foo() { bar(); }
pub fn foo2<T>() {
    fn bar2() {
        bar();
    }
    bar2();
}
#[no_mangle]
fn bar() { }
#[no_mangle]
fn baz() { }
pub fn test() {
    let lib = DynamicLibrary::open(None).unwrap();
    unsafe {
        assert!(lib.symbol::<int>("foo").is_ok());
        assert!(lib.symbol::<int>("baz").is_err());
        assert!(lib.symbol::<int>("bar").is_err());
    }
}This test code is success on linux, but fail on android.
 failed at 'assertion failed: lib.symbol::<int>("foo").is_ok()'
I think dlopen(null pointer, RTLD_LAZY) have to return 'main program Handle', but do not run on android.
Metadata
Metadata
Assignees
Labels
A-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.O-androidOperating system: AndroidOperating system: AndroidT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.