Commit graph

6 commits

Author SHA1 Message Date
Ivan Lozano
6cd99e6ab4 Add Rust fuzzing support.
Add a rust_fuzz module which builds a libfuzzer binary that enabes
asan+sancov. This relies on the libfuzzer-sys crate.

Bug: 147140513
Test: Local rust_fuzz example builds, fuzzes with asan+sancov.
Change-Id: I57db3b8d25869791824ccfab768d13b0bb9d42fa
2021-01-25 11:11:10 -05:00
Ivan Lozano
6d45a9863a rust: Pass lld flags from cc to rust linker args.
Rust is not passing the sysroot flag to Clang when invoking it as the
linker. This means files from the host may leak in, and host targets
may fail if sysroot files are not available from the host.

This patch prepends the lld flags from cc into rust linkargs. This
pulls in the sysroots flag, and also ensures that we remain in sync
with linkage flags used in cc.

The '-Wl,--no-undefined-version' from cc is overridden to avoid
missing version assignment errors for rust's generated alloc
functions.

Bug: 167690054
Test: cd external/rust; mma
Test: strace -f -e %file <host libstd.dylib.so build command> pulls
      from correct sysroots.
Change-Id: Ic40597f546f3b112012155614056afed487c6ca1
2020-09-09 14:20:00 -04:00
Thiébaud Weksteen
682c9d7b25 Rename ccConfig to cc_config
Follow up from aosp/1413495 to set a consistent name throughout the
package.

Test: m
Change-Id: Idafcd973e7d874cd97599ac419c2972a8a5cd0b4
2020-08-31 10:06:16 +02:00
Jeff Vander Stoep
6e97a7b4a1 rust: Use host linker when building for Mac host.
This behavior is non-hermetic, but matches the behavior of the C++
support. On Linux, using lld works, but on OSX, this fails because lld
does not support Apple's new .tbd files.

Bug: 155302034
Test: On both Linux and Mac hosts:
    cd external/rust; mma

Change-Id: I0ad489113d720bdb9c3b7a67cce9d1e72266f428
2020-07-15 22:02:18 +02:00
Ivan Lozano
f1c8433b40 Add AArch64 device Rust toolchain.
Bug: 141207434
Test: build example rust device module.
Change-Id: I0932a614942bf4a4d4b6c153fcc4fc79c7f202bd
2019-09-24 10:35:28 -07:00
Ivan Lozano
ffee334706 Add Rust support to Soong.
Adds support to Soong for building rust modules. This currently only
supports x86_64 device and x86 linux host targets. The functionality
is sufficient to build crosvm.

Bug: 136189233
Test: Test module builds.
Test: crosvm builds.
Change-Id: I6ea04615834a6d673578ab10ea1a2eb04259fe09
2019-08-28 14:11:07 -07:00