-
-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llvmPackages_15: Building with clang++
using libcxx
/-stdlib=libc++
fails
#214524
Comments
clang++
using libcxx
/-lc++
failsclang++
using libcxx
/-stdlib=libc++
fails
Apologies for the delay in getting to this. Minimizing your example ultimately leaves me with: /nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld \
-L/nix/store/a1z9c4pmipjzcimqjzr8hlc3m143acwi-libcxx-15.0.7/lib \
'-lc++' Staring at the output of ^ with
For LLVM 14 this file looks like: $ nix-shell --expr "with (import <nixpkgs> {}); mkShell { libcxx = llvmPackages_14.libcxx; }" --run 'cat $libcxx/lib/libc++.so'
INPUT(libc++.so.1 -lc++abi) But for LLVM 15: $ nix-shell --expr "with (import <nixpkgs> {}); mkShell { libcxx = llvmPackages_15.libcxx; }" --run 'cat $libcxx/lib/libc++.so'
INPUT(libc++.so.1 -l) EDIT: whoops, my bad; just noticed that you already mentioned this in your post, I totally missed it Looking through the Poking around a bit suggests that this is a bug in upstream; And sure enough, looking at upstream reveals that has been patched in LLVM16+ (see here). |
Applying that patch and rebuilding |
Thanks for looking into this! Building from the PR-branch now no longer fails in the way I described and the example works for me again. I have now found a new issue, tho: Importing
For example, this #include<cxxabi.h>
int main() {} I was able to work around this, by adding install -m 644 ../../${pname}/include/__cxxabi_config.h "$dev/include" to the end of the |
(Re @LogicalOverflow) I have a proposed fix for the __cxxabi_config.h issue on llvmPackages_16: #246577 -- currently I'm inserting an additional include search dir for it. I also don't know if this is the best approach or alternatively if that header (and friends?) should be copied into libcxx or similar. |
I ran into the same missing header issue compiling |
this change is missing from 15 6ba1b5b#diff-10d812ae0081a7211c31f286a68130450af9ff7efa30fff60a337022816df01dR264 |
See: - #214524 (comment) - llvm/llvm-project@57c7bb3 - https://reviews.llvm.org/D133566 We can drop this patch in `llvmPackages_16`. Fixes #214524.
running into the same problem compiling some static libraries in nixpkgs using pkgs.llvmPackages_16.libcxxStdenv. Does this warrant its own issue? |
@natto1784 Yes, file a new issue. Please also provide reproducibility bits, including the error message you see, the package expression you're trying to build, and the nixpkgs revision. I'm guessing the issue you're seeing is |
@natto1784 (If my guess is accurate, the problem you're seeing is a variant of #177129). |
@pwaller sorry for bothering you, turns out it wasn't really this issue. Using my limited knowledge on the matter from what I understand, Now, turns out There are two solutions to this
Please correct me if wrong. I might be completely wrong. |
check #216273 |
No bother. I'm sticking my oar in because I'm interested in getting to the bottom of issues exactly like this. It's difficult to fix things it without precise reproduction steps, though. What you're describing there sounds very much like something I tried to address in #246577 (see 6ba1b5b#diff-10d812ae0081a7211c31f286a68130450af9ff7efa30fff60a337022816df01dR257-R264), which is on nixos-unstable. So it sounds like you may have found further issues, but I can't do much to help without a reproducer. In any case what you're describing sounds like a different issue to the original (which was |
Describe the bug
Using
-lc++
withclang++
seems to be broken withllvmPackages_15.clang
andllvmPackages_15.libcxxClang
. It fails withld: cannot find l: No such file or directory
. #213144 also notes this.Steps To Reproduce
Running
clang++ -stdlib=libc++ main.cpp
yields-/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: cannot find l: No such file or directory
. Themain.cpp
contains just an emptymain()
and I am using this flake's devShell:The same also occurs when using a shell with only
llvmPkgs.libcxxClang
and when trying to uselibcxx
inside a nix build.I am pretty sure that this is caused by
lib/libc++.so
inllvmPackages_15.libcxx
containingINPUT(libc++.so.1 -l)
instead ofINPUT(libc++.so.1 -lc++abi)
(which it does forllvmPackages_14.libcxx
). I don't know yet, what the root cause for that is or how to fix that.Notify maintainers
@rrbutani @Ericson2314 @sternenseemann @lovek323 @dtzWill @primeos
(So it shows up in the tracking issue #213033)
The text was updated successfully, but these errors were encountered: