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)
# 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:"