Files
zig/test/standalone/issue_8550/build.zig
Andrew Kelley 55811d8dac stage2: introduce clangAssemblerSupportsMcpuArg
Clang has a completely inconsistent CLI for its integrated assembler for
each target architecture. For x86_64, for example, it does not accept
an -mcpu parameter, and emits "warning: unused parameter". However, for
ARM, -mcpu is needed in order to properly lower assembly to machine code
instructions (see new standalone test case provided thanks to @g-w1).

This is a compromise between
b8f85a805b and
afb9f695b1.
2021-05-23 21:51:10 -07:00

22 lines
634 B
Zig

const std = @import("std");
pub fn build(b: *std.build.Builder) !void {
const target = std.zig.CrossTarget{
.os_tag = .freestanding,
.cpu_arch = .arm,
.cpu_model = .{
.explicit = &std.Target.arm.cpu.arm1176jz_s,
},
};
const mode = b.standardReleaseOptions();
const kernel = b.addExecutable("kernel", "./main.zig");
kernel.addObjectFile("./boot.S");
kernel.setLinkerScriptPath("./linker.ld");
kernel.setBuildMode(mode);
kernel.setTarget(target);
kernel.install();
const test_step = b.step("test", "Test it");
test_step.dependOn(&kernel.step);
}