Thanks to visit codestin.com
Credit goes to github.com

Skip to content
11 changes: 11 additions & 0 deletions tests/run-make/wasm-override-linker/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include ../tools.mk

ifeq ($(TARGET),wasm32-unknown-unknown)
all:
$(RUSTC) foo.rs --crate-type cdylib --target $(TARGET) -C linker=$(CLANG)
else ifeq ($(TARGET),wasm64-unknown-unknown)
all:
$(RUSTC) foo.rs --crate-type cdylib --target $(TARGET) -C linker=$(CLANG)
else
all:
endif
6 changes: 6 additions & 0 deletions tests/run-make/wasm-override-linker/foo.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#![crate_type = "cdylib"]

#[no_mangle]
pub extern "C" fn add(a: i32, b: i32) -> i32 {
a + b
}