diff options
Diffstat (limited to 'rust/compiler.go')
| -rw-r--r-- | rust/compiler.go | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/rust/compiler.go b/rust/compiler.go index bf6a48844..31acd49cb 100644 --- a/rust/compiler.go +++ b/rust/compiler.go @@ -15,6 +15,7 @@ package rust import ( + "android/soong/cc" "fmt" "path/filepath" "strings" @@ -161,7 +162,7 @@ type BaseCompilerProperties struct { // This is primarily meant for rust_binary and rust_ffi modules where the default // linkage of libstd might need to be overridden in some use cases. This should // generally be avoided with other module types since it may cause collisions at - // linkage if all dependencies of the root binary module do not link against libstd\ + // linkage if all dependencies of the root binary module do not link against libstd // the same way. Prefer_rlib *bool `android:"arch_variant"` @@ -207,6 +208,10 @@ func (compiler *baseCompiler) SetDisabled() { panic("baseCompiler does not implement SetDisabled()") } +func (compiler *baseCompiler) noStdlibs() bool { + return Bool(compiler.Properties.No_stdlibs) +} + func (compiler *baseCompiler) coverageOutputZipPath() android.OptionalPath { panic("baseCompiler does not implement coverageOutputZipPath()") } @@ -307,19 +312,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag flags.EmitXrefs = ctx.Config().EmitXrefRules() if ctx.Host() && !ctx.Windows() { - rpathPrefix := `\$$ORIGIN/` - if ctx.Darwin() { - rpathPrefix = "@loader_path/" - } - - var rpath string - if ctx.toolchain().Is64Bit() { - rpath = "lib64" - } else { - rpath = "lib" - } - flags.LinkFlags = append(flags.LinkFlags, "-Wl,-rpath,"+rpathPrefix+rpath) - flags.LinkFlags = append(flags.LinkFlags, "-Wl,-rpath,"+rpathPrefix+"../"+rpath) + flags.LinkFlags = append(flags.LinkFlags, cc.RpathFlags(ctx)...) } return flags |