Skip to content

Build failure: compiler-rt (x86_64-linux -> aarch64-android) #269077

Description

@axelkar

Steps To Reproduce

Steps to reproduce the behavior:

  1. Import nixpkgs with crossSystem = lib.systems.examples.aarch64-android;
  2. Use llvmPackages_latest.compiler-rt or any package which depends on it, like stdenv.cc.

In short: nix build github:axelkar/min-compiler-rt-bug-producer

Build log

https://gist.github.com/axelkar/c4c45ffbb3231bd7683b145504424862

Ends in

-- Installing: /nix/store/ac019r3g5494nc3gpnyxm59gr4zjrkzy-compiler-rt-libc-aarch64-unknown-linux-android-16.0.6/lib/linux/libclang_rt.builtins-aarch64-android.a
ln: failed to create symbolic link './crtbeginS.o': File exists

Additional context

Maybe related:
I haven't gotten lib.systems.examples.aarch64-android-prebuilt to not fail when using Cargo via oxcalica's rust-overlay at an infinite recursion of bionic -> kernel headers -> rsync -> openssl with a bunch of splices in between.

Notify maintainers

@dtzWill
@Ericson2314
@lovek323
@primeos
@alyssais
@RaitoBezarius
@rrbutani
@sternenseemann

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.5.4, NixOS, 23.11 (Tapir), 23.11.20230919.5ba549e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.0`
 - channels(root): `"nixos-23.05"`
 - nixpkgs: `/nix/store/cz973qsjldbw4x7fx0rwcvhr9k645vz2-source`

Priorities

Add a 👍 reaction to issues you find important.

Activity

  1. added
    0.kind: build failure
    on Nov 21, 2023
  2. sternenseemann commented on Nov 22, 2023

    @sternenseemann
    Member

    @reckenrode I guess this needs something similar to 71a7415? I don't think it is worth to start backporting this stuff to 23.05 now though.

    @axelkar Can you please check if master is affected by your issue and report the nixpkgs revision you are testing here?

  3. axelkar commented on Nov 22, 2023

    @axelkar
    MemberAuthor

    compiler-rt is required by buildPackages.llvmPackages.clang, which is aliased in stdenv.cc for non-prebuilt

    buildPackages.androidndkPkgs_24.clang (default stdenv.cc on aarch64-android-prebuilt) builds though

    https://github.com/axelkar/min-compiler-rt-bug-producer/blob/master/flake.lock#L9
    It's the latest nixpkgs from 11 hours ago: ac1a9af07880e360209a12b1a23b0c5d52b2fe2e.

  4. reckenrode commented on Nov 22, 2023

    @reckenrode
    Contributor

    @reckenrode I guess this needs something similar to 71a7415? I don't think it is worth to start backporting this stuff to 23.05 now though.

    Yeah, looks like it. That the same error as the other platforms that had compiler-rt issues.

    Is it only needed for pkgsLLVM? It doesn’t seem like that logic works anymore for any of the other useLLVM platforms.

  5. added
    6.topic: cross-compilation
    on Dec 5, 2023
  6. t184256 commented on Feb 17, 2024

    @t184256
    Contributor

    How do I work around it? Like, disable that postInstall of compiler-rt through overlays or something.

  7. axelkar commented on Feb 22, 2024

    @axelkar
    MemberAuthor

    I think I made it work when adding && !stdenv.hostPlatform.isAndroid to

    '' + lib.optionalString (useLLVM && stdenv.hostPlatform.isLinux) ''

    although I haven't finished compiling LLVM yet.

  8. axelkar commented on Feb 22, 2024

    @axelkar
    MemberAuthor

    Now I'm stuck at the configure phase of libunwind-aarch64-unknown-linux-android:

    libunwind-aarch64-unknown-linux-android> -- The C compiler identification is Clang 16.0.6
    libunwind-aarch64-unknown-linux-android> -- The CXX compiler identification is Clang 16.0.6
    libunwind-aarch64-unknown-linux-android> -- The ASM compiler identification is Clang with GNU-like command-line
    libunwind-aarch64-unknown-linux-android> -- Found assembler: /nix/store/km611q348425sfdxq5qdzyjfqzarvxp7-aarch64-unknown-linux-android-clang-wrapper-16.0.6/bin/aarch64-unknown-linux-android-clang
    libunwind-aarch64-unknown-linux-android> -- Detecting C compiler ABI info
    libunwind-aarch64-unknown-linux-android> -- Detecting C compiler ABI info - failed
    libunwind-aarch64-unknown-linux-android> -- Check for working C compiler: /nix/store/km611q348425sfdxq5qdzyjfqzarvxp7-aarch64-unknown-linux-android-clang-wrapper-16.0.6/bin/aarch64-unknown-linux-android-clang
    libunwind-aarch64-unknown-linux-android> -- Check for working C compiler: /nix/store/km611q348425sfdxq5qdzyjfqzarvxp7-aarch64-unknown-linux-android-clang-wrapper-16.0.6/bin/aarch64-unknown-linux-android-clang - 
    broken
    libunwind-aarch64-unknown-linux-android> CMake Error at /nix/store/wn9nlnmyfd1x6ps3zmy04yxjyw3iji86-cmake-3.27.8/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message):
    libunwind-aarch64-unknown-linux-android>   The C compiler
    libunwind-aarch64-unknown-linux-android>     "/nix/store/km611q348425sfdxq5qdzyjfqzarvxp7-aarch64-unknown-linux-android-clang-wrapper-16.0.6/bin/aarch64-unknown-linux-android-clang"
    libunwind-aarch64-unknown-linux-android>   is not able to compile a simple test program.
    libunwind-aarch64-unknown-linux-android>   It fails with the following output:
    libunwind-aarch64-unknown-linux-android>     Change Dir: '/build/libunwind-src-16.0.6/runtimes/build/CMakeFiles/CMakeScratch/TryCompile-fxh2CC'
    libunwind-aarch64-unknown-linux-android>     Run Build Command(s): /nix/store/msbzwb470a7gqbsv2xvdd4jcrpkl4hmb-ninja-1.11.1/bin/ninja -v cmTC_a4c99
    libunwind-aarch64-unknown-linux-android>     [1/2] /nix/store/km611q348425sfdxq5qdzyjfqzarvxp7-aarch64-unknown-linux-android-clang-wrapper-16.0.6/bin/aarch64-unknown-linux-android-clang    -MD -MT CMakeFiles/cmT
    C_a4c99.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_a4c99.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_a4c99.dir/testCCompiler.c.o -c /build/libunwind-src-16.0.6/runtimes/build/CMakeFiles/CMakeScratch/TryCompile-fxh
    2CC/testCCompiler.c
    libunwind-aarch64-unknown-linux-android>     [2/2] : && /nix/store/km611q348425sfdxq5qdzyjfqzarvxp7-aarch64-unknown-linux-android-clang-wrapper-16.0.6/bin/aarch64-unknown-linux-android-clang   CMakeFiles/cmTC_a4
    c99.dir/testCCompiler.c.o -o cmTC_a4c99   && :
    libunwind-aarch64-unknown-linux-android>     FAILED: cmTC_a4c99
    libunwind-aarch64-unknown-linux-android>     : && /nix/store/km611q348425sfdxq5qdzyjfqzarvxp7-aarch64-unknown-linux-android-clang-wrapper-16.0.6/bin/aarch64-unknown-linux-android-clang   CMakeFiles/cmTC_a4c99.di
    r/testCCompiler.c.o -o cmTC_a4c99   && :
    libunwind-aarch64-unknown-linux-android>     aarch64-unknown-linux-android-ld.lld: error: unable to find library -l:libunwind.a
    libunwind-aarch64-unknown-linux-android>     aarch64-unknown-linux-android-ld.lld: error: unable to find library -l:libunwind.a
    libunwind-aarch64-unknown-linux-android>     clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
    libunwind-aarch64-unknown-linux-android>     ninja: build stopped: subcommand failed.
    

    Also not sure if the patch breaks prebuilt (NDK) compilers.

  9. t184256 commented on Feb 22, 2024

    @t184256
    Contributor
  10. axelkar commented on Feb 22, 2024

    @axelkar
    MemberAuthor

    @t184256 Thanks for reminding me about Nix-on-droid!
    I can't get llvmPackages_16.libraries.libcxxabi to build:

    libcxxabi-aarch64-unknown-linux-android> aarch64-unknown-linux-android-ld.lld: error: undefined symbol: __aarch64_swp8_acq_rel
    libcxxabi-aarch64-unknown-linux-android> aarch64-unknown-linux-android-ld.lld: error: undefined symbol: __aarch64_ldadd4_acq_rel
    libcxxabi-aarch64-unknown-linux-android> aarch64-unknown-linux-android-ld.lld: error: undefined symbol: __aarch64_ldadd8_acq_rel
    

    with the configurations of clang_rt.crtbegin_shared-*.o or clang_rt.crtbegin-*.o, although I can find the symbols in both versions' lib/linux/libclang_rt.builtins-aarch64-android.a.

  11. t184256 commented on Feb 22, 2024

    @t184256
    Contributor

    I know that I saw the same error tonight, but I can't remember what I did to get past it. Sorry.

  12. changed the title [-]Build failure: compiler-rt[/-] [+]Build failure: compiler-rt (x86_64-linux -> aarch64-android)[/+] on May 26, 2024
  13. added
    6.topic: llvm/clang
    on May 27, 2024
  14. added
    2.status: stale
    on Jul 3, 2025
  15. removed
    2.status: stale
    on Aug 6, 2025
  16. added
    2.status: stale
    on Aug 6, 2025
  17. axelkar commented on Aug 6, 2025

    @axelkar
    MemberAuthor

    I think compiler-rt doesn't build a CRT because it's already provided by Bionic. I'll have a patch similar to #321586 coming soon.

  18. removed
    2.status: stale
    on Aug 6, 2025
  19. added
    2.status: stale
    on Feb 4, 2026
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

    0.kind: build failure2.status: stale6.topic: cross-compilation6.topic: llvm/clang

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions