From d0b08ab5de26f0764c5ebbb4d05a1d642ba96f01 Mon Sep 17 00:00:00 2001 From: Ali Abrar Date: Tue, 14 May 2024 17:12:13 -0400 Subject: [PATCH] llvmPackages: libcxx: link stdlib See: https://github.com/NixOS/nixpkgs/pull/246577/files#r1600650238 This code was breaking some thing for me, and I believe it was a mistake. I hink we *do* wanna link libc, since libc++ depends on it, but *don't* want to link an already-existing C++ standard library implementation. `-nostdlib++` without `-nostdlib` therefore seems correct to me. Without this change, we do indeed fail to link OpenBSD. --- pkgs/development/compilers/llvm/common/libcxx/default.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/development/compilers/llvm/common/libcxx/default.nix b/pkgs/development/compilers/llvm/common/libcxx/default.nix index 5b4c2ca56ae1..de2efed85936 100644 --- a/pkgs/development/compilers/llvm/common/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/common/libcxx/default.nix @@ -93,12 +93,6 @@ let cmakeFlags = [ "-DLLVM_ENABLE_RUNTIMES=${lib.concatStringsSep ";" runtimes}" - ] ++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm) [ - # libcxxabi's CMake looks as though it treats -nostdlib++ as implying -nostdlib, - # but that does not appear to be the case for example when building - # pkgsLLVM.libcxxabi (which uses clangNoCompilerRtWithLibc). - "-DCMAKE_EXE_LINKER_FLAGS=-nostdlib" - "-DCMAKE_SHARED_LINKER_FLAGS=-nostdlib" ] ++ lib.optionals stdenv.hostPlatform.isWasm [ "-DCMAKE_C_COMPILER_WORKS=ON" "-DCMAKE_CXX_COMPILER_WORKS=ON"