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
This commit is contained in:
Colin Cross
2022-01-23 20:46:16 -08:00
parent 41f7a4a788
commit fe605e14ee
4 changed files with 18 additions and 19 deletions

View File

@@ -95,11 +95,11 @@ func (binary *binaryDecorator) compilerDeps(ctx DepsContext, deps Deps) Deps {
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