Skip to content

Commit

Permalink
CRAS: Use CARGO_BUILD_TARGET="x86_64-unknown-linux-gnu"
Browse files Browse the repository at this point in the history
In oss-fuzz, to build with MemorySanitizer, Rust part needs to use

```
CARGO_BUILD_TARGET="x86_64-unknown-linux-gnu"
```

to resolve libc `MemorySanitizer: use-of-uninitialized-value` error
according to google#3469.
  • Loading branch information
paulhsia committed Jul 27, 2022
1 parent 6945f4c commit 7e8b7fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion projects/cras/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
cd ${SRC}/adhd/cras
./git_prepare.sh
mkdir -p ${WORK}/build && cd ${WORK}/build
export CARGO_BUILD_TARGET="x86_64-unknown-linux-gnu"
CFLAGS="${CFLAGS} -DHAVE_FUZZER" ${SRC}/adhd/cras/configure --disable-featured
make -j$(nproc)
cp ${WORK}/build/src/server/rust/target/release/libcras_rust.a /usr/local/lib
cp ${WORK}/build/src/server/rust/target/${CARGO_BUILD_TARGET}/release/libcras_rust.a /usr/local/lib

CRAS_FUZZERS="rclient_message cras_hfp_slc cras_fl_media_fuzzer"

Expand Down
6 changes: 5 additions & 1 deletion projects/cras/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ auto_ccs:
- "[email protected]"
- "[email protected]"
- "[email protected]"
builds_per_day: 2
sanitizers:
- address
- memory
- undefined
builds_per_day: 4
main_repo: 'https://chromium.googlesource.com/chromiumos/third_party/adhd'

0 comments on commit 7e8b7fd

Please sign in to comment.