aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquapka2024-07-25 10:20:01 +0200
committerquapka2024-07-25 10:20:01 +0200
commitf3ce8a2f3d2b4a08ccf7c06f063244d372ce9160 (patch)
tree9319a7f457685c6ded634b139ae940e2761b1dae
parentc7300fb4a772b0d2364b0fff20f9676fdb79ac9b (diff)
downloadECTester-f3ce8a2f3d2b4a08ccf7c06f063244d372ce9160.tar.gz
ECTester-f3ce8a2f3d2b4a08ccf7c06f063244d372ce9160.tar.zst
ECTester-f3ce8a2f3d2b4a08ccf7c06f063244d372ce9160.zip
Link Nettle statically
-rw-r--r--flake.nix3
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/Makefile2
2 files changed, 4 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index 7265e2f..4cba1fd 100644
--- a/flake.nix
+++ b/flake.nix
@@ -66,6 +66,9 @@
libtomcrypt = pkgs.libtomcrypt.overrideAttrs (final: prev: {
makefile = "makefile.unix";
});
+ nettle = pkgs.nettle.overrideAttrs (final: prev: {
+ configureFlags = ( prev.configureFlags or [] ) ++ [ "--enable-static" ];
+ });
cryptopp = pkgs.cryptopp.override { enableStatic = true; };
libressl = pkgs.libressl.overrideAttrs (_old: rec {
# devLibPath = pkgs.lib.makeLibraryPath [ pkgs.libressl.dev ];
diff --git a/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/Makefile b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/Makefile
index fa9e3ed..845915c 100644
--- a/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/Makefile
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/Makefile
@@ -172,7 +172,7 @@ ippcp.o: ippcp.c
nettle: nettle_provider.so
nettle_provider.so: nettle.o c_utils.o | lib_timing.so lib_csignals.so
- $(CC) $(LFLAGS) -o $@ -Wl,-rpath,'$$ORIGIN/lib' $^ -L. $(shell pkg-config --libs nettle) -l:lib_timing.so -l:lib_csignals.so $(shell pkg-config --libs hogweed) -lgmp
+ $(CC) $(LFLAGS) -o $@ -Wl,-rpath,'$$ORIGIN/lib' $^ -L. -Wl,-Bstatic $(shell pkg-config --libs nettle) -Wl,-Bdynamic -l:lib_timing.so -l:lib_csignals.so $(shell pkg-config --libs hogweed) -lgmp
nettle.o: nettle.c
$(CC) $(shell pkg-config --cflags nettle) $(shell pkg-config --libs hogweed) -lgmp $(CFLAGS) -c $<