Describe the bug
Using -lc++ with clang++ seems to be broken with llvmPackages_15.clang and llvmPackages_15.libcxxClang. It fails with ld: 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. The main.cpp contains just an empty main() and I am using this flake's devShell:
{
description = "Test";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }: let
lib = nixpkgs.lib;
pkgs = nixpkgs.legacyPackages.x86_64-linux;
llvmPkgs = pkgs.llvmPackages_15;
in {
devShells.x86_64-linux.default = pkgs.mkShell {
packages = [
llvmPkgs.clang
llvmPkgs.libcxx
llvmPkgs.libcxxabi
];
};
};
}
The same also occurs when using a shell with only llvmPkgs.libcxxClang and when trying to use libcxx inside a nix build.
I am pretty sure that this is caused by lib/libc++.so in llvmPackages_15.libcxx containing INPUT(libc++.so.1 -l) instead of INPUT(libc++.so.1 -lc++abi) (which it does for llvmPackages_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)
Describe the bug
Using
-lc++withclang++seems to be broken withllvmPackages_15.clangandllvmPackages_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.cppyields-/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: cannot find l: No such file or directory. Themain.cppcontains just an emptymain()and I am using this flake's devShell:The same also occurs when using a shell with only
llvmPkgs.libcxxClangand when trying to uselibcxxinside a nix build.I am pretty sure that this is caused by
lib/libc++.soinllvmPackages_15.libcxxcontainingINPUT(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)