mirror of https://github.com/google/oss-fuzz.git
Build Wasm modules (#5830)
This commit is contained in:
parent
693dd5037f
commit
4325d5b3d8
|
@ -29,7 +29,11 @@ RUN curl --location https://github.com/protocolbuffers/protobuf/releases/downloa
|
|||
&& chmod --recursive a+rwx ${protobuf_dir} \
|
||||
&& protoc --version
|
||||
|
||||
# Install WebAssembly target for Rust.
|
||||
RUN rustup target add wasm32-unknown-unknown
|
||||
|
||||
RUN git clone --depth 1 https://github.com/project-oak/oak oak
|
||||
|
||||
WORKDIR oak
|
||||
COPY build.sh $SRC/
|
||||
COPY rustc.py $SRC/
|
||||
|
|
|
@ -24,7 +24,16 @@ then
|
|||
export RUSTC="$SRC/rustc.py"
|
||||
fi
|
||||
|
||||
cargo fuzz build -O
|
||||
cargo fuzz build --release
|
||||
|
||||
# Clear RUSTFLAGS, and build the fuzzable example. The Wasm module is stored in `/out/bin`.
|
||||
# Keep this in sync with `https://github.com/project-oak/oak/blob/main/oak_functions/loader/fuzz/fuzz_targets/wasm_invoke.rs`.
|
||||
export RUSTFLAGS=""
|
||||
cargo -Zunstable-options build \
|
||||
--target=wasm32-unknown-unknown \
|
||||
--target-dir=target/wasm32-unknown-unknown/wasm \
|
||||
--out-dir="$OUT/bin" \
|
||||
--manifest-path=../examples/fuzzable/module/Cargo.toml
|
||||
|
||||
FUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release
|
||||
for f in fuzz/fuzz_targets/*.rs
|
||||
|
|
Loading…
Reference in New Issue