[rust] Component builds support: `std`, `serde_core`, `read_fonts`.

This CL changes the `--crate-type` of `std`, `serde_core`, and
`read_fonts` crates from `rlib` to `dylib` when `is_component_build`.
In the future we may want to automatically opt-in all `cargo_crate`
`rlib`s into `override_crate_type_as_dylib_in_component_builds`, but for
now this is postponed into a follow-up bug: https://crbug.com/505430456

The primary goal of this CL is to change the crate type of the `std`
crate (to fix https://crbug.com/498216362), but covering `serde_core`
and `read_fonts` crates is required to avoid ODR violations related to
trait implementations for `std` (and `core`) types - e.g.:

```
==164006==ERROR: AddressSanitizer: odr-violation (0x75768e3996a0):
  [1] size=4 '<core::time::Duration as serde_core::de::Deserialize>::deserialize::check_overflow::NANOS_PER_SEC' serde_core.b101880b7e767c36-cgu.0 in /b/s/w/ir/cache/builder/src/out/d773-linux-libfuzzer/libv8.so
  [2] size=4 '<core::time::Duration as serde_core::de::Deserialize>::deserialize::check_overflow::NANOS_PER_SEC' serde_core.b101880b7e767c36-cgu.0 in /b/s/w/ir/cache/builder/src/out/d773-linux-libfuzzer/libbase.so
```

Bug: 498216362
Change-Id: I2395d3fdeb0020cadce5939ad20a825813eafb94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7757704
Reviewed-by: Junji Watanabe <jwata@google.com>
Reviewed-by: Devon Loehr <dloehr@google.com>
Commit-Queue: Ɓukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1627323}
NOKEYCHECK=True
GitOrigin-RevId: decfd1e0e2f9237442ac5f2c02146cb507c79d82
3 files changed