Merge changes from topic "ninja_static"
* changes: Fix crtend for musl static binaries Support static_executable: true for musl builds Use SystemSharedLibs as StaticLibs for static executables
This commit is contained in:
@@ -156,6 +156,10 @@ func (binary *binaryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if binary.static() {
|
||||||
|
deps.StaticLibs = append(deps.StaticLibs, deps.SystemSharedLibs...)
|
||||||
|
}
|
||||||
|
|
||||||
if ctx.toolchain().Bionic() {
|
if ctx.toolchain().Bionic() {
|
||||||
if binary.static() {
|
if binary.static() {
|
||||||
if ctx.selectedStl() == "libc++_static" {
|
if ctx.selectedStl() == "libc++_static" {
|
||||||
@@ -208,7 +212,7 @@ func NewBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
|
|||||||
func (binary *binaryDecorator) linkerInit(ctx BaseModuleContext) {
|
func (binary *binaryDecorator) linkerInit(ctx BaseModuleContext) {
|
||||||
binary.baseLinker.linkerInit(ctx)
|
binary.baseLinker.linkerInit(ctx)
|
||||||
|
|
||||||
if !ctx.toolchain().Bionic() {
|
if !ctx.toolchain().Bionic() && !ctx.toolchain().Musl() {
|
||||||
if ctx.Os() == android.Linux {
|
if ctx.Os() == android.Linux {
|
||||||
// Unless explicitly specified otherwise, host static binaries are built with -static
|
// Unless explicitly specified otherwise, host static binaries are built with -static
|
||||||
// if HostStaticBinaries is true for the product configuration.
|
// if HostStaticBinaries is true for the product configuration.
|
||||||
|
@@ -107,7 +107,7 @@ var (
|
|||||||
"util",
|
"util",
|
||||||
}, "-l")
|
}, "-l")
|
||||||
|
|
||||||
muslCrtBeginStaticBinary, muslCrtEndStaticBinary = []string{"libc_musl_crtbegin_static"}, []string{"crtend_android"}
|
muslCrtBeginStaticBinary, muslCrtEndStaticBinary = []string{"libc_musl_crtbegin_static"}, []string{"libc_musl_crtend"}
|
||||||
muslCrtBeginSharedBinary, muslCrtEndSharedBinary = []string{"libc_musl_crtbegin_dynamic", "musl_linker_script"}, []string{"libc_musl_crtend"}
|
muslCrtBeginSharedBinary, muslCrtEndSharedBinary = []string{"libc_musl_crtbegin_dynamic", "musl_linker_script"}, []string{"libc_musl_crtend"}
|
||||||
muslCrtBeginSharedLibrary, muslCrtEndSharedLibrary = []string{"libc_musl_crtbegin_so"}, []string{"libc_musl_crtend_so"}
|
muslCrtBeginSharedLibrary, muslCrtEndSharedLibrary = []string{"libc_musl_crtbegin_so"}, []string{"libc_musl_crtend_so"}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user