From 6d1f74cb63f001ff6c01d1c53ab7ce0a9b2c2c7a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 12 Mar 2024 14:17:58 +0000 Subject: [PATCH] Skip the strip step on Windows This partially reverts 5a78aa805d7c550a855d6b589907cab4ab6ca476 --- genbindings.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/genbindings.sh b/genbindings.sh index 24aafa79..3b66af44 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -37,6 +37,9 @@ IS_WIN=false IS_APPLE_CLANG=false [ "$($CC --version | grep "Apple clang version")" != "" ] && IS_APPLE_CLANG=true +STRIP=llvm-strip +[ "$IS_APPLE_CLANG" = "true" ] && STRIP=echo + case "$TARGET_STRING" in "x86_64-pc-linux"*) LDK_TARGET_SUFFIX="_Linux-amd64" @@ -66,6 +69,8 @@ case "$TARGET_STRING" in CS_PLATFORM_NAME="win-x64" LDK_JAR_TARGET=true IS_WIN=true + # llvm-strip currently corrupts DLLs - https://github.com/llvm/llvm-project/issues/63081 + STRIP=echo ;; *) LDK_TARGET_SUFFIX="_${TARGET_STRING}" @@ -171,7 +176,7 @@ if [ "$2" = "c_sharp" ]; then # so we have to build with faketime. faketime -f "2021-01-01 00:00:00" $COMPILE -o bindings.o -c -O3 -I"$1"/lightning-c-bindings/include/ c_sharp/bindings.c faketime -f "2021-01-01 00:00:00" $COMPILE $LINK -o libldkcsharp_release$LDK_TARGET_SUFFIX.so -O3 bindings.o $LDK_LIB -lm - [ "$IS_APPLE_CLANG" != "true" ] && llvm-strip -R .llvmbc -R .llvmcmd libldkcsharp_release$LDK_TARGET_SUFFIX.so + $STRIP -R .llvmbc -R .llvmcmd libldkcsharp_release$LDK_TARGET_SUFFIX.so if [ "$LDK_JAR_TARGET" = "true" ]; then # Copy resulting native binary for inclusion in release nuget zip @@ -225,7 +230,7 @@ elif [ "$2" = "python" ]; then else $COMPILE -o bindings.o -c -flto -O3 -I"$1"/lightning-c-bindings/include/ $2 c_sharp/bindings.c $COMPILE $LINK -o liblightningpython_release$LDK_TARGET_SUFFIX.so -Wl,--version-script=python/libcode.version -flto -O3 -Wl,--lto-O3 -Wl,-O3 -I"$1"/lightning-c-bindings/include/ $2 bindings.o "$1"/lightning-c-bindings/target/$LDK_TARGET/release/libldk.a -lm - [ "$IS_APPLE_CLANG" != "true" ] && llvm-strip -R .llvmbc -R .llvmcmd liblightningpython_release$LDK_TARGET_SUFFIX.so + $STRIP -R .llvmbc -R .llvmcmd liblightningpython_release$LDK_TARGET_SUFFIX.so fi elif [ "$2" = "wasm" ]; then echo "Creating TS bindings..." @@ -341,7 +346,7 @@ else $COMPILE -o bindings.o -c -O3 -I"$1"/lightning-c-bindings/include/ $2 src/main/jni/bindings.c $COMPILE $LINK -o liblightningjni_release$LDK_TARGET_SUFFIX.so -O3 $2 bindings.o $LDK_LIB -lm - [ "$IS_APPLE_CLANG" != "true" ] && llvm-strip -R .llvmbc -R .llvmcmd liblightningjni_release$LDK_TARGET_SUFFIX.so + $STRIP -R .llvmbc -R .llvmcmd liblightningjni_release$LDK_TARGET_SUFFIX.so if [ "$IS_MAC" = "false" -a "$4" = "false" ]; then GLIBC_SYMBS="$(objdump -T liblightningjni_release$LDK_TARGET_SUFFIX.so | grep GLIBC_ | grep -v "GLIBC_2\.\(2\|3\)\(\.\|)\)" | grep -v "GLIBC_2.\(3\.4\|14\|17\|18\|25\|28\|29\|32\|33\|34\|\))" || echo)" -- 2.39.5