File tree 3 files changed +15
-1
lines changed
3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 48
48
sed -i ' s/typedef LDKnative.*Import.*LDKnative.*;//g' include/lightning.h
49
49
fi
50
50
51
+ # stdlib.h doesn't exist in clang's wasm sysroot, and cbindgen
52
+ # doesn't actually use it anyway, so drop the import.
53
+ sed -i ' s/#include <stdlib.h>//g' include/lightning.h
54
+
51
55
# Finally, sanity-check the generated C and C++ bindings with demo apps:
52
56
53
57
CFLAGS=" -Wall -Wno-nullability-completeness -pthread"
171
175
echo " WARNING: Can't use address sanitizer on non-Linux, non-OSX non-x86 platforms"
172
176
fi
173
177
178
+ cargo rustc -v --target=wasm32-wasi -- -C embed-bitcode=yes || echo " WARNING: Failed to generate WASM LLVM-bitcode-embedded library"
179
+ CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release --target=wasm32-wasi -- -C opt-level=s -C linker-plugin-lto -C lto || echo " WARNING: Failed to generate WASM LLVM-bitcode-embedded optimized library"
180
+
174
181
# Now build with LTO on on both C++ and rust, but without cross-language LTO:
175
182
CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release -- -C lto
176
183
clang++ $CFLAGS -std=c++11 -flto -O2 demo.cpp target/release/libldk.a -ldl
Original file line number Diff line number Diff line change @@ -23,6 +23,13 @@ lightning = { version = "0.0.12", path = "../lightning" }
23
23
# Rust-Secp256k1 PR 279. Should be dropped once merged.
24
24
secp256k1 = { git = ' https://github.com/TheBlueMatt/rust-secp256k1' , rev = ' 15a0d4195a20355f6b1e8f54c84eba56abc15cbd' }
25
25
26
+ # Always force panic=abort, further options are set in the genbindings.sh build script
27
+ [profile .dev ]
28
+ panic = " abort"
29
+
30
+ [profile .release ]
31
+ panic = " abort"
32
+
26
33
# We eventually want to join the root workspace, but for now, the bindings generation is
27
34
# a bit brittle and we don't want to hold up other developers from making changes just
28
35
# because they break the bindings
Original file line number Diff line number Diff line change 7
7
#include <stdarg.h>
8
8
#include <stdbool.h>
9
9
#include <stdint.h>
10
- #include <stdlib.h>
10
+
11
11
12
12
/**
13
13
* An error when accessing the chain via [`Access`].
You can’t perform that action at this time.
0 commit comments