Repository navigation
Conversation
| # But these aren't required for compiler-rt-libc's build, so let's skip them. | ||
| overrideCC args.stdenv buildLlvmTools.clangNoCompilerRtWithLibc | ||
| else | ||
| # TODO: make this not use compiler-rt-no-libc either? will cause rebuilds. |
There was a problem hiding this comment.
Rebuilds are fine. They happen once, but code contortions to avoid rebuilds tend to stick around for a long time.
(If you're really in a hurry, we can merge rebuild avoidance to master as long as you promise to follow up on staging as soon as the changes are merged into it to drop the extra conditionals.)
There was a problem hiding this comment.
I'm not sure if it works, it'd need additional testing, but I do agree with you.
There was a problem hiding this comment.
Are you able to do that testing?
There was a problem hiding this comment.
libxcrypt from pkgsLLVM.llvmPackages.compiler-rt's closure fails with configure: error: C compiler cannot create executables. Here's a snippet from config-log:
x86_64-unknown-linux-gnu-ld: error: cannot open crtbeginS.o: No such file or directory
x86_64-unknown-linux-gnu-ld: error: unable to find library -lgcc
x86_64-unknown-linux-gnu-ld: error: unable to find library -lgcc_s
x86_64-unknown-linux-gnu-ld: error: unable to find library -lgcc
x86_64-unknown-linux-gnu-ld: error: unable to find library -lgcc_s
x86_64-unknown-linux-gnu-ld: error: cannot open crtendS.o: No such file or directory
There was a problem hiding this comment.
I think there may be a cyclic dependency here, like compiler-rt depends on libxcrypt which depends on compiler-rt again.
The error cannot open crtbeginS.o: No such file or directory points to it requiring a CRT, which on an LLVM-based platform is provided by compiler-rt.
Though that check could be bounded by the dependency of libxcrypt (i.e. host platform uses glibc), instead of "not Android".
I can't get musl+LLVM working due to #431439 so I won't be able to test runtime functionality, but pkgsStatic.pkgsLLVM.llvmPackages.compiler-rt builds fine with clangNoCompilerRtWithLibc.
There was a problem hiding this comment.
I can't get musl+LLVM working due to #431439 so I won't be able to test runtime functionality, but
pkgsStatic.pkgsLLVM.llvmPackages.compiler-rtbuilds fine withclangNoCompilerRtWithLibc.
Does #431439 (comment) help with this?
There was a problem hiding this comment.
I'm not sure what I meant with that. I think I meant that I can't get the wrapped LLVM toolchain working, because pkgsStatic.pkgsLLVM.stdenv.cc depends on libunwind.
The comment you linked was also for the chaining of pkgsLLVM and pkgsStatic, unrelated to the issue with libunwind.
There was a problem hiding this comment.
I finally got around to looking into this properly, and it turns out the compiler-rt libxcrypt dependency is no longer necessary, so hopefully that makes the problem go away? #447574
There was a problem hiding this comment.
With that change, the x86_64-linux build of pkgsLLVM.llvmPackages.compiler-rt using clangNoCompilerRtWithLibc errors with this:
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Failed
-- Looking for __atomic_fetch_add_4 in atomic
-- Looking for __atomic_fetch_add_4 in atomic - found
-- Performing Test HAVE_CXX_ATOMICS_WITH_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITH_LIB - Failed
CMake Error at /nix/store/9r43znl0msv0nrp2sl8h0wjilncrxr4m-llvm-19.1.7-dev/lib/cmake/llvm/CheckAtomic.cmake:56 (message):
Host compiler must support std::atomic!
Call Stack (most recent call first):
lib/scudo/standalone/CMakeLists.txt:4 (include)
-- Configuring incomplete, errors occurred!
Uhh. No idea how to get past this. Or maybe the idea wasn't to convert non-Android to use clangNoCompilerRtWithLibc?
There was a problem hiding this comment.
Is it because there's no libc++? Does android libc++ come with libc?
Seems to me that compared to before this PR
|
That's what I expected. I didn't find a |
|
Are there x86_64, ARM 32-bit (like armv7 or something, honestly I've got no idea what the differences between armv6l, armv7 and armeabi are) and RISC-V Android platforms in Nixpkgs? I'd like to add support for those in the LLVM patch. |
a24e4e7 to
a9deecc
Compare
| overrideCC args.stdenv buildLlvmTools.clangNoCompilerRtWithLibc | ||
| else | ||
| # `libxcrypt` fails to build without compiler-rt | ||
| # See: https://github.com/NixOS/nixpkgs/pull/431477#discussion_r2263654078 |
There was a problem hiding this comment.
Not fully. I'll explain what I think it is in that thread.
|
My notes while trying to rebase this on master: Commit that introduced merge conflict: 791fe23 (drop LLVM 13) I'll mention @LordGrimmauld in case he has any ideas Did not fix it: 3c3c1f5. Not even my fault because the infinite recursion occurs on master. Seems that only
Stack trace |
|
This one is difficult. The reason this breaks is because it uses linuxHeaders -> fakeroot -> libcap -> pam -> systemd-minimal -> a bunch of crap. diff --git a/pkgs/by-name/fa/fakeroot/package.nix b/pkgs/by-name/fa/fakeroot/package.nix
index ae9883af71f1..81ecb3122d49 100644
--- a/pkgs/by-name/fa/fakeroot/package.nix
+++ b/pkgs/by-name/fa/fakeroot/package.nix
@@ -12,7 +12,9 @@
autoreconfHook,
po4a,
}:
-
+let
+ libcap' = libcap.override { usePam = false; };
+in
stdenv.mkDerivation (finalAttrs: {
version = "1.37.1.2";
pname = "fakeroot";
@@ -51,7 +53,7 @@ stdenv.mkDerivation (finalAttrs: {
autoreconfHook
po4a
];
- buildInputs = lib.optional stdenv.hostPlatform.isLinux libcap;
+ buildInputs = lib.optional stdenv.hostPlatform.isLinux libcap';
postUnpack = ''
sed -i \I ran into this issue a couple times before. I believe fakeroot does not need the pam capabilities to do its thing. This would cost an additional libcap build without pam, but cleanly fix this whole class of issues where |
|
I have also just been pointed to #446259, which would be a similar fix |
|
Why does EDIT: when cross-compiling as checks (IIRC always expected to be platform-specific) should be turned off. |
There is a bit more nuance required here.
Now, if you want an android While on the way to The infinite recursion happens, because |
|
FWIW rebasing this on top of master and cherry-picking #446259 leads to |
|
#446259 has been merged to staging. Do we want to wait for it to hit master or re-target this PR? |
CRT isn't built with compiler-rt on Android.
|
Rebased on staging. I'm getting the same error ( $ nix build --file default.nix pkgsCross.aarch64-android.llvmPackages.compiler-rt-libc
$ tree result/
result/
└── lib
└── linux
├── libclang_rt.builtins-aarch64-android.a
└── libclang_rt.profile-aarch64-android.a
$ nix build --file default.nix pkgsCross.aarch64-android.llvmPackages.compiler-rt-no-libc
$ tree result/
result/
└── lib
├── libgcc.a -> linux/libclang_rt.builtins-aarch64-android.a
└── linux
└── libclang_rt.builtins-aarch64-android.a |
a9deecc to
462b732
Compare
|
FWIW #446259 has since landed on master |
|
It seems the |
Fixes
compiler-rtbuilds for Android.Should not affect any non-Android builds.
Could someone test these changes with
aarch64-android-prebuilt?Fixes: #380604
Fixes: #269077
@NixOS/llvm
Things done
pkgsCross.aarch64-android.llvmPackages.compiler-rt-{no-libc,libc})passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.