Skip to content

Commit 4d4574c

Browse files
committed
fix: Add OpenSSL C libs
1 parent 8c44ee4 commit 4d4574c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

flake.nix

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,25 @@
252252
(pkgs.lib.mkIf pkgs.hostPlatform.isMusl
253253
(let
254254
ghcOptions = [
255+
# Postgresql static is pretty broken in nixpkgs. We can't rely on the
256+
# pkg-config, so we have to add the correct libraries ourselves
255257
"-L${pkgs.postgresql}/lib"
256258
"-optl-Wl,-lpgport"
257259
"-optl-Wl,-lpgcommon"
260+
261+
# Since we aren't using the postgresql pkg-config, it won't
262+
# automatically include OpenSSL
263+
"-L${pkgs.openssl.out}/lib"
264+
265+
# The ordering of -lssl and -lcrypto below is important. Otherwise,
266+
# we'll get:
267+
#
268+
# (.text+0x2c3d): undefined reference to `COMP_get_type'
269+
# (.text+0x2de6): undefined reference to `COMP_get_name'
270+
# (.text+0x4af4): undefined reference to `COMP_CTX_free'
271+
# (.text+0x4bdd): undefined reference to `COMP_CTX_get_method'
272+
"-optl-Wl,-lssl"
273+
"-optl-Wl,-lcrypto"
258274
];
259275
in {
260276
packages.cardano-chain-gen.ghcOptions = ghcOptions;

0 commit comments

Comments
 (0)