Support multiple crtbegin and crtend dependencies
Musl libc with an embedded linker uses multiple crtbegin dependencies,
convert rust's CrtBegin and CrtEnd to lists.
Bug: 190084016
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ie843801e87b1f38ace84502d9e4f938a92ec1fa2
diff --git a/rust/binary.go b/rust/binary.go
index db91ccb..5d9b0a6 100644
--- a/rust/binary.go
+++ b/rust/binary.go
@@ -95,11 +95,11 @@
if ctx.toolchain().Bionic() {
deps = bionicDeps(ctx, deps, Bool(binary.Properties.Static_executable))
if Bool(binary.Properties.Static_executable) {
- deps.CrtBegin = "crtbegin_static"
+ deps.CrtBegin = []string{"crtbegin_static"}
} else {
- deps.CrtBegin = "crtbegin_dynamic"
+ deps.CrtBegin = []string{"libc_musl_crtbegin_dynamic"}
}
- deps.CrtEnd = "crtend_android"
+ deps.CrtEnd = []string{"libc_musl_crtend"}
}
return deps