Fix binaries and symlinks for prefer32
Track the primary architecture selected for each class based on the module's multilib setting and the global config. Fixes building binaries with multlib set to first and DevicePrefer32BitExecutables set, and fixes symlinks to binaries with multilib set to prefer32. Bug: 31452121 Test: mmma -j art HOST_PREFER_32_BIT=true Change-Id: I75094df42f3273f6d613e4058eaa565957174c28
This commit is contained in:
@@ -57,6 +57,7 @@ type ModuleBuildParams struct {
|
||||
|
||||
type androidBaseContext interface {
|
||||
Target() Target
|
||||
TargetPrimary() bool
|
||||
Arch() Arch
|
||||
Os() OsType
|
||||
Host() bool
|
||||
@@ -145,7 +146,8 @@ type commonProperties struct {
|
||||
Required []string
|
||||
|
||||
// Set by TargetMutator
|
||||
CompileTarget Target `blueprint:"mutated"`
|
||||
CompileTarget Target `blueprint:"mutated"`
|
||||
CompilePrimary bool `blueprint:"mutated"`
|
||||
|
||||
// Set by InitAndroidModule
|
||||
HostOrDeviceSupported HostOrDeviceSupported `blueprint:"mutated"`
|
||||
@@ -282,14 +284,19 @@ func (a *ModuleBase) base() *ModuleBase {
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *ModuleBase) SetTarget(target Target) {
|
||||
func (a *ModuleBase) SetTarget(target Target, primary bool) {
|
||||
a.commonProperties.CompileTarget = target
|
||||
a.commonProperties.CompilePrimary = primary
|
||||
}
|
||||
|
||||
func (a *ModuleBase) Target() Target {
|
||||
return a.commonProperties.CompileTarget
|
||||
}
|
||||
|
||||
func (a *ModuleBase) TargetPrimary() bool {
|
||||
return a.commonProperties.CompilePrimary
|
||||
}
|
||||
|
||||
func (a *ModuleBase) Os() OsType {
|
||||
return a.Target().Os
|
||||
}
|
||||
@@ -420,8 +427,9 @@ func (a *ModuleBase) generateModuleTarget(ctx blueprint.ModuleContext) {
|
||||
|
||||
func (a *ModuleBase) androidBaseContextFactory(ctx blueprint.BaseModuleContext) androidBaseContextImpl {
|
||||
return androidBaseContextImpl{
|
||||
target: a.commonProperties.CompileTarget,
|
||||
config: ctx.Config().(Config),
|
||||
target: a.commonProperties.CompileTarget,
|
||||
targetPrimary: a.commonProperties.CompilePrimary,
|
||||
config: ctx.Config().(Config),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,9 +462,10 @@ func (a *ModuleBase) GenerateBuildActions(ctx blueprint.ModuleContext) {
|
||||
}
|
||||
|
||||
type androidBaseContextImpl struct {
|
||||
target Target
|
||||
debug bool
|
||||
config Config
|
||||
target Target
|
||||
targetPrimary bool
|
||||
debug bool
|
||||
config Config
|
||||
}
|
||||
|
||||
type androidModuleContext struct {
|
||||
@@ -536,6 +545,10 @@ func (a *androidBaseContextImpl) Target() Target {
|
||||
return a.target
|
||||
}
|
||||
|
||||
func (a *androidBaseContextImpl) TargetPrimary() bool {
|
||||
return a.targetPrimary
|
||||
}
|
||||
|
||||
func (a *androidBaseContextImpl) Arch() Arch {
|
||||
return a.target.Arch
|
||||
}
|
||||
|
Reference in New Issue
Block a user