From: Matt Corallo Date: Tue, 6 Jul 2021 22:07:42 +0000 (+0000) Subject: Drop -flto from non-cross-language-lto C++ demo builds X-Git-Tag: v0.0.99.0^2~4 X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=commitdiff_plain;h=6ff713290fcd464915403ebd67160773885e5cc3 Drop -flto from non-cross-language-lto C++ demo builds It appears somehow the LLVM IR is slipping into the Rust library, causing Ubunto link to fail with the following error: /usr/bin/ld: error: LLVM gold plugin has failed to create LTO module: Invalid record clang: error: linker command failed with exit code 1 (use -v to see invocation) --- diff --git a/genbindings.sh b/genbindings.sh index 76a1f28..de5379c 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -344,7 +344,7 @@ fi # Clear stale release build artifacts from previous runs cargo clean --release CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release -- -C lto -clang++ $LOCAL_CFLAGS -std=c++11 -flto -O2 demo.cpp target/release/libldk.a -ldl +clang++ $LOCAL_CFLAGS -std=c++11 -O2 demo.cpp target/release/libldk.a -ldl strip ./a.out echo "C++ Bin size and runtime with only RL (LTO) optimized:"