Nixpkgs Stdenv | 230 Members | |
| 75 Servers |
| Sender | Message | Time |
|---|---|---|
| 24 Nov 2024 | ||
| no context, I'm just wondering if this is our first unexpected consequence of the patch :) | 11:45:08 | |
| I don’t understand how that can happen unless it is ending up as a link argument somehow and this is a problem. | 11:45:39 | |
| it was during an autoconf thing I think. I forget already | 11:47:30 | |
| it's probably the package being silly | 11:47:48 | |
| What is the minimal rebuild way of observing this issue? Also, are there logs somewhere? | 11:49:36 | |
| dug it up https://gist.github.com/emilazy/5453176c2e317b5d104b83bdefc910ae | 11:52:57 | |
nix build github:NixOS/nixpkgs/staging#irods reproduces | 11:54:09 | |
| but of course has a lot of rebuilds | 11:54:13 | |
it's nanodbc.override { stdenv = llvmPackages_13.libcxxStdenv; } I guess | 11:57:02 | |
In reply to @emilazy:matrix.org Judging from the log, it's being passed to the linker, and the linker is rejecting it because of -Werror + unused commandline argument. I think in addition to https://github.com/NixOS/nixpkgs/pull/356189, maybe we should have cc-cflags-compile, which just sends flags to the compiler invocation and not the linker? | 14:47:18 | |
In reply to @emilazy:matrix.org* Judging from the log, it's being passed to the linker, and the linker (link driver, i.e. clang) is rejecting it because of -Werror + unused commandline argument. I think in addition to https://github.com/NixOS/nixpkgs/pull/356189, maybe we should have cc-cflags-compile, which just sends flags to the compiler invocation and not the linker? | 14:48:05 | |
| Otherwise, -Wno-error=no-unused-command-line-argument or --start-no-unused-arguments with --end-no-unused-arguments, but this was only introduced in clang 14: 50ec1306d060e46e0d53c9f5d8a052e1b0d10d3b | 14:50:10 | |
it seems like a clang warning to me. clang hello.o -nostdlibinc generates a warning in unwrapped clang-13 and in the system clang on ubuntu (clang-14). seems like the package is just broken or expects to use a later clang | 15:18:44 | |
Yes, when you do clang hello.o this is a link driver invocation (clang invokes the linker under the hood). The problem is then that the compiler is not being invoked; and it's the compiler which would consume the nostdlibinc flag. So the flag remains unused. | 15:20:48 | |
| The problem is that we put nostdlibinc into the cc-cflags, and these flags go to both the linker and the compiler, with no way in nix currently to say that a flag should only go to the compiler invocation only. | 15:21:23 | |
| I see -- clang should consume unused compiler args if it ends up being a link only step, and it seems to on clang-19, but for whatever reason it is not for clang-13 / clang-14. | 15:39:37 | |
| Are you sure it's a compiler version difference and not a patched/unpatched difference? https://github.com/NixOS/nixpkgs/pull/356162/files#diff-7e3eb59be96c7378cf6880e19a4a800591680455a262eb5a5a083917ea67f8edL10 | 15:45:26 | |
| The arg is claimed there. | 15:45:47 | |
| I just tried with clang 13 on nixos-unstable and don't see the warning behaviour (in wrapped clang). | 15:47:20 | |
| Not sure I understand why wrapping would make the warning go away | 15:47:36 | |
| I'm on staging | 15:47:40 | |
| (happened to have both built) | 15:48:16 | |
https://github.com/llvm/llvm-project/blob/aafe934c0c0c1d274099228e7e47669770235284/clang/lib/Driver/Driver.cpp#L4131-L4137 should claim compile options for link stage. I am guessing that -nostdlibinc wasn't added to the correct group to get claimed until some change after clang-14 was released. | 15:53:03 | |
| Good guess: https://github.com/llvm/llvm-project/commit/5b77e752dcd073846b89559d6c0e1a7699e58615 | 15:54:17 | |
| I have an open PR that modifies that code, so was looking at it recently. https://github.com/llvm/llvm-project/pull/116476 | 15:55:00 | |
| maybe we can backport that | 19:22:19 | |
| patch applies to clang [14-16] will need to be adjusted for 12 & 13 due to failing to patch hunk 2 file 1 | 21:45:55 | |
In reply to @emilazy:matrix.orgbackported with: https://github.com/NixOS/nixpkgs/pull/358836 currently building irods with patch. will mark as ready once completed. | 22:40:59 | |
| sometimes it feels like we're backporting half the commits in LLVM to older versions | 22:43:03 | |
In reply to @emilazy:matrix.orgWell now it should be easier with the common stuff. Getting patches works nicely. | 22:45:23 | |