diff options
author | 2023-10-02 11:39:17 -0700 | |
---|---|---|
committer | 2023-10-02 22:15:55 -0700 | |
commit | 004bd3f526714343209397881c81f857212a6967 (patch) | |
tree | b2a7ea2319a2683fbc091c997ad38479ae5eef62 /rust/binary.go | |
parent | 0af40657ff73669a8d0099dc2d6a02d4f9b911c2 (diff) |
Revert "Split Rust crate builds into compile and link phases."
This reverts commit e7c71c344d462cac998b37d551bd78baa892082d.
The intermediates created by the separated rust compile steps are very
large, on the order of 60GB. This is more than CI can support for now,
revert the split into compile and link phases. This comes at the expense
of incremental build time, especially when modifying C/C++ sources that
are dependencies of rust modules.
Bug: 293349612
Test: builds
Change-Id: I81169e7d0727330c8de5e7688dcdc87fe7b8d3b5
Diffstat (limited to 'rust/binary.go')
-rw-r--r-- | rust/binary.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/rust/binary.go b/rust/binary.go index aee4da699..860dc948a 100644 --- a/rust/binary.go +++ b/rust/binary.go @@ -77,14 +77,11 @@ func NewRustBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator func (binary *binaryDecorator) compilerFlags(ctx ModuleContext, flags Flags) Flags { flags = binary.baseCompiler.compilerFlags(ctx, flags) - if ctx.Os().Linux() { - flags.LinkFlags = append(flags.LinkFlags, "-Wl,--gc-sections") - } - if ctx.toolchain().Bionic() { // no-undefined-version breaks dylib compilation since __rust_*alloc* functions aren't defined, // but we can apply this to binaries. flags.LinkFlags = append(flags.LinkFlags, + "-Wl,--gc-sections", "-Wl,-z,nocopyreloc", "-Wl,--no-undefined-version") @@ -149,7 +146,7 @@ func (binary *binaryDecorator) compile(ctx ModuleContext, flags Flags, deps Path flags.RustFlags = append(flags.RustFlags, deps.depFlags...) flags.LinkFlags = append(flags.LinkFlags, deps.depLinkFlags...) - flags.LinkFlags = append(flags.LinkFlags, deps.linkObjects.Strings()...) + flags.LinkFlags = append(flags.LinkFlags, deps.linkObjects...) if binary.stripper.NeedsStrip(ctx) { strippedOutputFile := outputFile |