File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 63
63
# Test a statically-linked C++ version, tracking the resulting binary size and runtime
64
64
# across debug, LTO, and cross-language LTO builds (using the same compiler each time).
65
65
clang++ -std=c++11 -Wall -pthread demo.cpp target/debug/libldk.a -ldl
66
- ./a.out > /dev/null
66
+ strip ./a.out
67
67
echo " C++ Bin size and runtime w/o optimization:"
68
68
ls -lha a.out
69
69
time ./a.out > /dev/null
169
169
# Now build with LTO on on both C++ and rust, but without cross-language LTO:
170
170
CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release -- -C lto
171
171
clang++ -std=c++11 -Wall -flto -O2 -pthread demo.cpp target/release/libldk.a -ldl
172
+ strip ./a.out
172
173
echo " C++ Bin size and runtime with only RL (LTO) optimized:"
173
174
ls -lha a.out
174
175
time ./a.out > /dev/null
@@ -181,6 +182,7 @@ if [ "$HOST_PLATFORM" != "host: x86_64-apple-darwin" -a "$CLANGPP" != "" ]; then
181
182
# here).
182
183
CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release -- -C linker-plugin-lto -C lto -C link-arg=-fuse-ld=lld
183
184
$CLANGPP -Wall -std=c++11 -flto -fuse-ld=lld -O2 -pthread demo.cpp target/release/libldk.a -ldl
185
+ strip ./a.out
184
186
echo " C++ Bin size and runtime with cross-language LTO:"
185
187
ls -lha a.out
186
188
time ./a.out > /dev/null
You can’t perform that action at this time.
0 commit comments