summaryrefslogtreecommitdiff
path: root/rust/compiler.go
diff options
context:
space:
mode:
author Maciej Żenczykowski <maze@google.com> 2024-12-17 06:08:02 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-12-17 06:08:02 -0800
commitaea639d61264b9b22027d8c274180883d1143ea7 (patch)
treea52113bf022d30df9b7607d2f15eb686ad8ab435 /rust/compiler.go
parent9e1f9b9d73dae437aadd9b204136b2fcc8fc4a98 (diff)
parent806efd3885d6eecfa1b1bd1697431c0ab073a76a (diff)
Merge "rust: Alias rust_ffi_rlib to rust_library_rlib" into main
Diffstat (limited to 'rust/compiler.go')
-rw-r--r--rust/compiler.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/rust/compiler.go b/rust/compiler.go
index fd869174c..b93019b30 100644
--- a/rust/compiler.go
+++ b/rust/compiler.go
@@ -30,9 +30,8 @@ import (
type RustLinkage int
const (
- DefaultLinkage RustLinkage = iota
+ DylibLinkage RustLinkage = iota
RlibLinkage
- DylibLinkage
)
type compiler interface {
@@ -69,7 +68,7 @@ type compiler interface {
Disabled() bool
SetDisabled()
- stdLinkage(ctx *depsContext) RustLinkage
+ stdLinkage(device bool) RustLinkage
noStdlibs() bool
unstrippedOutputFilePath() android.Path
@@ -316,11 +315,11 @@ func (compiler *baseCompiler) Aliases() map[string]string {
return aliases
}
-func (compiler *baseCompiler) stdLinkage(ctx *depsContext) RustLinkage {
+func (compiler *baseCompiler) stdLinkage(device bool) RustLinkage {
// For devices, we always link stdlibs in as dylibs by default.
if compiler.preferRlib() {
return RlibLinkage
- } else if ctx.Device() {
+ } else if device {
return DylibLinkage
} else {
return RlibLinkage