Don't miss the Variant for arm2 platform

The `defaultPlatform` got on the build system include the variant for arm v6, v7 etc.
This is an important information for us to find the matched platform, but this information
is missed since the code doesn't include variant when assemble the platform information.

And since "V8" variant for arm64 is normalized to an empty string, so we need to take care
of this as well.

Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
Dave Chen
2019-03-11 19:16:06 -07:00
parent 2a857a3bfa
commit 550fd00160

View File

@@ -80,10 +80,20 @@ func RuntimePlatforms(p []specs.Platform) LoadOpt {
defaultPlatform = &pb.Platform{
OS: p.OS,
Architecture: p.Architecture,
Variant: p.Variant,
}
}
op.Platform = defaultPlatform
}
platform := specs.Platform{OS: op.Platform.OS, Architecture: op.Platform.Architecture, Variant: op.Platform.Variant}
normalizedPlatform := platforms.Normalize(platform)
op.Platform = &pb.Platform{
OS: normalizedPlatform.OS,
Architecture: normalizedPlatform.Architecture,
Variant: normalizedPlatform.Variant,
}
if _, ok := op.Op.(*pb.Op_Exec); ok {
var found bool
for _, pp := range pp {