Commit Graph

505 Commits

Author SHA1 Message Date
Ivan Lozano b7de10739f rust: Remove libtest from stdlibs list
libtest does not need to be linked for every module type, so remove it
from the stdlibs list. Instead, link it only when building benchmarks or
tests.

Bug: 193782599
Test: cd external/rust/crates/; mma
Test: Rust tests still run correctly.
Merged-In: I536be8754da0987e09340744d9ebf668b8e734d0
Change-Id: I536be8754da0987e09340744d9ebf668b8e734d0
2021-11-02 23:53:23 +00:00
Ivan Lozano ab5f042d9f Disable Rust vendor-specific modules
We need to avoid building Rust vendor-specific modules as there is no
vendor snapshot support for Rust yet.

Bug: 184042776
Test: m <vendor_rust_module> # build error generated
Change-Id: I5afce74bc939b3ceda5cbb9dbe75833d4c3b413e
Merged-In: I51a7fa49096ee5809fd37ce76113ff14841d1b52
2021-06-07 20:02:25 +00:00
Justin Yun 027bfc68db Fix ExcludeFromVendorSnapshot check
ExcludeFromVendorSnapshot() must return true if the module must not
be snapshotted and built from the vendor source tree.
The default value must be false because rust modules are provided by
the system source tree.

Bug: 184042776
Bug: 189372652
Test: m nothing
Change-Id: I267c3a5674bea966d1dd831cda73538ae94cf25f
Merged-In: I267c3a5674bea966d1dd831cda73538ae94cf25f
(cherry picked from commit 9e13187f6b733f689f9552aa3ca8eb329140f427)
2021-05-28 09:04:12 +09:00
Ivan Lozano d7586b6526 Refactor vendor snapshot to use LinkableInterface.
Refactors the vendor snapshot support to use the LinkableInterface
so that support can be extended to Rust. This CL does not add
vendor snapshot support for Rust; that is left for a follow-on CL.

Bug: 184042776
Test: m nothing
Change-Id: Id0c4970ca00053484a52677d182153cbc454c301
2021-05-12 14:01:10 -04:00
Hamzeh Zawawy 0a91eab365 Merge "Add support for packaging rust fuzzers" 2021-05-03 16:43:08 +00:00
Treehugger Robot cbaef6ff0f Merge "Add debug ramdisk variant." 2021-05-02 23:54:40 +00:00
hamzeh c651b5295b Add support for packaging rust fuzzers
Test: make haiku-rust
Change-Id: Idd4d836d11e0ae615b59c6648d49348449589787
2021-05-01 00:55:42 -07:00
Colin Cross e07056af41 Merge "Remove global state from vendor public libraries" 2021-04-29 16:16:42 +00:00
Inseob Kim 08758f08e9 Add debug ramdisk variant.
A module will be installed to /debug_ramdisk if debug_ramdisk is set to
true.

This is a reland of f84e9c05e2, with a fix
that removes /first_stage_ramdisk.

Bug: 184004542
Test: soong test
Change-Id: I739de63cfec6b0fec5a90f7c4741fc4d884d209c
2021-04-29 22:58:17 +09:00
Colin Cross 5423a9c513 Merge "Remove obsolete llndk_library" 2021-04-28 23:25:06 +00:00
Treehugger Robot c0ec1dd962 Merge "Generate rustdoc index." 2021-04-28 15:42:30 +00:00
Dan Albert b433bf7bed Generate rustdoc index.
Test: m rustdoc
Bug: http://b/162741284
Change-Id: I6e649cbae5e3ce38b43baed5d9623851e519b8d0
2021-04-27 17:12:02 -07:00
Colin Cross 5271fea26c Remove global state from vendor public libraries
Remove the global list of vendor public library modules used to rewrite
dependencies from the vendor module to the stubs for system modules,
and replace it with building the stubs directly in the system variant
of the vendor module.

Bug: 178231622
Test: vendor_public_library_test.go
Change-Id: I826e69ffd507d7e85fa3d4d85b5157428c642143
2021-04-27 16:26:00 -07:00
Colin Cross 203b421043 Remove obsolete llndk_library
Remove llndk_library in favor of cc_library with llndk.symbol_file.

Bug: 170784825
Test: m checkbuild
Test: TestLlndkLibrary
Change-Id: I43580976589a7a2a176d7442be53fa043c0c8324
2021-04-26 18:41:00 -07:00
Colin Cross 627280f091 Remove llndk_headers
Replace llndk_headers with cc_library_headers with
llndk.llndk_headers: true.

Bug: 170784825
Test: m checkbuild
Test: compare out/soong/build.ninja
Test: TestLlndkHeaders
Change-Id: I33b411cd4d474318796c2073375176b82dd8c216
2021-04-26 18:40:53 -07:00
Colin Cross 1f3f130e29 Add support for cc_library_headers to replace llndk_headers
Set llndk.llndk_headers: true to allow a cc_library_headers
module to be used by a cc_library module with llndk.symbol_file set.

Bug: 170784825
Test: TestLlndkHeaders
Change-Id: Ib65a4b70717dc9a54ae30f2991485bb1bb9b8409
2021-04-26 18:37:44 -07:00
Matthew Maurer 5fa13b8457 Merge "Enable overflow checks in Rust" 2021-04-26 20:46:21 +00:00
Ivan Lozano e934263d18 Merge "rust: Pass additional Clang C flags from toolchain" 2021-04-23 18:13:10 +00:00
Ivan Lozano 871e34290e rust: Pass additional Clang C flags from toolchain
The set of Clang flags passed to bindgen from the toolchain was
incomplete. In addition to ToolchainClangCflags(), we also need to call
ClangCflags().

Bug: 184081465
Test: m libgrpc_bindgen
Change-Id: I0b62345fee2f55ba18b4a0c4d825f0447c99db06
2021-04-23 10:25:35 -04:00
Inseob Kim aeb6bad073 Revert^3 "Add debug ramdisk variant"
836a8f3d61

Change-Id: If59529238e26a197bc33b10245b88f538f280ed0
2021-04-22 23:14:58 +00:00
Florian Mayer 836a8f3d61 Revert^2 "Add debug ramdisk variant"
78ea2f5eac

Change-Id: I6a6a2ee82e2807045364bab105ec03a1934b411f
2021-04-22 16:38:47 +00:00
Bowgo Tsai 78ea2f5eac Revert "Add debug ramdisk variant"
This reverts commit f84e9c05e2.

Because this breaks the usage of boot-debug.img and
vendor_boot-debug.img

Bug: 185970130
Bug: 185990198
Test: make bootimage_debug
Change-Id: I7886c971982faae1d5bc34688643de8d94d6e201
2021-04-22 09:49:24 +08:00
Treehugger Robot f9b3e22293 Merge "Remove unnecessary `android:"path"` tags in rust" 2021-04-21 15:53:44 +00:00
Liz Kammer eda9398bbf Remove unnecessary `android:"path"` tags in rust
Custom_bindgen is handled by adding a relevant dependency tag.
Flags and Ld_flags are not paths/references to other modules.

Test: go test soong tests
Change-Id: Ic6a69521102318b3b9f29b59560bcefbc9aff8fa
2021-04-20 16:06:02 +00:00
Treehugger Robot 62b9c5bd99 Merge "[rust] Update clang version used for bindgen" 2021-04-19 20:18:39 +00:00
Treehugger Robot 9bd39fe80d Merge "Rustdoc support." 2021-04-19 19:40:18 +00:00
Pirama Arumuga Nainar 655a7d50f4 [rust] Update clang version used for bindgen
Bug: http://b/185528062

Test: presubmit
Change-Id: I0060643b0dec998d1d4f8da2c504c79223995f98
2021-04-19 10:10:21 -07:00
Treehugger Robot aef14db78a Merge changes from topic "tvts-test-host-jni"
* changes:
  Add jni_libs property to java tests
  Add Target to cc.SharedLibraryInfo
2021-04-17 04:35:24 +00:00
Dan Albert 06feee9352 Rustdoc support.
Adds `m rustdoc` which generates documentation for all Rust libraries
to $OUT_DIR/soong/rustdoc.

Follow up work:

* Generate an index page that lists all modules.
* Preserve the artifacts so we can have an always-up-to-date go link.

Test: m rustdoc
Bug: None
Change-Id: Id2d6b9cbab5b02e36b575567563d7cc7606b9401
2021-04-16 13:38:01 -07:00
Thiébaud Weksteen 45c647d4dc Merge changes I59439b77,I7dbaf8be
* changes:
  bloaty: measure stripped Rust binaries
  rust: do not strip static library
2021-04-15 18:46:32 +00:00
Thiébaud Weksteen e4dd14b25f bloaty: measure stripped Rust binaries
Modify bloaty's MeasureSizeForPath to allow a module to provide multiple
paths. This is used to measure both unstripped and stripped
libraries/binaries. Add unit test to ensure correct measurements are
generated for Rust.

Test: m out/soong/binary_sizes.pb.gz
Change-Id: I59439b77dbf1cf5ad71e1c02996a6a90938536b4
2021-04-15 12:02:51 +02:00
Treehugger Robot 638830a5a0 Merge changes from topic "userdebug_plat_sepolicy.cil_Android.bp"
* changes:
  Add debug ramdisk variant
  Add path tests for ramdisk
2021-04-15 05:22:35 +00:00
Inseob Kim f84e9c05e2 Add debug ramdisk variant
A module will be installed to debug_ramdisk (or
debug_ramdisk/first_stage_ramdisk if recovery as boot is true) if
debug_ramdisk is set to true.

Bug: 184004542
Test: soong test
Change-Id: Ic5a4d27407e506fffa462de2149e0785f11b2ac7
2021-04-15 00:56:30 +00:00
Ivan Lozano d466b4a1f5 Merge changes from topic "rust_vendor_support"
* changes:
  Add more Rust vendor image support.
  rust: Use new common image mutator interface.
2021-04-14 19:02:49 +00:00
Ivan Lozano e8dfbdfb59 Merge "cc: Create a common image mutator interface" 2021-04-14 18:53:18 +00:00
Thiébaud Weksteen 4fab05a2ad rust: do not strip static library
Test: m
Change-Id: I7dbaf8be625acae89b0a62ea13d0b250c6542a79
2021-04-14 19:20:07 +02:00
Tri Vo 9e7bfdae31 Merge "rust: Switch rust_fuzz to HWASan" 2021-04-14 16:49:27 +00:00
Jeffrey Vander Stoep d587ec225a Merge changes from topic "rust_benchmark"
* changes:
  Attach rust_benchmark to atest and tradefed.
  Add rust_benchmark module to soong.
2021-04-14 08:02:46 +00:00
Tri Vo 505b0e8991 rust: Switch rust_fuzz to HWASan
Bug: 180495975
Test: example_rust_fuzzer
Change-Id: I26e6f15136ee2d5f4ed1167be5c1c6a14b19421a
2021-04-13 15:58:44 -07:00
Ivan Lozano c08897c1e4 Add more Rust vendor image support.
This adds Rust vendor image support for all module types except
Rust prebuilts.

Bug: 184042776
Test: New Soong tests.
Test: Example cc_library vendor module can depend on rust_ffi_shared.
Test: Example rust_library vendor-only module compiles.

Change-Id: Iaa30ad51fdaedcbf14687da5472581f6af62ff59
2021-04-13 13:17:12 -04:00
Ivan Lozano 699e218324 rust: Use new common image mutator interface.
Refactor rust to use and implement the new common image mutator
interface to handle future image mutations.

Bug: 184042776
Test: m nothing
Change-Id: If6a85e2b8c6a1969d62264eaea6c6b53cae9c039
2021-04-13 13:15:21 -04:00
Ivan Lozano 3a7d000d12 cc: Create a common image mutator interface
As part of adding Vendor support to Rust, refactor the image mutator in
CC to a new common image mutator interface so this logic can be reused
across both CC and Rust.

Bug: 184042776
Test: m nothing
Change-Id: Ia55d5ad840db7cf1a64d6c65ed86487230cb8742
2021-04-13 11:04:44 -04:00
Liz Kammer 9c2108667b rust_fuzzer: add toolchain libraries if non-empty
Test: bp2build
Test: m nothing
Fixes: 185163319
Change-Id: Id8b8e5b21b71f949fa8fa27f8c8cc4aba00c1f7d
2021-04-12 18:52:29 -04:00
Tri Vo eed4716def Merge changes I46e851c8,I2c9eb248
* changes:
  rust: Add HWASan build support
  Export CC HWASan sanitizer type
2021-04-09 22:31:09 +00:00
Ivan Lozano 1285766d3b Merge "rust: Remove stack-depth sancov" 2021-04-09 21:56:51 +00:00
Tri Vo 0a74c3e06e rust: Add HWASan build support
HWASan for static Rust executables is not supported yet.

Bug: 180495975
Test: build local test app with HWASan
Change-Id: I46e851c82a16943586ec3a789f09a58651d036e3
2021-04-09 10:59:23 -07:00
Jeffrey Vander Stoep 3e2d4d419b Merge "Disable clippy::upper-case-acronyms" 2021-04-09 17:48:43 +00:00
Jeffrey Vander Stoep e9fb49b555 Merge "Rust: use 1.51.0 prebuilts" 2021-04-09 17:48:43 +00:00
Ivan Lozano 20fcfdf489 rust: Remove stack-depth sancov
This flag causes a linkage error between rustc and our libclang_rt. We
can remove it for now and look into reintroducing it in the future.

We'd need to define 'thread_local uintptr_t __sancov_lowest_stack' to
support this. See https://reviews.llvm.org/D36839

Bug: 180495975
Test: m <fuzzer>
Change-Id: I95c9392307b5f20a0eda0fc76eb7ef79e27ae4df
2021-04-09 13:22:27 -04:00
Jiyong Park a417f881bd Merge "Shared lib dependencies from rlib are included in APEX" 2021-04-08 23:31:28 +00:00