Repository navigation
Open
Labels
0.kind: build failureA package fails to build2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: cross-compilationBuilding packages on a different platform than they will be used on6.topic: llvm/clangIssues related to llvmPackages, clangStdenv and related
Description
Steps To Reproduce
Steps to reproduce the behavior:
- Import nixpkgs with
crossSystem = lib.systems.examples.aarch64-android; - Use
llvmPackages_latest.compiler-rtor any package which depends on it, likestdenv.cc.
In short: nix build github:axelkar/min-compiler-rt-bug-producer
Build log
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.
Reacted by Alexander Sosedkin, Tobias Happ and Theo Paris
Metadata
Metadata
Assignees
Labels
0.kind: build failureA package fails to build2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: cross-compilationBuilding packages on a different platform than they will be used on6.topic: llvm/clangIssues related to llvmPackages, clangStdenv and related
Activity
sternenseemann commentedon Nov 22, 2023
@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
masteris affected by your issue and report the nixpkgs revision you are testing here?axelkar commentedon Nov 22, 2023
compiler-rtis required bybuildPackages.llvmPackages.clang, which is aliased instdenv.ccfor non-prebuiltbuildPackages.androidndkPkgs_24.clang(defaultstdenv.cconaarch64-android-prebuilt) builds thoughhttps://github.com/axelkar/min-compiler-rt-bug-producer/blob/master/flake.lock#L9
It's the latest nixpkgs from 11 hours ago:
ac1a9af07880e360209a12b1a23b0c5d52b2fe2e.reckenrode commentedon Nov 22, 2023
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
useLLVMplatforms.t184256 commentedon Feb 17, 2024
How do I work around it? Like, disable that postInstall of compiler-rt through overlays or something.
axelkar commentedon Feb 22, 2024
I think I made it work when adding
&& !stdenv.hostPlatform.isAndroidtonixpkgs/pkgs/development/compilers/llvm/16/compiler-rt/default.nix
Line 126 in 0b3c2c5
although I haven't finished compiling LLVM yet.
axelkar commentedon Feb 22, 2024
Now I'm stuck at the configure phase of
libunwind-aarch64-unknown-linux-android:Also not sure if the patch breaks prebuilt (NDK) compilers.
t184256 commentedon Feb 22, 2024
@axelcar: take a look at nix-community/nix-on-droid@c959340#diff-8fb66718388ce3aea71c6a6ad6d298561b4d9d097a73f1578c0b9b566e91d887 and, possibly, that entire commit in general.
axelkar commentedon Feb 22, 2024
@t184256 Thanks for reminding me about Nix-on-droid!
I can't get
llvmPackages_16.libraries.libcxxabito build:with the configurations of
clang_rt.crtbegin_shared-*.oorclang_rt.crtbegin-*.o, although I can find the symbols in both versions'lib/linux/libclang_rt.builtins-aarch64-android.a.t184256 commentedon Feb 22, 2024
I know that I saw the same error tonight, but I can't remember what I did to get past it. Sorry.
[-]Build failure: compiler-rt[/-][+]Build failure: compiler-rt (x86_64-linux -> aarch64-android)[/+]axelkar commentedon Aug 6, 2025
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.