Somehow this results in a broken pipe error...cause macOS is trash.
if [ "$2" = "true" ]; then
clang++ $LOCAL_CFLAGS -std=c++11 demo.cpp target/debug/libldk.a -ldl
strip ./a.out
if [ "$2" = "true" ]; then
clang++ $LOCAL_CFLAGS -std=c++11 demo.cpp target/debug/libldk.a -ldl
strip ./a.out
echo " C++ Bin size and runtime w/o optimization:"
ls -lha a.out
echo " C++ Bin size and runtime w/o optimization:"
ls -lha a.out
fi
# Then, check with memory sanitizer, if we're on Linux and have rustc nightly
fi
# Then, check with memory sanitizer, if we're on Linux and have rustc nightly
echo "C++ Bin size and runtime with only RL (LTO) optimized:"
ls -lha a.out
echo "C++ Bin size and runtime with only RL (LTO) optimized:"
ls -lha a.out
if [ "$CLANGPP" != "" ]; then
# If we can use cross-language LTO, use it for building C dependencies (i.e. libsecp256k1) as well
if [ "$CLANGPP" != "" ]; then
# If we can use cross-language LTO, use it for building C dependencies (i.e. libsecp256k1) as well
$CLANGPP $LOCAL_CFLAGS -flto -fuse-ld=$LLD -O2 -c demo.cpp -o demo.o
$CLANGPP $LOCAL_CFLAGS -flto -fuse-ld=$LLD -Wl,--lto-O2 -Wl,-O2 -O2 demo.o target/release/libldk.a -ldl
strip ./a.out
$CLANGPP $LOCAL_CFLAGS -flto -fuse-ld=$LLD -O2 -c demo.cpp -o demo.o
$CLANGPP $LOCAL_CFLAGS -flto -fuse-ld=$LLD -Wl,--lto-O2 -Wl,-O2 -O2 demo.o target/release/libldk.a -ldl
strip ./a.out
echo "C++ Bin size and runtime with cross-language LTO:"
ls -lha a.out
echo "C++ Bin size and runtime with cross-language LTO:"
ls -lha a.out