Build Rust Device Sysroots in Soong
In order to ensure we are using current platform Bionic for any platform Rust binaries, we need to build the sysroot in Soong. This will also enable us too hook the "test" crate if necessary. While both a dynamic and static sysroot are available, on device only a dynamic sysroot will be injected. On host, we continue using the sysroot used to build the compiler as before. Bug: 139486496 Change-Id: I127377e5b056610ceb5015a34d266250320fbc31
This commit is contained in:
@@ -16,7 +16,6 @@ package rust
|
||||
|
||||
import (
|
||||
"android/soong/android"
|
||||
"android/soong/rust/config"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -89,12 +88,6 @@ func (binary *binaryDecorator) compilerFlags(ctx ModuleContext, flags Flags) Fla
|
||||
func (binary *binaryDecorator) compilerDeps(ctx DepsContext, deps Deps) Deps {
|
||||
deps = binary.baseCompiler.compilerDeps(ctx, deps)
|
||||
|
||||
if binary.preferDynamic() || len(deps.Dylibs) > 0 {
|
||||
for _, stdlib := range config.Stdlibs {
|
||||
deps.Dylibs = append(deps.Dylibs, stdlib+"_"+ctx.toolchain().RustTriple())
|
||||
}
|
||||
}
|
||||
|
||||
if ctx.toolchain().Bionic() {
|
||||
deps = binary.baseCompiler.bionicDeps(ctx, deps)
|
||||
deps.CrtBegin = "crtbegin_dynamic"
|
||||
|
Reference in New Issue
Block a user