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
We must pass pointer of pointer to correctly cash snapshotInfo and
register provider only once.
Bug: 271215084
Test: build
Change-Id: Ia7b43c7b97a8fcabd3b4d6ac8b990c622b6ceb6e
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
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
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
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
Armv9 with mandatory PAC and BTI extensions.
Stack protector is disabled as it is irrelevant with PAC.
Bug: 263283855
Test: NFC
Change-Id: I2f298f21dade12824597e0a6920772a2bfc63afb
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
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
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
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
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
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
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
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
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