Skip to content

llvmPackages_15: Building with clang++ using libcxx/-stdlib=libc++ fails #214524

@LogicalOverflow

Description

@LogicalOverflow

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: llvm/clangIssues related to llvmPackages, clangStdenv and related
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions