Commit graph

257 commits

Author SHA1 Message Date
Dmitrii Ishcheikin
8517b8cd87 Revert "rustc-1.78.0 Build 11910258"
Revert submission 3108411-rust-update-prebuilts-1.78.0

Reason for revert: b/345708905

Reverted changes: /q/submissionid:3108411-rust-update-prebuilts-1.78.0

Change-Id: I66b95447ddfcb3d35e5f4305a6d9feb2896fbdf7
2024-06-07 13:06:19 +00:00
Chris Wailes
adb4cb0ca1 rustc-1.78.0 Build 11910258
Bug: https://issuetracker.google.com/issues/333887339
Test: m rust
Change-Id: Ia90ba0d805e2319b3142a16d69914d9ee036810c
2024-05-31 00:10:03 -07:00
Charisee
cd3ac91bdc rustc-1.77.1.p1 Build 11801116
Bug: http://b/331848727
Test: m rust
Change-Id: I68cb748f0de97cc92dbfbfff79d641a64dd51d8e
2024-05-06 21:30:12 +00:00
Ivan Lozano
ec6dc938c9 Merge "rust: Add a default cfg indicating an AOSP build" into main 2024-05-01 17:53:47 +00:00
Ivan Lozano
07fd7e32fd rust: Add a default cfg indicating an AOSP build
This adds a cfg flag `android_platform` which can be used
to indicate there's some conditional compilation need specific to
AOSP.

Test: New flag is emitted on builds
Change-Id: I833a7d68db2dad7ab2d32a5eb51d764f0d66b849
2024-05-01 10:41:35 -04:00
Charisee
92b7f386e0 rustc-1.77.1 Build 11685613
Test: m rust
Change-Id: I381106a54245b5d096dfcb0b3449f7ef440d067c
2024-04-09 19:39:01 +00:00
Cole Faust
8982b1c49e Remove "exported" ninja variables
There was infrastructure to export ninja variables to bazel. Now that
the bazel migration is cancelled, we don't need it anymore.

Bug: 315353489
Test: m nothing
Change-Id: I298cc2ac7ebd004557be3b30d75f7357cab0b7a0
2024-04-09 09:42:37 -07:00
James Farrell
e288cdeda1 rustc-1.76.0 Build 11569723
Bug: https://issuetracker.google.com/issues/327204642
Test: m rust
Change-Id: I3b39a12d1379a9193d348b364897d7df9de16330
2024-03-13 19:47:51 +00:00
Stephen Hines
5f8dae514b Allow clippy::disallowed_names since it can be used for debugging
https://rust-lang.github.io/rust-clippy/master/index.html#/disallowed_names

The current list is extremely short ("foo", "baz", "quux"), and thus
this really just prevents people from temporarily using `foo` to debug
code. In the spirit of improving productivity and reducing frustration,
it's easier to just allow this.

Bug: N/A
Test: TH
Change-Id: I50b65486ed2b58bfd2cf699ee3b43b936d25f2cb
2024-02-29 10:12:19 -08:00
Stephen Hines
41f2ab846a rustc-1.75.0 Build 11471753
Bug: https://issuetracker.google.com/issues/321303117
Test: m rust
Change-Id: I90f0efb4eb3b6fcc41fbe256a9079e0e5647663c
2024-02-20 14:59:31 -08:00
Stephen Hines
f8ffb6d4c2 Allow clippy::unnecessary_fallible_conversions
This lint is part of Rust 1.75.0, but has a lot of problems with FFI
data types that change size between 32-bit and 64-bit targets. This
makes the lint check far less useful, so we are just globally
suppressing it for now.

Bug: http://b/321303117
Test: m
Change-Id: I39531c961a26f533451d73b025caca02e593a269
2024-02-09 15:36:35 -08:00
Satoshi Niwa
b6d818dbf0 Replace goldmont-without-xsaves build with goldmont-without-sha-xsaves
For chromebooks, we need a new build variant whose target arch is
goldmont, but without SHA and XSAVES support (b/314243939#comment21)

Bug: 314243939
Test: Build an image with TARGET_ARCH_VARIANT:=goldmont-without-sha-xsaves
Change-Id: If73660b515b443d5c138ca367fa3d1c6f18485b5
2024-01-24 16:27:56 +09:00
Chris Wailes
c0f587029a rustc-1.74.1 Build 11331546
Bug: https://issuetracker.google.com/issues/310977762
Test: m rust
Change-Id: Ia3a5bcd1c63e09d1fd4e399598d4ab25245b7af4
2024-01-19 01:40:19 -08:00
Satoshi Niwa
c41f21121c Add a new x86(_64) arch variant "goldmont-without-xsaves"
Its target arch is goldmont, but without xsaves support.
This ensures efficient execution on a broad range of Intel/AMD CPUs used
in Chromebooks, including those lacking xsaves support.
(e.g. Kaby Lake, Gemini Lake, Alder Lake and AMD Zen series)

Bug: 314243939
Test: Build an image with TARGET_ARCH_VARIANT:=goldmont-without-xsaves
Change-Id: I9963cc3356394815f068fc998a9708bdb30c8266
2023-12-15 14:25:55 +09:00
Colin Cross
8ff105860d Remove ConvertWithBp2build implementations
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.

Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
2023-12-08 13:51:05 -08:00
Matthew Maurer
15675d5936 rust: Enable ELF TLS by default in platform Rust
Upstream currently uses pthread keys to emulate TLS on Android because
it historically did not have it, and is going to move to LLVM emulated
TLS, which is needed to target L. Since we know the platform is Q+, we
can just use the new features.

Test: Treehugger
Change-Id: I7c7747d89cba736377cfeb4080573a89b801e8fe
2023-11-30 23:12:55 +00:00
Charisee
67b2923cd0 rustc-1.73.0 Build 11110309
bug: http://b/303252546
Test: m rust
Change-Id: Ic8f99af411665b7eaef81d9ca15342e1ea396fc3
2023-11-27 22:30:13 +00:00
Chris Wailes
d6c5839be2 rustc-1.72.1 Build 11023353
Bug: https://issuetracker.google.com/issues/307308192
Test: m rust
Change-Id: Iadcb2d74b5e90d3488bdf6e156345d358d6c4a82
2023-10-30 14:15:31 -07:00
Eric Rahm
25acde2f56 Reapply "Use zstd to compress debug info in rust libraries"
This reverts commit 99d682ad4a.

Test: m
Bug: 305277519
Change-Id: I33c951265229d9f65670760c2255625ef3226707
2023-10-20 16:01:14 +00:00
Matías Hernández
99d682ad4a Revert "Use zstd to compress debug info in rust libraries"
Revert submission 2788316

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.corp.google.com/builds/quarterdeck?branch=git_main&target=panther-next-userdebug&lkgb=10981485&lkbb=10981536&fkbb=10981536, bug b/306625613

Reverted changes: /q/submissionid:2788316

Change-Id: I78830209e04e5cd8872d75ec3a0faa46acd47ac6
BUG: 306625613
2023-10-20 13:07:14 +00:00
Eric Rahm
a806f9dc44 Use zstd to compress debug info in rust libraries
We can save a significant amount of disk space by compressing debug info
in rust builds. This adds a flag that configures compressing debug info
at the link stage for rust binaries.

Test: m
Bug: 305277519
Change-Id: Ia85d8dc0e7bea35d9f9abfeae27a4610b3113e78
2023-10-19 22:47:44 +00:00
Chris Wailes
ed75eef953 Merge "Set incremental or codegen-units, not both" into main 2023-10-13 21:19:17 +00:00
Vinh Tran
308096475b Export rust flags for arm, x86, and x86_64 to Bazel
Test: b build //build/bazel/examples/rust:all --config=android
Bug: 295918553
Change-Id: I53d393f4cc5cd99ccd17d37e32211adaaba5bd0a
2023-10-12 14:59:50 -04:00
Chris Wailes
7c1b29c9a4 Set incremental or codegen-units, not both
This CL changes the handling of Rust flags to only pass one of either
incremental or codegen-units.  This is necessary because incremental
implies a codegen-units value of 128 and it may be overridden by the
separate codegen-units argument.

Test: TH
Change-Id: Ia474e4f9fc071d5054cb479ec9de550fa886677e
2023-10-12 10:56:34 -07:00
Vinh Tran
8321763764 Export device arm64 rust flags to Bazel
Test: b build //build/bazel/examples/rust:all --config=android
Change-Id: I2656dc963cc4fe0c42da52a0d2a235b5cd86fa13
2023-10-04 18:26:13 -04:00
Vinh Tran
50de8becd1 Export rust flags to bazel
Bug: 290790800
Test: Inspect out/soong/soong_inspection folder after running `m bp2build`
Change-Id: Iffc43a540f67e5f07d109a0a87f3248fae035267
2023-10-04 13:14:32 -04:00
Sam Delmerico
f2b16069bb Revert^4 "add rust_toolchain_rustc_prebuilt module type"
930fd8bfb1

Change-Id: Id3f3a66022a496aab7db93670a7bdf8507384875
2023-09-25 12:13:17 +00:00
Wen-yi Chu
930fd8bfb1 Revert^3 "add rust_toolchain_rustc_prebuilt module type"
9333ac1249

Change-Id: Ic7f064806553a0cfbc286136a764b5ea3898d06c
2023-09-22 22:05:54 +00:00
Wen-yi Chu
41326c1f41 Revert "support sandboxed rust rules"
Revert submission 2629131-sandbox-rust-inputs

Reason for revert: Fail on android build.

Reverted changes: /q/submissionid:2629131-sandbox-rust-inputs

Change-Id: Ifd9aa46e80a12d8f4ffa0a2daa74b96727cbb7e6
2023-09-22 22:05:54 +00:00
Colin Cross
05cbcb3539 Revert "remove rust deps on clang prebuilts"
Revert submission 2758566

Reason for revert: b/301463284

Reverted changes: /q/submissionid:2758566

Change-Id: I54f0ecbbd922deb23009ca89ff79689e128f4f31
2023-09-22 22:02:28 +00:00
Sam Delmerico
476e876119 remove rust deps on clang prebuilts
Prebuilt modules for some clang tools were created in aosp/2746469, but they do not exist for darwin builds. Adding the same modules in prebuilts/clang/host/darwin-x86/Android.bp results in duplicate module names. Instead we can just get a path to these files directly in Soong.

Test: CI
Test: https://android-build.googleplex.com/builds/abtd/run/L90700000963131594
Change-Id: I620cfd7b1ab34bd0959feea562d599b963717198
2023-09-21 08:15:36 +00:00
Sam Delmerico
52d1cc334b Merge changes from topics "revert-2746976-revert-2605644-rulebuilder-ninja-vars-OAAWYCDDLT-KMAGKVIXAT", "sandbox-rust-inputs" into main
* changes:
  support sandboxed rust rules
  conditionally escape rule builder command
  Revert^2 "allow Ninja variables in RuleBuilder API"
  Revert^2 "add crate_root property to rust modules"
  Revert^2 "add rust_toolchain_rustc_prebuilt module type"
2023-09-20 18:48:21 +00:00
Sam Delmerico
a588d153c8 support sandboxed rust rules
This commit adds support for compiling rust rules inside the sbox
sandbox. To compile a rust module with sandboxing enabled, the entry
point to the crate must be specified via the `crate_root` property, and
all input sources and compile-time data must be specified via the `srcs`
and `compile_data` properties.

Bug: 286077158
Change-Id: I8c9dc5cf7578037a583b4be2e2f73cf20ffd4408
2023-09-15 22:46:56 +00:00
Sam Delmerico
9333ac1249 Revert^2 "add rust_toolchain_rustc_prebuilt module type"
400749d1f0

Change-Id: I63f04e13605c43f800f01f45345e4b3dc61aefb7
2023-09-15 22:40:16 +00:00
Treehugger Robot
2e3f8e6b35 Merge "Enable target features for riscv64 Rust builds" into main 2023-09-15 18:42:40 +00:00
Chris Wailes
820ec84427 Enable target features for riscv64 Rust builds
This CL enables the following features for riscv64 Rust builds in
Android: V, Zba, Zbb, and Zbs

Test: m rust
Bug: 300313717
Bug: 300312461
Change-Id: I8712b1850a60a05e99a3e89e602bb56d2ccf2563
2023-09-13 16:39:17 -07:00
James Farrell
732b37f7bf rustc-1.72.0 Build 10803849
Bug: https://issuetracker.google.com/issues/295883071
Test: m rust
Change-Id: I5bd81a4ceecf21aa2984c07186b2713159501273
2023-09-13 23:34:18 +00:00
Ivan Lozano
085efff213 rust: Emit frame pointers on 64-bit device targets.
Frame pointers can aid in unwinding and reading stack traces.

Bug: 298267402
Test: m rust
Change-Id: I48bf5ef9ffa9912d6af5fc2b7297f250d15718ea
2023-09-12 13:28:37 -04:00
James Farrell
5d4be57cac Revert "rustc-1.72.0 Build 10752340"
Revert submission 2736851-rust-1.72

Reason for revert: Breaks Mac builds

Change-Id: I94a30e61f9f717ad135fbef7ec7241730f583110
2023-09-11 20:01:49 +00:00
James Farrell
26b90d5474 rustc-1.72.0 Build 10752340
Bug: https://issuetracker.google.com/issues/295883071
Test: m rust
Change-Id: Ie37d902ae16d8471785cc54beaea5a2c82f063b1
2023-09-07 01:08:02 +00:00
Ivan Lozano
5467a39984 rust: Rust sanitized snapshots variations
This adds support for correctly handling Rust sanitized snapshots,
ensuring they only have one variation.

The presence of multiple variations were causing build failures
when a rust_fuzz module for host was defined and a snapshot
build was requested.

This also sets -Z link-native-libraries=no on host modules
(in addition to device modules) to avoid emitting extra linkage
flags due to link attributes.

Bug: 282897366
Test: SOONG_SDK_SNAPSHOT_USE_SRCJAR=true m
Change-Id: Idf980c29145f11c530ad635a4eb5b01a1730ac24
2023-08-25 12:54:56 -04:00
Vinh Tran
80f6b2147f Export RustDefaultVersion to Bazel
The config constant is consumed by rust toolchain implemented in aosp/2709668.

Bug: 295918553
Test: go test
Change-Id: I0a28a802ad28f6ee24dfb1b5bdab72094534ae04
2023-08-23 22:55:40 -04:00
Treehugger Robot
d62482345d Merge "Require safety comments for unsafe blocks." into main 2023-08-18 16:25:43 +00:00
A. Cody Schuffelen
f29ca58e88 Darwin/Mac OS host rust compilation fixes
- 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
2023-08-03 16:26:44 -07:00
Ivan Lozano
2797e876f1 rust: Add BTI/PAC for supported targets.
This mirrors the support provided for cc modules.

Bug: 181027427
Test: m rust
Change-Id: I1354b37ec8c47132f143400adba6d42cf2081df5
2023-07-25 14:25:43 -04:00
Chris Wailes
2e23a3d140 rustc-1.71.0 Build 10534657
Bug: https://issuetracker.google.com/issues/288268986
Test: m rust
Change-Id: If1db6f9e866eeda121f757159a02cfb9018ab270
2023-07-20 14:52:57 -07:00
Andrew Walbran
7d61fae91d Require safety comments for unsafe blocks.
Also require unsafe blocks even within unsafe functions.

Bug: 290018030
Test: m pvmfw_bin
Change-Id: I6ffce7b59a9b2f22572a88e0ba55aaf01576273c
2023-07-06 17:30:47 +01:00
Ivan Lozano
464f3b381e rust: Enable stack-protector for Rust modules
Bug: 288407220
Test: m
Change-Id: Ifea0d4e3be715d9cef74ddfc6e64447a006fe0ed
2023-06-22 18:03:16 +00:00
Charisee
4fa57fbadb rustc-1.70.0 Build 10322039
bug: 285036397
Test: m rust
Change-Id: I44fc85e53d23c834007cbd1922376a7a64af2bb4
2023-06-14 22:30:12 +00:00
Chris Wailes
547bfdd1d1 Remove the last allow-listed unstable features
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
2023-05-31 11:53:44 -07:00