From ffeb5553a551e1498570ce579cd9f485ede784b9 Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Mon, 20 Nov 2023 08:48:20 +1300 Subject: [PATCH] wally: build debug or release according to the top-level configuration Wally release builds are significantly faster than debug builds. Plus we pass down our build flags to libsecp, which means release builds have been disabling the asm optimisations for both libraries. Changelog-Changed: Enable optimizations for libwally/libsecp256k1-zkp Signed-off-by: Jon Griffiths --- external/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/external/Makefile b/external/Makefile index 695cb22e2..2767cc068 100644 --- a/external/Makefile +++ b/external/Makefile @@ -79,6 +79,10 @@ $(TARGET_DIR)/libsecp256k1.% $(TARGET_DIR)/libwallycore.%: $(TARGET_DIR)/libwall $(MAKE) -C $(TARGET_DIR)/libwally-core-build DESTDIR=$$(pwd)/$(TARGET_DIR) install-exec # Build libwally-core. +ifeq ($(DEBUGBUILD),1) +WALLY_OPTS=--enable-debug +endif + $(TARGET_DIR)/libwally-core-build/src/libwallycore.% $(TARGET_DIR)/libwally-core-build/src/secp256k1/libsecp256k1.%: $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS) cd external/libwally-core && ./tools/autogen.sh mkdir -p ${TARGET_DIR}/libwally-core-build @@ -89,7 +93,7 @@ $(TARGET_DIR)/libwally-core-build/src/libwallycore.% $(TARGET_DIR)/libwally-core --enable-shared=no \ --prefix=/ \ --libdir=/ \ - --enable-debug \ + $(WALLY_OPTS) \ && $(MAKE) # If we tell Make that the above builds both, it runs it twice in