From: Matt Corallo Date: Thu, 26 Nov 2020 00:59:13 +0000 (-0500) Subject: strip binaries in genbindings.sh for better size comparison X-Git-Tag: v0.0.13~38^2~17 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=ecf736a9a500905bb38e860a4a49283534428c0c;p=rust-lightning strip binaries in genbindings.sh for better size comparison --- diff --git a/genbindings.sh b/genbindings.sh index ae2a23578..007f69e99 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -63,7 +63,7 @@ fi # Test a statically-linked C++ version, tracking the resulting binary size and runtime # across debug, LTO, and cross-language LTO builds (using the same compiler each time). clang++ -std=c++11 -Wall -pthread demo.cpp target/debug/libldk.a -ldl -./a.out >/dev/null +strip ./a.out echo " C++ Bin size and runtime w/o optimization:" ls -lha a.out time ./a.out > /dev/null @@ -169,6 +169,7 @@ fi # Now build with LTO on on both C++ and rust, but without cross-language LTO: CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release -- -C lto clang++ -std=c++11 -Wall -flto -O2 -pthread demo.cpp target/release/libldk.a -ldl +strip ./a.out echo "C++ Bin size and runtime with only RL (LTO) optimized:" ls -lha a.out time ./a.out > /dev/null @@ -181,6 +182,7 @@ if [ "$HOST_PLATFORM" != "host: x86_64-apple-darwin" -a "$CLANGPP" != "" ]; then # here). CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release -- -C linker-plugin-lto -C lto -C link-arg=-fuse-ld=lld $CLANGPP -Wall -std=c++11 -flto -fuse-ld=lld -O2 -pthread demo.cpp target/release/libldk.a -ldl + strip ./a.out echo "C++ Bin size and runtime with cross-language LTO:" ls -lha a.out time ./a.out > /dev/null