From d939692e0209cfb661ff1303459e8a489d87f441 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 24 Sep 2021 22:01:34 +0000 Subject: [PATCH] Drop reallocarray wrapper, enforcing that we don't need it --- genbindings.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/genbindings.sh b/genbindings.sh index d40539c1..7bf369f5 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -91,7 +91,7 @@ echo "Building Java bindings..." COMPILE="$COMMON_COMPILE -mcpu=$LDK_TARGET_CPU -Isrc/main/jni -pthread -ldl -shared -fPIC" [ "$IS_MAC" = "false" ] && COMPILE="$COMPILE -Wl,--no-undefined" [ "$IS_MAC" = "true" ] && COMPILE="$COMPILE -mmacosx-version-min=10.9" -[ "$IS_MAC" = "false" -a "$3" != "false" ] && COMPILE="$COMPILE -Wl,-wrap,calloc -Wl,-wrap,realloc -Wl,-wrap,reallocarray -Wl,-wrap,malloc -Wl,-wrap,free" +[ "$IS_MAC" = "false" -a "$3" != "false" ] && COMPILE="$COMPILE -Wl,-wrap,calloc -Wl,-wrap,realloc -Wl,-wrap,malloc -Wl,-wrap,free" if [ "$3" = "true" ]; then $COMPILE -o liblightningjni_debug$LDK_TARGET_SUFFIX.so -g -fsanitize=address -shared-libasan -rdynamic -I"$1"/lightning-c-bindings/include/ $2 src/main/jni/bindings.c "$1"/lightning-c-bindings/target/$LDK_TARGET/debug/libldk.a -lm else @@ -146,6 +146,11 @@ else echo "$GLIBC_SYMBS" exit 1 fi + REALLOC_ARRAY_SYMBS="$(objdump -T liblightningjni_release$LDK_TARGET_SUFFIX.so | grep reallocarray || echo)" + if [ "$REALLOC_ARRAY_SYMBS" != "" ]; then + echo "Unexpected reallocarray dependency!" + exit 1 + fi fi if [ "$LDK_JAR_TARGET" = "true" ]; then # Copy to JNI native directory for inclusion in JARs -- 2.39.5