summaryrefslogtreecommitdiff
path: root/rust/compiler.go
diff options
context:
space:
mode:
Diffstat (limited to 'rust/compiler.go')
-rw-r--r--rust/compiler.go19
1 files changed, 8 insertions, 11 deletions
diff --git a/rust/compiler.go b/rust/compiler.go
index 664578d82..aeb904b37 100644
--- a/rust/compiler.go
+++ b/rust/compiler.go
@@ -146,8 +146,13 @@ func (compiler *baseCompiler) coverageOutputZipPath() android.OptionalPath {
panic("baseCompiler does not implement coverageOutputZipPath()")
}
-func (compiler *baseCompiler) static() bool {
- return false
+func (compiler *baseCompiler) staticStd(ctx *depsContext) bool {
+ // For devices, we always link stdlibs in as dylibs by default.
+ if ctx.Device() {
+ return false
+ } else {
+ return true
+ }
}
var _ compiler = (*baseCompiler)(nil)
@@ -221,15 +226,7 @@ func (compiler *baseCompiler) compilerDeps(ctx DepsContext, deps Deps) Deps {
stdlib = stdlib + "_" + ctx.toolchain().RustTriple()
}
- // For devices, we always link stdlibs in as dylibs except for ffi static libraries.
- // (rustc does not support linking libstd as a dylib for ffi static libraries)
- if ctx.Host() {
- deps.Rustlibs = append(deps.Rustlibs, stdlib)
- } else if ctx.RustModule().compiler.static() {
- deps.Rlibs = append(deps.Rlibs, stdlib)
- } else {
- deps.Dylibs = append(deps.Dylibs, stdlib)
- }
+ deps.Stdlibs = append(deps.Stdlibs, stdlib)
}
}
return deps