fix build.zig logic for -target-cpu and -target-feature

fix a false negative for detecting the ability to emit these flags.
it matters for stage0/stage1 on aarch64
master
Andrew Kelley 2020-01-28 14:54:34 -05:00
parent 504ce86ac9
commit 3ed52e5453
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 3 additions and 0 deletions

View File

@ -1978,6 +1978,9 @@ pub const LibExeObjStep = struct {
const all_features = self.target.getArch().allFeaturesList(); const all_features = self.target.getArch().allFeaturesList();
var populated_cpu_features = cross.cpu_features.cpu.features; var populated_cpu_features = cross.cpu_features.cpu.features;
if (self.target.getArch().subArchFeature()) |sub_arch_index| {
populated_cpu_features.addFeature(sub_arch_index);
}
populated_cpu_features.populateDependencies(all_features); populated_cpu_features.populateDependencies(all_features);
if (populated_cpu_features.eql(cross.cpu_features.features)) { if (populated_cpu_features.eql(cross.cpu_features.features)) {