File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 4848 sed -i ' s/typedef LDKnative.*Import.*LDKnative.*;//g' include/lightning.h
4949fi
5050
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+
5155# Finally, sanity-check the generated C and C++ bindings with demo apps:
5256
5357CFLAGS=" -Wall -Wno-nullability-completeness -pthread"
171175 echo " WARNING: Can't use address sanitizer on non-Linux, non-OSX non-x86 platforms"
172176fi
173177
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+
174181# Now build with LTO on on both C++ and rust, but without cross-language LTO:
175182CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release -- -C lto
176183clang++ $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" }
2323# Rust-Secp256k1 PR 279. Should be dropped once merged.
2424secp256k1 = { git = ' https://github.com/TheBlueMatt/rust-secp256k1' , rev = ' 15a0d4195a20355f6b1e8f54c84eba56abc15cbd' }
2525
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+
2633# We eventually want to join the root workspace, but for now, the bindings generation is
2734# a bit brittle and we don't want to hold up other developers from making changes just
2835# because they break the bindings
Original file line number Diff line number Diff line change 77#include <stdarg.h>
88#include <stdbool.h>
99#include <stdint.h>
10- #include <stdlib.h>
10+
1111
1212/**
1313 * An error when accessing the chain via [`Access`].
You can’t perform that action at this time.
0 commit comments