- Hide universal binary dependency for rust
Without a darwin_arm64 libstd prebuilt, many rust binaries are not
possible to build as a universal binary anyway. This fixes an
intermediate error with compiling rust FFI targets, where C++ shared
library dependencies for both architectures were combined into the same
linker command.
There is still an outstanding problem with C++ executable targets that
include rust FFI library targets, as the rust FFI library targets
fail to find a proper libstd to build the arm64 side of the universal
executable.
- Use dynamic_lib instead of soname
This matches similar logic in cc/library.go : linkerFlags for including
shared libraries.
Bug: 291830024
Test: m libkmr_cf_ffi (when enabled for darwin)
Change-Id: I1d6b6a7855c6649b93ab6592ea43b17c6e37b3a3
For device build, rust defaults to dylib linkage for rustlibs deps. `dylibs` prop was provided for flexibility.
By removing it, we're enforcing users to either use the default linkage (dylibs for device and rlibs for host) or rlibs prop explicitly. This means no dylibs for host modules. This makes sense because host modules always uses rlib linkage against libstd. The flexibility with dylibs prop opened room for linkage collisions because the dependencies don't link against libstd the same way.
Test: go test
Change-Id: I2fc221daa8a9bb42bdcf6d9823c723a4ddabe7b5
Adds support for host-based Rust fuzzers.
Bug: 282897366
Test: SANITZE_HOST="address" m <host_fuzzer>
Test: run fuzzer
Change-Id: Ibb951f651ef12e763778ebbf12e66769a7113920
- Don't pass `--as-needed` to the linker on Mac OS which is unsupported
there
- Use `--force_load` rather than `--Wl,--whole-archive` on Mac OS
- Scan `rustc`'s linker arguments for `-dylib` and `-dynamiclib`, which
it can use instead of `-shared` on Mac OS:
7bd81ee190/compiler/rustc_codegen_ssa/src/back/linker.rs (L319)
Test: m libhalf serde_derive
Bug: 291164566
Change-Id: Iecd6c2532fa31c9476834f49b109de98cbd2dccf
Register a missing dependency when a dependency returns an invalid
OptionalPath.
Fixes: 294070048
Test: rust_test.go
Change-Id: Ibccfc30d59c706308e99f11e372f7c9b60d9dc74
Add support for CARGO_PKG_VERSION_{MAJOR,MINOR,PATCH}.
Bug: 293602526
Test: m
Test: check build flags for cargo_env_compat module
Change-Id: I6b2796656e3a489cd077c2f42b0bbd04de610ba4
SCS has been supported in Rust since 1.64.0.
This adds SCS as a sanitizer option in Rust.
Bug: 168914033
Test: Built module with sanitize: { scs: true }
Change-Id: Ie54ac4693286878b98704cf052649a267777d764
'-Z sanitizer={hw}address' was not being passed if the fuzzer sanitizer
property was also set. Additionally, trying to use the fuzzer sanitizer
with the address sanitizer incorrectly linked in the hwasan runtime.
Bug: 293466009
Test: SANITIZE_TARGET="fuzzer address" m android_logger_fuzzer
Test: SANITIZE_TARGET="fuzzer hwaddress" m android_logger_fuzzer
Test: ldd <fuzzer_on_device> # ensure correct libraries linked
Test: Check build flags
Change-Id: I6b01c8808af07c642217b642af128ebf934f4bc6
Add a new Bindgen_flag_files property to bindgen modules
that let users specify files that contain extra flags for
bindgen.
Bug: 242243245
Test: presubmit
Change-Id: I21d987c08ac417c04aaa3bfb3b75d563fc662d5b
SCS has been supported in Rust since 1.64.0.
This adds SCS as a sanitizer option in Rust.
Bug: 168914033
Test: Built module with sanitize: { scs: true }
Change-Id: Ibdc116a335339af6d0b0d6dd0bb82c0358fa9087
There is no longer a reason to restrict dylibs on product, make them
available.
Bug: 204303985
Test: m
Change-Id: I315d22307f64d02633940f30ae600c63f16f0e7a
Adds dylib support for vendor and recovery images.
This changes the default linkage for vendor and recovery images to
dylib, which matches the platform default linkage. This also means that
by default, dylib-std variants are used for rlib dependencies.
Bug: 204303985
Test: Soong tests.
Test: m dist vendor-snapshot
Test: RECOVERY_SNAPSHOT_VERSION=current m dist recovery-snapshot
Change-Id: If84074b8615a70c45e7e162abeb853dc8c34d49a
Switch custom_bindgen to use any HostToolProvider
instead of just Rust modules, so any host binary can
be used as the bindgen wrapper.
Bug: 242243245
Test: presubmit
Change-Id: I9ba189b2857b3049dcf14842c178ce5846bab2f7
Use Go's generics for DepSets so they don't require a type-specific
wrapper and reflection.
Test: depsets_test.go
Change-Id: I22ba0b7d680d37d2cd05230b0f560d166c4dd20b
This removes the dylib-std suffix from rlib variants which link against
libstd dynamically. This is by far the common case.
This fixes an issue where 'm <rust_library_rlib>' would fail since Make
would expect the suffix to be included (e.g. 'm libfoo.dylib-std').
Bug: 173312517
Bug: 268086496
Test: m <rust_library_rlib> # without a suffix
Change-Id: I1e5778c57468302a8d672d5eb540047d8bb79314
Technically cargo package names and crate names can be different, but
this is rare and usually only a matter of presentation. Adding basic
support in this fashion lets several crates build without adding
significant machinery.
Bug: 276464273
Test: Build a crate which uses this environment variable
Change-Id: I4f4c8c9e277789de7a63be2457f00090e8c3e973
Rust libfuzzer flags have changed upstream, so update our set of flags.
This fixes the following fuzzer error:
ERROR: The size of coverage PC tables does not match the
number of instrumented PCs. This might be a compiler bug,
please contact the libFuzzer developers.
Bug: 249551848
Test: SANITIZE_TARGET="hwaddress fuzzer" m <fuzz_target>
Test: Test running the fuzzer.
Change-Id: I4f7df1fbe636133c646dfb0bd12757c947995ffe
Rust shared library dependencies are not always bundled in cc_fuzz or
rust_fuzz modules, which can lead to difficult to debug runtime errors
when running these fuzzers. It can also be hard to determine which
dependencies need to be explicitly declared.
This CL makes sure that we bundle the appropriate transitive
dependencies for our fuzzers.
Bug: 249551848
Test: Soong tests
Test: m <fuzzer> # check data/fuzz/<arch>/lib dir contents
Change-Id: I957ca8898079b61e2ff20d750f8c92bf61ac394f
This CL removes the custom_inner_attributes and mixed_integer_ops
features from the allow-list. This also allows us to remove the `-A
stable-features` flag.
Bug: 267698452
Test: m rust
Change-Id: I4770c2e9477337f112732c354bf477a99d11a467
Don't automatically assume that HWASAN or ASAN is enabled if Fuzzer is
enabled.
Bug: 178365482
Test: m bluetooth_stack_with_facade
Test: SANITIZE_TARGET=fuzzer m bluetooth_stack_with_facade
Test: SANITIZE_TARGET=address m bluetooth_stack_with_facade
Test: SANITIZE_TARGET=hwaddress m bluetooth_stack_with_facade
Test: SANITIZE_TARGET="fuzzer address" m bluetooth_stack_with_facade
Test: SANITIZE_TARGET="fuzzer hwaddress" m bluetooth_stack_with_facade
Change-Id: Ief8c0f899837c5889a8035782616025f1b0d54e7
This revert was created by Android Culprit Assistant. The culprit was identified in the following culprit search session (http://go/aca-get/1fa75415-4722-46e3-b61b-7de26844a12d).
Change-Id: I7aabd3ff76c255ca13d594cc0f2f331ed8edc01b
Some device specific prebuilts have a suffix that varies depending on the lunch target.
The resulting install dependency binary has the suffix.
The fuzzer build expects the presubmit binary without the suffix.
This change is to drop the suffix.
Test: make haiku
Change-Id: I8eadd84bf5797659b17bc428dca47b7c3f382aff
Revert submission 2579357-rust-update-prebuilts-1.69.0
Reason for revert: Patch got dropped accidentally that broke a postsubmit test
Reverted changes: /q/submissionid:2579357-rust-update-prebuilts-1.69.0
Change-Id: I3fdd44a9df6c9c775c4f4157ea58df5e4215c47e
Users of the rust_protobuf module can use the 'use_protobuf3'
option to select version 3 of the protobuf crate instead of the
current default of version 2. This unblocks teams that would like
to use protobuf 3 immediately and provides a mechanism for us to
incrementally migrate users of protobuf 2 to protobuf 3.
Test: Adds tests that are executed during every build.
Bug: 270895633
Change-Id: Ib6a18b77cfa7dc3cc604cea05269004b3712bbb6
aosp/2518976 revealed a pre-existing bug, which was that some Rust test
targets did not have all of their shared library dependencies packaged in
the host-unit-tests.zip file. Conveniently enough, these targets did not
actually depend on any of the symbols in the missing shared libraries, so
their DT_NEEDED entries were being removed by the --as-needed flag being
passed to the linker by rustc. This flag was dropped when we switched
to running the link command directly, causing the DT_NEEDED entries to
reappear and leading to runtime failures for these test binaries.
Although we could fix the issue that prevented these (unused) dependencies
from being packaged, there wouldn't be much point in doing so because
we already know that they aren't needed. So for now, let's return to
the status quo and keep passing --as-needed to the linker.
Bug: 278168700
Change-Id: Iae103803983240fa14cdbc2ff0d8ffb4329c6024
Teach rustc to generate object files instead of a linked executable
for binary and shared library crates. This lets us skip the lengthy
Rust compilation phase when only the C++ dependencies of these crates
have changed.
This works using a Python script that replaces the linker invoked by
rustc and converts the linker command line into a rspfile that can be
used during the link phase. The script makes certain assumptions about
how rustc invokes the linker, but since we control the version of Rust
we use, we can update the script if those assumptions ever break. I've
asked the Rust developers about adding an official way to do this so
hopefully we won't need to rely on this hack in the future.
The rustc rule for Kythe has been altered to pass linker=true, somewhat
consistent with the main rustc rule, which now doesn't invoke the actual
linker either. `m xref_rust` still succeeds, but hopefully we can find
someone who knows more about the rest of the Kythe pipeline who can let
us know whether it should still work. Otherwise, let's use this CL as
an opportunity to find out whether the rest of the pipeline is happy
with linker=true, since otherwise we will find it hard to maintain the
Kythe rule in the future.
Change-Id: Ifb9c8689c1bd78c0afcf6fdfd111140d20377536
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
Ignore-AOSP-First: The parent CL is internal
Bug: 267229065
Test: go test
Change-Id: Ia14679285b92f3f14ff269392a61f978c71311b2
Merged-In: Ia14679285b92f3f14ff269392a61f978c71311b2
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
Rust and cc binaries currently use $ORIGIN/lib64:$ORIGIN/../lib64 as the
rpath, and cc tests add $ORIGIN/../../lib64:$ORIGIN/../../../$ORIGIN:$ORIGIN.
This causes problems when a binary is included as test data in
out/host/linux-x86/testcases/<test dir>/<CPU>/<test>, as the
binaries can't find the libraries in out/host/linux-x86/lib64.
Use the same rpath for test and binaries, and for cc and rust.
Bug: 264604160
Test: m USE_HOST_MUSL=true out/host/linux-x86/testcases/acpi_tables_test_src_lib/x86_64/acpi_tables_test_src_lib && out/host/linux-x86/testcases/acpi_tables_test_src_lib/x86_64/acpi_tables_test_src_lib
Test: m USE_HOST_MUSL=true out/host/linux-x86/testcases/gen_sdk_test/x86_64/gen_sdk_test && out/host/linux-x86/testcases/gen_sdk_test/x86_64/toybox
Change-Id: I10fe5dc0de01d1f3c6aea8dbabbf60edab5989c3
Some tests need to add custom tradefed options, but still want to
keep most of the soong autogenerated tradefed xml file.
Expose a test_options: { tradefed_options: [...] } property that
will allow tests to add more options to the autogenerated xml file.
Fixes: 184895128
Test: go test, and verified that the ninja files did not change for aosp_arm64
Change-Id: I50d4ad139322e9e207202f1e1a50f5bbb424aa6f
This reverts commit 8ec823cba1.
Reason for revert: DroidMonitor: Potential culprit for Bug b/262965953 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Change-Id: I236cc36981d8b30527ca286632727f8ca267e969
Some tests need to add custom tradefed options, but still want to
keep most of the soong autogenerated tradefed xml file.
Expose a test_options: { tradefed_options: [...] } property that
will allow tests to add more options to the autogenerated xml file.
Fixes: 184895128
Test: go test, and verified that the ninja files did not change for aosp_arm64
Change-Id: I75f7eb002c8325ce7cdc76e12e76e16195320620
This gives a tiny bit of context in the documentation and allows
people to more easily map the Soong build rules to the Rust
terminology.
Bug: 254469782
Test: atest
Change-Id: Ia8fde42c15919dd03954e9ebf83022d0a569407e
What we call “static” in Soong is called “staticlib” in Rust, see
https://doc.rust-lang.org/reference/linkage.html for details.
Bug: 254469782
Test: atest
Change-Id: I65bba511d3ce8e7e53c6a1de3e77e30568934ce7
The two “rust_ffi_host” modules looked different in my editor because
one was indented with TABs and the other with spaces. They now
consistently use spaces (like the other examples in this file).
Test: atest
Change-Id: I7d0cdba5978da92a1a299bb290472403d4f13462
Musl libclang.so is in musl/lib, not musl/lib64.
Bug: 216192129
Test: m USE_HOST_MUSL=true host-native -k
Change-Id: Id12630d5c0f51d85278f8562b3d988458a56021a
* changes:
Move fuzzer's CollectAllSharedDependencies into GenerateAndroidBuildActions
Support AllowMissingDependencies in prebuilt_apex modules
Support AllowMissingDependencies for apex dependencies
Add AllowMissingDependencies support for prebuilt_etc module with no src property
Make OutputFileForModule work for AllowMissingDependencies
Fix panics when target arch is riscv64
Make rust and cc fuzzers collect their shared libraries once in
GenerateAndroidBuildActions and store it for later use by the
packaging singleton. Also use android.OutputFileForModule to get
the paths. Together this will fix fuzzers that depend on architecture
specific prebuilt shared libraries that are missing a prebuilt for an
architecture when building with AllowMissingDependencies.
Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I154a6f3a767c883e9fe7067003615db73ee78e2d
Fix panics in api_level.go and apex.go when using riscv64 as the target
arch.
Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I85c7685f3d14fa2dc7ffbcdea7f490feca304ef7
Context
- Android-<target>.mk currently does not contain information about partition for its dependent unembedded jni libraries, but only lists the name of the unembedded jni libraries.
- If an android_app module depends on an unembedded jni library that is located in a different partition, make cannot find the library.
Implementation
- Create a string field partition in jniLib struct.
- Add variable "LOCAL_SOONG_JNI_LIBS_PARTITION_<target>", an array of mappings of the name of the jni library to its partition.
Bug: 154162945
Test: m
Change-Id: I6b8e1272ff59dc70e3dd6ce8c6c8e4686dad76df
Add barebones riscv64-linux-android support. This should be enough
to add riscv64-specific entries to Android.bp files, but can't
actually compile anything until there are riscv64 toolchains.
Test: arch_test.go
Change-Id: I0dcc7e797d9352dd38243be908a7f19004ff3db1
musl_linker_script is no longer required as the entry point is now
_start.
Bug: 242601708
Test: m USE_HOST_MUSL=true host-native
Change-Id: I5acfaeb181a2dd39aac72edd94bd2030881d9d27
customBindgenTag is used to describe a particular host tool - don't
propagate apex dependency across it.
Bug: 249849807
Test: Adding rusqlite to apex no longer requires bindgen allowed
Change-Id: Ifcb2a94c577c72558f757bf10e975212558fe790
Multiple modules (e.g. java, cc, python, rust) define the `test_options`
field. Extract the common properties in test_options to share across
different test rules.
Bug: 240928948
Test: `refreshmod` and diff with original module-info.json
Change-Id: I404a7a157b4ccaa53d800ee2217559ff695bd825
Introduce cc_api_library, which reflects imported API from other
inner-tree. This cc_api_library module type will later refer from
the other ninja module which generates stub library from the interface
description.
Tested environment :
* original libc definition has been removed temporarily, to ensure that
imported api stub library is being used from build
* Added new definition of libc as below
cc_api_library {
name: "libc",
arch: {
x86: {
src: "libs/x86/libc.so",
},
x86_64: {
src: "libs/x86_64/libc.so",
},
},
header_libs: [
"libc_headers",
],
export_header_lib_headers: ["libc_headers"],
min_sdk_version: "9",
vendor_available: true,
}
Bug: 236087698
Test: `ALLOW_MISSING_DEPENDENCIES=true m vendorimage` succeeded
Change-Id: I67070b0f3561aa2afd73b6c1c0fdf4255218baac
Generated bindings are intended to be slim translation layers, usually
consisting of nothing more than type signatures and constants.
Generally, they should also be used in exactly one location by the safe
wrapper for these bindings. By preventing them from building as
`dylib`s, we avoid the per-library overhead of these non-reused pieces
of code.
Additionally, default visibility restrict all bindgen modules to their
subpackages. This is being done both:
* to encourage use of a single safe bindings crate
* to avoid diamond dependency graphs with mixed rlib/dylib dependencies
Bug: 166332519
Test: m; Make sample module use dylib bindgen dependency, see build failure.
Change-Id: I8e9d9cb851c2ec99f4ed63e6e18c4ba26b29721c
Rust is now approved for general platform use without project-specific
review.
Bug: 240501326
Test: m
Change-Id: I6fd4c22ba2c6a3a5bac6f91fd087fe5cffe46c01
Revert submission 2124256-AFLpp support in Soong
Reason for revert: It is breaking the build
Reverted Changes:
Ie07ec3368:Adding support for building AFLpp Test: Build AFL ...
I5bd6d1e9b:Adding support for building AFLpp Test: Built AFL ...
Change-Id: Id2eec1060f7532fec46293d0c207be800e6eaa03
Linux bionic doesn't have rust stdlib prebuilts, don't use the prebuilts
when it is configured as the host os.
Bug: 216192129
Test: builds
Change-Id: I03425dee4b2e3659bf90c0a0c808cc286daa4b7f
Building rust code with musl enabled can load proc macro crates built
against musl into rustc, so we have to use a version of rustc also
built against musl.
Bug: 216192129
Test: m USE_HOST_MUSL=true host-native
Change-Id: Icd23b542a4b64a975850a8a4bb4b69183cc6c2c6
Allow listing rust_ffi_shared modules as a jni_libs dependency
in conjunction with platform_api: true. This allows inclusion by
android_app modules.
Bug: 237304791
Test: android_app module builds with a rust_ffi_shared dependency.
Change-Id: I3a28e1baa522ad8f9c2aa86f1d23b19ce9f967e1
The logic is not 100% provably the same since HEAD was quite
confusing at some points, but I did make an effort to preserve
functional equivalence.
In case that effort was not enough, it should be pretty easy to
tweak the logic at HEAD since it's still quite malleable.
Bug: 231370928
Test: Presubmits.
Change-Id: I17b2efbfb5c4d0aedd922caed54ff8d857e578df
> warning: `-Z instrument-coverage` is deprecated; use `-C
instrument-coverage`
Test: above warning is absent when running:
$ m CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS=* rust
Change-Id: I8687c04534db3c8a67f209b93ed13d54c2f86dc8
This is so that we can avoid mutating state in sanitizerMutator, as
would be necessary if we only had a single bit for every sanitizer
together.
Test: Presubmits.
Change-Id: I5576367c12972fbea64342ab123118ec5a2cfeec
Previously we ran mutators in bp2build mode to add dependencies, now we
look up modules by name directly. Remove workarounds to allow bp2build
mode to not fail when adding/handling dependencies.
Test: m bp2build
Change-Id: Ibf6fd905150cac306e5c395902ef28f609f4df2a
By default, rustc will disable color output when it detects that its
stdin isn’t connected to a terminal. However, since we will print the
output to the user’s terminal, it makes sense to override this.
Test: Manually by triggering a compilation error. I ran
* m pdl
* atest --host --no-bazel-mode pdl_inline_tests
* atest pdl_inline_tests
and got useful color output in my terminal in each case.
Change-Id: I8b593d2eb59d13db17a3456e3fb053556fc16f07
Rust test binary depending on native libraries would require them under
lib[64] directory so that the test binary can open them with default
rpath values.
Bug: 204562227
Test: presubmit
Change-Id: I029bb32c4c98fba21bd28e579a9df9f184a7f045
Rust vendor-only modules would have the '.vendor' subname appended to
them, which meant that 'm <vendor_module>' would not work -- instead
you would need to call 'm <vendor_module>.vendor', which leads to some
confusion.
This CL fixes the behavior by using the same SubName logic as the cc
module.
Bug: 205577906
Test: m <vendor_module> # works without .vendor suffix
Change-Id: I6ba18ce1d7281a1f8342ed6014644b48009d78e0
Allow adding rlib-only libraries to rustlibs by having it fallback to
selecting the rlib variant if a dylib variant is requested but not
available.
Bug: 224771894
Test: m nothing
Test: New Soong test
Change-Id: I47b19ec9dbf3da90a2b090aeda04556a0400c7d1
ANDROID_RUST_VERSION is always set to the default Rust version, rather
than than respecting the RUST_PREBUILTS_VERSION setting. This is not the
correct behavior, this CL resolves the issue.
Test: m nothing
Change-Id: I3f8a2fc3590b7313286278b77534bb669cc693d6
The libgcc dependency is only used for _Unwind* symbols, remove
it now that libc_musl.so embeds libunwind.a.
Bug: 215802826
Test: m USE_HOST_MUSL=true host-native
Change-Id: I1ad4c1435fc0090c6df2d50d542d2203dfb94d7b
Adds support for capturing rust_proc_macros as part of the host
snapshot. Proc macros target the host and can be thought of as compiler
plugins. Because of this, they don't have vendor image variants and
can't be easily captured as part of the vendor snapshot. Instead we
capture them as part of the host snapshot.
This adds a rust_prebuilt_proc_macro module type.
Bug: 204304380
Test: m HOST_FAKE_SNAPSHOT_ENABLE=true host-fake-snapshot dist
Test: python3 development/vendor_snapshot/update.py --image=host
--install-dir=vendor/vendor_name/ 31 --local out/dist
Test: Checked Android.bp for rust_prebuilt_proc_macro modules.
Change-Id: I4a8c4d9c41b7ca361b5b97d3f74973918c2a5fe3
Bug: http://b/214396112
The goal is to run this smoke test in presubmit on all platform changes.
Test: build with aosp/
Change-Id: I4abb7f46905bd4160a2d628be2761874df6b1b34
The clang prebuilts now provide a single module with per-architecture
variants instead of a module per architecture.
Bug: 220019988
Test: m checkbuild
Change-Id: I39e2cf8ae14edf8510276dab38011afaef85822c
Merged-In: I39e2cf8ae14edf8510276dab38011afaef85822c
This lets no_std crates depend on system crates like core and alloc.
Bug: 223152204
Test: built pVM firmware skeleton with rust_ffi_static rule
Change-Id: I0f9b0ab3f5e3289fb8ce66f28d779bcf62a7181f
Add a build variable, CLANG_COVERAGE_CONTINUOUS_MODE, instead of
selecting based on paths.
Test: CLANG_COVERAGE_CONTINUOUS_MODE=true m and verify continuous mode works
Change-Id: I731172fc1f00e1cabff8efcf8b99f9a48210b446
We haven't updated this in a while, and we have new team members who
should be able to edit Rust build-related rules.
Test: N/A
Change-Id: Iaf001d0718ca187e5570a1198d06a3ae4db78e4c
Write the list of a test module's data_bins value to the
`LOCAL_TEST_DATA_BINS` Makefile variable defined for each module.
This enables downstream tools to correctly set up the runtime
environment for execution. And currently only sh_test, cc_tests, and
rust_tests has this attribute in Android.bp.
Bug: 215234071
Test: m out/soong/Android-aosp_cf_x86_64_phone.mk
Change-Id: I8d47f5f9b25afdc5975c6b414405badb38dbde4b
SnapshotStaticLibs must include static libs, but it had shared libs.
Bug: 219746113
Test: build vendor snapshot
Change-Id: I0660811bb94446129ae97f52306b065dec73cabd
Currently error messages appear like:
&fs.PathError{Op:"open", Path:"..." Err:0x18}
which make them difficult to parse.
Test: CI
Change-Id: I18da18abc43230d0ea37d166179d07e585077f51
* changes:
Support building rust modules against musl libc
Support genrules as CrtBegin and CrtEnd in rust
Support multiple crtbegin and crtend dependencies
Bug: http://b/199203503
Rust's llvm-project source now includes https://reviews.llvm.org/D97448
and we no longer need this workaround.
Test: m unicode-xid_test_src_lib and verify __llvm_prf_data section is
present.
Change-Id: I0387bd3af8bfc765f3aba3b309bfbc7ef49d565d
Add a rust toolchain for musl libc, use std library built from source,
and add default dependencies on musl libc.
Bug: 216192129
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ic5ff4487db9693aeb08a13405f4d18465eecdc4b
Musl will use a genrule output as a linker script in CrtBegin,
support genrules as Crt* dependencies.
This is equivalent to Ie384089d26459797d0b4b5fef84846507fc508ad
in cc.
Bug: 216192129
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ibc08fdcff7a6bca2a1ec05b781ce929080e211bd
Musl libc with an embedded linker uses multiple crtbegin dependencies,
convert rust's CrtBegin and CrtEnd to lists.
Bug: 190084016
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ie843801e87b1f38ace84502d9e4f938a92ec1fa2
Bug: http://b/194128476
Bug: http://b/210012154
Reverts:
e6840726bd "[coverage] Override -Wframe-larger-than"
71d697c5cb "Enable memory-mapped coverage instrumentation"
Coverage metrics dropped for ~10 of the 40 modules. There are also
regressions in mainline when running tests on older platform builds.
Test: presubmit
Change-Id: I4a2b005d3b54764b762b5422e03b7a9ec8727227
This is necessary to move the mk_payload package from
packages/modules/Virtualization/microdroid to an ARC owned directory.
Bug: 196891323
Test: m -j
Change-Id: Ifa3e509fb4ffa7861e45f69dd4654e8fbe1677ff
The exported rust.MinSdkVersion always returns an empty string. Instead
it should return the Min_sdk_version property like rust.minSdkVersion.
This CL renames minSdkVersion to MinSdkVersion so the exported function
has the correct behavior.
Bug: 211858959
Test: m
Change-Id: I4fecfba711c0d3d7a22f4fdf7684924a9457b464
Merged-In: I4fecfba711c0d3d7a22f4fdf7684924a9457b464
This CL updates the RustDefaultVersion to the new prebuilt version
number and adds an argument to suppress a new linter warning,
non-send-fields-in-send-ty, that is prone to false positives. See
https://github.com/rust-lang/rust-clippy/issues/8045 for more
information.
Test: m rust
Bug: 213921092
Change-Id: Ide568327f0a8994a6a934d14bb67b3139d0d98da