Commit d0b08ab5 authored by Ali Abrar's avatar Ali Abrar Committed by John Ericson
Browse files

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.
parent 0c6d2eee
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -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"