libserdes: link with libc++ libc++abi; fix build

when stdenv.cc.libcxx is non null update the libserdes++ libs from
libstd++ to libc++ libc++abi. This fixes the link error on darwin.
However, on x64 linux using stdenv = llvmPackages_16.libcxxStdenv
on linux the build fails unless -std=c++11 or above is used.

testing; built. the only program that depends on libserdes, kcat, links
to the libserdes and not libserdes++.
This commit is contained in:
annalee 2023-11-28 09:50:01 +00:00
parent 8ae2bf1e60
commit 8bb7a783a3
No known key found for this signature in database

View File

@ -39,6 +39,11 @@ stdenv.mkDerivation rec {
postPatch = ''
patchShebangs configure lds-gen.pl
'' + lib.optionalString (stdenv.cc.libcxx != null) ''
# fix for https://github.com/NixOS/nixpkgs/issues/166205
# llvm12+ isn't adding libc++abi
substituteInPlace src-cpp/Makefile \
--replace "LIBS += -lstdc++" "LIBS += -lc++ -l${stdenv.cc.libcxx.cxxabi.libName}"
'';
# Has a configure script but its not Autoconf so steal some bits from multiple-outputs.sh: