]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Drop -flto from non-cross-language-lto C++ demo builds
authorMatt Corallo <git@bluematt.me>
Tue, 6 Jul 2021 22:07:42 +0000 (22:07 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 9 Jul 2021 02:24:39 +0000 (02:24 +0000)
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)

genbindings.sh

index 76a1f286d4b9919b827fdc57cb2ef742ed909298..de5379c2716fd217079b7c649b7d9953dd30fa98 100755 (executable)
@@ -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:"