+# Now build with LTO on on both C++ and rust, but without cross-language LTO:
+# 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
+
+if [ "$HOST_PLATFORM" != "host: x86_64-apple-darwin" -a "$CLANGPP" != "" ]; then
+ # If we can use cross-language LTO, use it for building C dependencies (i.e. libsecp256k1) as well
+ export CC="$CLANG"
+ export CFLAGS_wasm32_wasi="-target wasm32"
+fi
+