X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=genbindings.sh;h=007f69e99da17f46d7533c14d05ad717e9f1e041;hb=a54b230e846b563acdb949eef2e6bbf9937b1831;hp=010296584482494c02fa008f23b236c59cd06da8;hpb=343aacc50c73e18ddb1ec52570c5050bdccd09ca;p=rust-lightning diff --git a/genbindings.sh b/genbindings.sh index 01029658..007f69e9 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 @@ -167,8 +167,9 @@ else fi # Now build with LTO on on both C++ and rust, but without cross-language LTO: -cargo rustc -v --release -- -C 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 @@ -179,8 +180,9 @@ if [ "$HOST_PLATFORM" != "host: x86_64-apple-darwin" -a "$CLANGPP" != "" ]; then # or Ubuntu packages). This should work fine on Distros which do more involved # packaging than simply shipping the rustup binaries (eg Debian should Just Work # here). - cargo rustc -v --release -- -C linker-plugin-lto -C lto -C link-arg=-fuse-ld=lld + 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