Commit graph

847 commits

Author SHA1 Message Date
Treehugger Robot
d61ea3580d Merge "Set OUT_DIR=out with no src_deps." 2023-04-03 19:01:58 +00:00
Peter Collingbourne
0dcd62e8a0 Set OUT_DIR=out with no src_deps.
Some Rust crates with no src_deps have generated files checked in in an
"out" subdirectory and included via a reference to $OUT_DIR, such as
external/rust/crates/userfaultfd-sys.

Astonishingly, some people must be leaving $OUT_DIR set to the default
value of "out", because with $OUT_DIR set to this value, building these
crates would presumably succeed. For everyone else, the build fails
when building one of these crates because it will attempt to load from
the wrong directory. Presumably these crates should be using src_deps
instead (and once that's fixed, we should probably *unset* $OUT_DIR in
rustc invocations to prevent the same thing from happening again), but
for now, fix the build with non-default OUT_DIR by explicitly setting
OUT_DIR to "out" if there are no src_deps.

Change-Id: I09f99424fc01a1e42e910622c77ab8f7312819bd
2023-04-01 01:34:19 -07:00
Treehugger Robot
553d89a825 Merge "Fix rust snapshotInfo provider bug" 2023-04-01 06:41:25 +00:00
Treehugger Robot
10361f5177 Merge "rust_proto: use protobuf crate version 2.x" 2023-03-31 10:37:24 +00:00
Inseob Kim
cd2b46aae3 Fix rust snapshotInfo provider bug
We must pass pointer of pointer to correctly cash snapshotInfo and
register provider only once.

Bug: 271215084
Test: build
Change-Id: Ia7b43c7b97a8fcabd3b4d6ac8b990c622b6ceb6e
2023-03-31 18:04:12 +09:00
Chris Wailes
fef4a02805 Remove stable feature from allowed features list
This CL removes the `default_alloc_error_handler` feature from the
allowed feature set passed to rustc.  This feature was stabilized in
Rust 1.68.0 and now that that has been deployed we can remove the
feature annotations from our codebase.

Bug: 267698452
Test: m rust
Change-Id: Ifc543ec83d3221cc8bcb6c83658abe09696b51ea
2023-03-29 16:18:04 -07:00
Treehugger Robot
0bdbc1c387 Merge "pass cc shared libs as order-only to rustc" 2023-03-29 18:25:50 +00:00
Sam Delmerico
51d6d1c585 pass cc shared libs as order-only to rustc
The library file for a cc_shared_library dependency is added to the linkFlags of the rustc compilation action, but no explicit dependency was made on it from a Ninja perspective if a TOC was also present. This change adds the explicit dependency on the library file whether or not a TOC is present.

Test: m crosvm
Bug: 275416061
Change-Id: I625b62762d9ba7b4fd2b8362285528e47f728dd4
2023-03-29 14:33:20 +00:00
Vinh Tran
2e7b0fd271 Add tests to verify more use cases of afdo in cc and rust
Test: go test
Bug: 267229065
Change-Id: I4aa9538e92aa27e0f842bdce3725bc82739196cb
2023-03-27 14:01:40 -04:00
Yi Kong
a137aa2e6e Merge "Revert^2 "Update clang version to clang-r487747"" 2023-03-24 13:19:52 +00:00
Jeff Vander Stoep
91c0466094 rust_proto: use protobuf crate version 2.x
Test: build
Bug: 270895633
Change-Id: I04e5e7fe70b8c509cd1b35852b75a0f24a633ce9
2023-03-24 09:32:36 +01:00
Yi Kong
fd07ed2c14 Revert^2 "Update clang version to clang-r487747"
9ede280375

Bug: 264965700
Change-Id: I4154c70c050a825525d5b591fa757104eb78c158
2023-03-23 14:14:31 +00:00
Treehugger Robot
ec68cf48e0 Merge "rustc-1.68.0 Build 9751466" 2023-03-21 17:51:27 +00:00
Spandan Das
0c7ea9582a Merge "Build rust libraries against C ModuleLib API surface." 2023-03-21 17:22:23 +00:00
Spandan Das
604f376dcf Build rust libraries against C ModuleLib API surface.
Previously, rust libs in platform would build against stubs even if the
dependency was part of platform. Port the correct logic from the
recently implemented aosp/2421967

Test: TH

Change-Id: I7f6a0ca24654b4424d2f4cfcef2d15e15b1298fc
2023-03-16 23:17:36 +00:00
Justin Yun
24b246a7a8 Fix the make name of rust snapshots
Rust snapshot must have proper suffix for androidmk to avoid conflict
with the existing modules.

Bug: 230780263
Bug: 235895567
Test: m nothing
Change-Id: I35794196553621cd722c067d7965b2a61aa351bd
2023-03-16 11:05:41 +09:00
Charisee
39f2d443ea rustc-1.68.0 Build 9751466
Bug: 270756468
Test: m rust
Change-Id: Ifa04d7fbbdc8ced9956aa50372df80ed6f481c02
2023-03-15 18:42:31 +00:00
Treehugger Robot
4b68649eb0 Merge "Remove slice_internals from features allow list" 2023-03-08 21:38:01 +00:00
Evgenii Stepanov
80d74920fd Introduce armv9-a arch variant.
Armv9 with mandatory PAC and BTI extensions.
Stack protector is disabled as it is irrelevant with PAC.

Bug: 263283855
Test: NFC
Change-Id: I2f298f21dade12824597e0a6920772a2bfc63afb
2023-03-07 11:18:52 -08:00
Chris Wailes
7d6e843e76 Remove slice_internals from features allow list
Test: m rust
Test: TH
Bug: 267698452
Change-Id: Ida4f4889d036392518639ce976d82ce6f19db1fd
2023-03-06 12:27:47 -08:00
Chris Wailes
5f78840308 Enable LTO for Rust dylibs
Test: m rust
Test: TH
Change-Id: I2257fe9fce1457821a5cf7df644c73f3137a62bb
2023-03-02 16:06:01 -08:00
Treehugger Robot
f58396a4c7 Merge "Update non-user-facing properties to be mutated" 2023-03-01 15:49:17 +00:00
Liz Kammer
884fe9e174 Update non-user-facing properties to be mutated
Test: m nothing
Test: CI
Change-Id: Ibfbb91653fa36277a19555a39a5df8da27a7a765
2023-02-28 14:29:13 -05:00
Chris Wailes
6d12db423c Disallow the use of new unstable features
This CL adds a set of allowed unstable featuers for Rust code.  The goal
is to get this down to an empty list.

Bug: 267698452
Test: m rust
Change-Id: I09e61bf19594101f064bdf67dc81c3b4d1236266
2023-02-24 16:58:18 -08:00
Chris Wailes
2760e81c82 Merge "rustc-1.67.1 Build 9645761" 2023-02-24 23:12:10 +00:00
Matthew Maurer
65a54a8e3d rust: Set android_vendor and android_product cfg
Add `android_vendor` and `android_product` cfgs, similar to
__ANDROID_VENDOR__ and __ANDROID_PRODUCT__ defines for C++

Bug: 270718001
Test: m nothing with added test
Change-Id: Ibeabe2983d1454e5a2ec0bb2f43e793b8f32a5c2
2023-02-24 19:21:08 +00:00
Chris Wailes
9744521db2 rustc-1.67.1 Build 9645761
Bug: https://issuetracker.google.com/issues/268053615
Test: m rust
Change-Id: Ie4919008285ce72a625676e65555a60160049db8
2023-02-23 11:35:19 -08:00
Dan Albert
30e66dcce5 Don't link bionicDeps for noStdlibs bindgen.
Bug: None
Test: treehugger
Change-Id: I213328f038061099d5c0dad0ef22cfd632ed268d
2023-02-23 19:17:50 +00:00
Chris Wailes
7b3eb24e29 Silence rustdoc warnings from 3rd party Crates
Test: m rustdoc
Change-Id: I25599845b2bec76d92fd325b62132aeac9dd74c4
2023-02-14 16:09:49 -08:00
Ivan Lozano
9ef9cb8b3f rust: Fix coverage in no-std crates
Coverage builds for no_std crates currently fail because
profiler_builtins are part of libstd and therefore do not get included.

When calculating the dependencies for coverage enabled targets, check if
the stdlib is being included, and if it is not then pull the
profiler_builtins sysroot.

Bug: 249551848
Test: CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS='*' make libtinyvec_nostd.rlib-std
Change-Id: I73f89bddcb2d4d9c704cb3962ee39b73888c7f3f
2023-02-14 11:04:21 -05:00
Chris Wailes
7ebba7ebf9 rustc-1.66.1 Build 9591243
Bug: https://issuetracker.google.com/issues/263153841
Test: m rust
Change-Id: I3927163f7df2bacb2096328d0557acf9c9668b77
2023-02-10 12:24:41 -08:00
Yi Kong
aa0833a8fb Merge "Migrate to the new clang lib dir" 2023-02-08 20:29:17 +00:00
Ivan Lozano
e37e1578c1 Merge "Copy Rust fuzzer dependencies to /data." 2023-02-08 13:46:17 +00:00
Yi Kong
bd1888156a Migrate to the new clang lib dir
Test: presubmit
Change-Id: I7ac7eb415a5f5c3d8b6d9298c1b4ccf2839aaea6
2023-02-08 19:54:05 +09:00
Colin Cross
1fecba1f72 Merge "Pass -C panic=abort to rustc linux bionic compilations" 2023-02-08 05:13:18 +00:00
Colin Cross
91c8f259eb Pass -C panic=abort to rustc linux bionic compilations
Pass -C panic=abort to rustc when targeting linux bionic to match
device bionic builds.  Fixes building on master-art-host when a
rust dependency is added to the linux bionic target.

Bug: 268035710
Test: master-art-host linux bionic build
Change-Id: I411a8622002709030dfd207b9decb8846a1ccef3
2023-02-07 09:55:25 -08:00
Chris Wailes
83ed187b2a Revert "rustc-1.66.1 Build 9561314"
Revert submission 2421642-rust-update-prebuilts-1.66.1

Reason for revert: Missing riscv support and out of date base64 crate causing brekages

Reverted changes: /q/submissionid:2421642-rust-update-prebuilts-1.66.1

Change-Id: I6c0d6c3539e766012570e4542f529706fe49928c
2023-02-06 20:36:37 +00:00
Ivan Lozano
0f9963e9e4 Copy Rust fuzzer dependencies to /data.
Fix an issue where rust_fuzz modules were
not correctly packaging and copying their
dependencies.

This is done by extending the CC fuzz packager
to simply handle both Rust and CC modules,
ensuring this doesn't get out of sync again.
Fuzzer related functions are added to the
Linkable interface to facilitate this.

There was a bug where the Make definitions for
Rust fuzzers were not being created as well,
and that is addressed here.

Bug: 249551848
Test: m android_log_fuzzer #check $OUT/data/fuzz/arm64/libs
Change-Id: I9b41153e0cf08ab510476b75003c3a3baccc3858
2023-02-06 13:48:23 -05:00
Chris Wailes
b85d7d459b rustc-1.66.1 Build 9561314
Bug: https://issuetracker.google.com/issues/263153841
Test: m rust
Change-Id: If7d96b940269d7be0bafc972ce78b4e14f8be09e
2023-02-03 15:52:51 -08:00
Chris Wailes
28f4af7955 Merge "Turn stable-features error into a warning" 2023-02-03 09:36:02 +00:00
Chris Wailes
0152dd9d69 Turn stable-features error into a warning
This CL turns the stable-features lint into a warning.  This is
necessary to complete toolchain updates until we finish enforcing the
"no unstable features policy".

Test: ./test_compiler --prebuilt-path ../../dist/rust-1.66.1.tar.gz
Bug: 267698452
Bug: 263153841
Change-Id: Ib095dea045111ad3d89327a694aa5fa5b7f3128c
2023-02-02 22:05:19 -08:00
Yabin Cui
43d873625f Update bindgen clang version to r475365b
Bug: 253033919
Test: build
Change-Id: I2fd71206a540da7001956f1f6f5aae5d4f925920
2023-02-01 11:17:09 -08:00
Treehugger Robot
f987b38cf9 Merge "Remove unused field 'subAndroidMkOnce'." 2023-01-31 21:52:29 +00:00
Colin Cross
dd60d3aa66 Merge "rustc-1.65.0.p1 Build 9523344" 2023-01-27 18:56:29 +00:00
Colin Cross
3970b9e990 rustc-1.65.0.p1 Build 9523344
Test: m rust
Change-Id: Idb592ac87af21d21caf43b46da21b49ab08c1dbf
2023-01-26 14:54:42 -08:00
Andrew Walbran
c61652ee5a Remove unused field 'subAndroidMkOnce'.
Test: m crosvm vmbase_example_bin
Change-Id: Ica201b8bfa89073bcd7d5e3c1a2822adfe7ad28c
2023-01-26 14:06:35 +00:00
Vinh Tran
ba46e76622 Merge "Delete __ANDROID_APEX_MIN_SDK_VERSION__ from Soong" 2023-01-25 19:09:27 +00:00
Matthew Maurer
993db7a7cc rust: Enable Rust modules in Product
The prohibition on Rust dylibs outside system still stands, but rlibs,
rust_ffi_static, and binaries will all work fine.

Test: m nothing (new soong tests added by this commit)
Test: Created sample product_specific rust_binary, checked out/ location
Bug: 165791368
Change-Id: I6453274064bb24b2019f38e57fc0d09b7c0fcf30
2023-01-24 16:39:52 -08:00
Vinh Tran
f9754735f2 Delete __ANDROID_APEX_MIN_SDK_VERSION__ from Soong
Currently, Bazel sets __ANDROID_APEX_MIN_SDK_VERSION__ based on the cc library's min_sdk_version while Soong does based on apex's min_sdk_version. This causes a diff in the clang commands.

Digging further, we realized __ANDROID_APEX_MIN_SDK_VERSION__ isn't used anywhere so we might just delete it altogether instead of fixing it.

Bug: 265134933
Test: presubmit
Change-Id: I08e89dc8f6ef86669248ea5c47de6603e9d2ffbb
2023-01-20 00:14:48 -05:00
Chris Wailes
60e7bbfd01 rustc-1.65.0 Build 9502310
Bug: https://issuetracker.google.com/issues/250026064
Test: m rust
Change-Id: Iee2719610de8628c32d1b013167aee54495d26c3
2023-01-18 14:47:15 -08:00