haskell-modules/generic-builder.nix: work around libc++abi issue
Work around clang’s not linking libc++abi when invoked as `clang` or `cc` even when it’s needed to link a C++ library or C++ code. See https://github.com/NixOS/nixpkgs/issues/166205.
This commit is contained in:
@@ -811,5 +811,12 @@ stdenv.mkDerivation ({
|
|||||||
// optionalAttrs (args ? dontStrip) { inherit dontStrip; }
|
// optionalAttrs (args ? dontStrip) { inherit dontStrip; }
|
||||||
// optionalAttrs (postPhases != []) { inherit postPhases; }
|
// optionalAttrs (postPhases != []) { inherit postPhases; }
|
||||||
// optionalAttrs (stdenv.buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
|
// optionalAttrs (stdenv.buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
|
||||||
|
|
||||||
|
# Ensure libc++abi is linked even when clang is invoked as just `clang` or `cc`.
|
||||||
|
# Works around https://github.com/NixOS/nixpkgs/issues/166205.
|
||||||
|
# This can be dropped once a fix has been committed to cc-wrapper.
|
||||||
|
// lib.optionalAttrs (stdenv.cc.isClang && stdenv.cc.libcxx != null) {
|
||||||
|
env.NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
|
||||||
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user