Skip to content

Commit

Permalink
Merge: postgresql_jit.pkgs.postgis: fix build on darwin (#342369)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ma27 authored Sep 21, 2024
2 parents 9c15bbb + cd85a62 commit 2795949
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkgs/servers/sql/postgresql/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let
pname = "postgresql";

stdenv' =
if jitSupport then
if jitSupport && !stdenv.cc.isClang then
overrideCC llvmPackages.stdenv (llvmPackages.stdenv.cc.override {
# LLVM bintools are not used by default, but are needed to make -flto work below.
bintools = llvmPackages.bintools;
Expand Down Expand Up @@ -126,7 +126,6 @@ let
# and allows splitting them cleanly.
env.CFLAGS = "-fdata-sections -ffunction-sections"
+ (if stdenv'.cc.isClang then " -flto" else " -fmerge-constants -Wl,--gc-sections")
+ lib.optionalString (stdenv'.isDarwin && jitSupport) " -fuse-ld=lld"
# Makes cross-compiling work when xml2-config can't be executed on the host.
# Fixed upstream in https://github.com/postgres/postgres/commit/0bc8cebdb889368abdf224aeac8bc197fe4c9ae6
+ lib.optionalString (olderThan "13") " -I${libxml2.dev}/include/libxml2";
Expand Down

0 comments on commit 2795949

Please sign in to comment.