Skip to content

Commit b8f85a8

Browse files
committed
Revert "stage2: add support for zig cc assembler -mcpu option"
This reverts commit afb9f69. I don't think this was ever actually verified to fix the thing it purported to, and it started causing warnings for unused command line parameters.
1 parent ae01c65 commit b8f85a8

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

src/Compilation.zig

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2943,29 +2943,25 @@ pub fn addCCArgs(
29432943
try argv.append("-fPIC");
29442944
}
29452945
},
2946-
.shared_library, .ll, .bc, .unknown, .static_library, .object, .zig => {},
2947-
.assembly => {
2948-
// Argh, why doesn't the assembler accept the list of CPU features?!
2949-
// I don't see a way to do this other than hard coding everything.
2950-
switch (target.cpu.arch) {
2951-
.riscv32, .riscv64 => {
2952-
if (std.Target.riscv.featureSetHas(target.cpu.features, .relax)) {
2953-
try argv.append("-mrelax");
2954-
} else {
2955-
try argv.append("-mno-relax");
2956-
}
2957-
},
2958-
else => {
2959-
// TODO
2960-
},
2961-
}
2962-
if (target.cpu.model.llvm_name) |ln|
2963-
try argv.append(try std.fmt.allocPrint(arena, "-mcpu={s}", .{ln}));
2964-
},
2946+
.shared_library, .assembly, .ll, .bc, .unknown, .static_library, .object, .zig => {},
29652947
}
29662948
if (out_dep_path) |p| {
29672949
try argv.appendSlice(&[_][]const u8{ "-MD", "-MV", "-MF", p });
29682950
}
2951+
// Argh, why doesn't the assembler accept the list of CPU features?!
2952+
// I don't see a way to do this other than hard coding everything.
2953+
switch (target.cpu.arch) {
2954+
.riscv32, .riscv64 => {
2955+
if (std.Target.riscv.featureSetHas(target.cpu.features, .relax)) {
2956+
try argv.append("-mrelax");
2957+
} else {
2958+
try argv.append("-mno-relax");
2959+
}
2960+
},
2961+
else => {
2962+
// TODO
2963+
},
2964+
}
29692965

29702966
if (target_util.clangMightShellOutForAssembly(target)) {
29712967
try argv.append("-integrated-as");

0 commit comments

Comments
 (0)