clickhose: fix build on aarch64-darwin

This commit is contained in:
Randy Eckenrode 2023-11-15 12:49:06 +02:00 committed by Florian Klink
parent add1a9c03d
commit 6a01116033

View File

@ -152,6 +152,10 @@ in mkDerivation rec {
popd
cargoSetupPostPatchHook() { true; }
'' + lib.optionalString stdenv.isDarwin ''
# Make sure Darwin invokes lld.ld64 not lld.
substituteInPlace cmake/tools.cmake \
--replace '--ld-path=''${LLD_PATH}' '-fuse-ld=lld'
'';
cmakeFlags = [
@ -160,6 +164,12 @@ in mkDerivation rec {
"-DENABLE_EMBEDDED_COMPILER=ON"
];
env = lib.optionalAttrs stdenv.isDarwin {
# Silence ``-Wimplicit-const-int-float-conversion` error in MemoryTracker.cpp and
# ``-Wno-unneeded-internal-declaration` TreeOptimizer.cpp.
NIX_CFLAGS_COMPILE = "-Wno-implicit-const-int-float-conversion -Wno-unneeded-internal-declaration";
};
# https://github.com/ClickHouse/ClickHouse/issues/49988
hardeningDisable = [ "fortify" ];