summaryrefslogtreecommitdiff
path: root/rust/library.go
diff options
context:
space:
mode:
Diffstat (limited to 'rust/library.go')
-rw-r--r--rust/library.go19
1 files changed, 13 insertions, 6 deletions
diff --git a/rust/library.go b/rust/library.go
index bb2e83fdb..62eaefd68 100644
--- a/rust/library.go
+++ b/rust/library.go
@@ -426,10 +426,16 @@ func (library *libraryDecorator) compilerProps() []interface{} {
func (library *libraryDecorator) compilerDeps(ctx DepsContext, deps Deps) Deps {
deps = library.baseCompiler.compilerDeps(ctx, deps)
- if ctx.toolchain().Bionic() && (library.dylib() || library.shared()) {
- deps = bionicDeps(ctx, deps, false)
- deps.CrtBegin = "crtbegin_so"
- deps.CrtEnd = "crtend_so"
+ if library.dylib() || library.shared() {
+ if ctx.toolchain().Bionic() {
+ deps = bionicDeps(ctx, deps, false)
+ deps.CrtBegin = []string{"crtbegin_so"}
+ deps.CrtEnd = []string{"crtend_so"}
+ } else if ctx.Os() == android.LinuxMusl {
+ deps = muslDeps(ctx, deps, false)
+ deps.CrtBegin = []string{"libc_musl_crtbegin_so"}
+ deps.CrtEnd = []string{"libc_musl_crtend_so"}
+ }
}
return deps
@@ -767,9 +773,10 @@ func (l *libraryDecorator) collectHeadersForSnapshot(ctx android.ModuleContext,
// Glob together the headers from the modules include_dirs property
for _, path := range android.CopyOfPaths(l.includeDirs) {
dir := path.String()
- glob, err := ctx.GlobWithDeps(dir+"/**/*", nil)
+ globDir := dir + "/**/*"
+ glob, err := ctx.GlobWithDeps(globDir, nil)
if err != nil {
- ctx.ModuleErrorf("glob failed: %#v", err)
+ ctx.ModuleErrorf("glob of %q failed: %s", globDir, err)
return
}