File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -180,8 +180,14 @@ else
180
180
fi
181
181
182
182
if [ " $( rustc --print target-list | grep wasm32-wasi) " != " " ]; then
183
- cargo rustc -v --target=wasm32-wasi -- -C embed-bitcode=yes
184
- CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release --target=wasm32-wasi -- -C opt-level=s -C linker-plugin-lto -C lto
183
+ # Test to see if clang supports wasm32 as a target (which is needed to build rust-secp256k1)
184
+ echo " int main() {}" > genbindings_wasm_test_file.c
185
+ clang -nostdlib -o /dev/null --target=wasm32-wasi -Wl,--no-entry genbindings_wasm_test_file.c > /dev/null 2>&1 &&
186
+ # And if it does, build a WASM binary without capturing errors
187
+ cargo rustc -v --target=wasm32-wasi -- -C embed-bitcode=yes &&
188
+ CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release --target=wasm32-wasi -- -C opt-level=s -C linker-plugin-lto -C lto ||
189
+ echo " Cannot build WASM lib as clang does not seem to support the wasm32-wasi target"
190
+ rm genbindings_wasm_test_file.c
185
191
fi
186
192
187
193
# Now build with LTO on on both C++ and rust, but without cross-language LTO:
You can’t perform that action at this time.
0 commit comments