Commit 6a011160 authored by Randy Eckenrode's avatar Randy Eckenrode Committed by Florian Klink
Browse files

clickhose: fix build on aarch64-darwin

parent add1a9c0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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" ];