Commit Graph

20 Commits

Author SHA1 Message Date
Li-Yu Yu 69874890b8
cras: Switch to in-tree build script (#10786)
We have CI in-tree to check oss-fuzz builds.
Making the build script also in-tree makes it easier to make atomic
build system changes
2023-08-03 11:46:10 +01:00
Li-Yu Yu 9e013363a8
cras: Pass flags correctly and remove hack for /proc/self/cwd (#10567) 2023-06-21 12:08:01 +01:00
Li-Yu Yu ad4f54ec77
cras: Build Rust code from ${SRC}/adhd (#10079)
We have a unified Cargo workspace now, so we don't have to build inside
the rust specific directory
2023-04-25 19:50:42 -04:00
Li-Yu Yu 429f1cf2bc
cras: Build from top level directory (#9649)
Co-authored-by: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>
2023-02-10 20:20:51 +00:00
Li-Yu Yu 7f78b29166
cras: Use --config=fuzzer to set extra flags (#9620)
For https://crrev.com/c/4218434.

Also fix Rust build to silence warning.
2023-02-07 04:22:11 -08:00
Li-Yu Yu 17b41a687a
cras: Build fuzzers with bazel (#9338)
This change corresponds to https://crrev.com/c/4127648.
Which will allow us to migrate away from autotools.
2023-01-30 10:09:18 -05:00
Li-Yu Yu e5e1b3db9c
cras: Use --enable-fuzzer to pass -DHAVE_FUZZER=1 (#9308)
https://crrev.com/c/4123919 caused -Werror,-Wmacro-redefined, due to
./configure passing -DHAVE_FUZZER=0 when not configured with
--enable-fuzzer.

To fix that:
1. Use ./configure --enable-fuzzer instead of -DHAVE_FUZZER to avoid
multiple definitions of the macro.
2. The default make rule would try to build the fuzzer itself. So
instead we selectively build just the cras binary, which is enough to
produce libcrasserver.a and libcras_rust.a.
3. The build dependency of cras_dbus_bindings.h in the Makefile is not
properly specified, so we build it manually first.

Fixes https://crbug.com/oss-fuzz/54641.
2022-12-29 04:09:04 -08:00
b92paul 06efe97ba0
[MSAN] Enable memory sanitizer build (#8094)
* CRAS: Use CARGO_BUILD_TARGET="x86_64-unknown-linux-gnu"

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 https://github.com/google/oss-fuzz/issues/3469.

* CRAS: Add new member to auto_ccs

Co-authored-by: paulhsia <paulhsia@google.com>
2022-07-28 12:18:18 +01:00
b92paul d876e1aead
cras: Support -DHAVE_FUZZER (#8088)
To fix https://crbug.com/oss-fuzz/49371,
passing HAVE_FUZZER flag during library build stage.

And by pass DBus usage in https://crrev.com/c/3787999.

BUG=oss-fuzz:49371

Co-authored-by: paulhsia <paulhsia@google.com>
2022-07-27 14:29:57 +01:00
b92paul 274904fdc4
cras: Change to out-of-tree build (#8069)
When running fuzzers with local source tree,

```
python3 infra/helper.py build_fuzzers --sanitizer address cras
<source_tree>
```

will generate lots of root permission artifacts to local source tree.

Change to out-of-tree build, then

```
python3 infra/helper.py build_fuzzers --clean --sanitizer address cras
<source_tree>
```

could always start from a clean build.

Co-authored-by: paulhsia <paulhsia@google.com>
2022-07-24 17:37:07 -04:00
Michelle Wang b3f34b0ba8
Cras fuzz (#8047)
CRAS: Build cras_fl_media_fuzzer

Modify cras/build.sh to compile cras_fl_media_fuzzer.
2022-07-21 08:57:45 -04:00
Li-Yu Yu c462cad1be
cras: Disable featured in configure (#7456)
featured [1] is a ChromeOS specific daemon that's not available in gcr.io/oss-fuzz-base/base-builder-rust
Disable it to fix the build [2].

[1] https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/featured/
[2] https://crbug.com/oss-fuzz/45744
2022-03-28 18:54:10 +00:00
b92paul 1c145deedc
cras: Add rust source soft links for coverage build (#5670)
Fix build failures:
```
error: /out/src/rate_estimator.rs: No such file or directory
warning: The file '/src/rate_estimator.rs' isn't covered.
error: /out/src/rate_estimator_bindings.rs: No such file or directory
warning: The file '/src/rate_estimator_bindings.rs' isn't covered.
```

Bug: crbug/oss-fuzz/31910
Test: {build_fuzzer, coverage} commands in infra/helper.py for cras
2021-04-26 17:56:24 +01:00
b92paul 6ffa47eb77
[CRAS] Fix build error and build new fuzzer (#4306)
* [CRAS] Fix build error and build new fuzzer

- Fix build error by installing 1.8.x gtest and using `make install` to
  install gtest pc file for pkg-config
- Build and add new fuzzer `cras_hfp_slc`

BUG=oss-fuzz:24744

* fix the copyright

* fix the copyright

* Update Dockerfile

Co-authored-by: Max Moroz <mmoroz@chromium.org>
2020-08-12 13:42:51 -07:00
Fletcher Woodruff 6869eb232e [cras] fix build (#3055)
We now use some rust code in CRAS, fix the fuzzer build so that code is
compiled as well.
2019-11-22 13:17:37 -08:00
jonathanmetzman 3049c50d48
Migrate projects using -lFuzzingEngine to $LIB_FUZZING_ENGINE (#2325)
Migrate from -lFuzzingEngine to $LIB_FUZZING_ENGINE where possible and not causing breakage
2019-05-01 11:09:55 -04:00
Abhishek Arya 92907b084b
Update build.sh 2018-07-02 21:06:10 -07:00
Dylan Reid a9f74650ff [cras] Update configure option (#1060)
The configure options was changed to lower case. Fix the build script to
match the new option.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
2018-01-09 11:33:42 -08:00
Dylan Reid 65bc1bbd01 [cras] Add an rclient corpus (#881)
Pull the corpus that exists in the cras repository and use it.
This corpus was generated by dumping incoming messages while going
through audio use cases on a chromebook.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
2017-10-10 07:58:50 -07:00
Dylan Reid a86b333d8e Add cras fuzzer (#880)
cras is the audio server that runs on ChromeOS.

The first cras fuzzer tests the client's message interface.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
2017-10-09 16:17:21 -07:00