Skip to content

Android fails to link in libc-test  #60909

Open
@gnzlbg

Description

@gnzlbg

I was trying to fix and upgrade the Android build jobs in libc, and I've managed to get the x86_64 and i686 ones running, but the arm and aarch64 ones fail to link and I have no idea why (rust-lang/libc#1344). These are the two errors that I get:

= note: /android/ndk-arm/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory
          /android/ndk-arm/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtend_android.o: No such file or directory
          /android/ndk-arm/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -llog
          external/jemalloc/src/jemalloc.c:1422: error: undefined reference to 'pthread_atfork'
          external/jemalloc/src/jemalloc.c:1422: error: undefined reference to 'pthread_atfork'
          external/jemalloc/src/jemalloc.c:1422: error: undefined reference to 'pthread_atfork'
          external/jemalloc/src/jemalloc.c:1422: error: undefined reference to 'pthread_atfork'
          external/jemalloc/src/jemalloc.c:1358: error: undefined reference to 'atexit'
          clang80: error: linker command failed with exit code 1 (use -v to see invocation)

and

cannot find crtbegin_dynamic.o: No such file or directory
          clang80: error: linker command failed with exit code 1 (use -v to see invocation)

I initially suspected that this might have something to do with the different API or NDK versions used by rust-lang/rust vs the ones in the PR which are newer, but the part of the test script that fails is the one that has --no-default-features in it, which means that use_std is disabled, so only libcore should be linked, so this shouldn't be an issue.

The Android build jobs have been failing for a couple of months already, and we have been adding linux APIs that might have been breaking Android because they are not properly scoped, so getting these up and running again is kind of important for Android support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.O-androidOperating system: AndroidT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions