diff options
| author | vole-dev <dev@vole.dev> | 2021-10-30 10:30:28 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-12-03 16:53:33 -0700 |
| commit | ff38f560402aa61ce8e4ae38b4fa0ff2ddbaede6 (patch) | |
| tree | cc248ce8fc3c3d76d968cb348fc8d130a7e40366 /lib/std/build.zig | |
| parent | 84704ef43e5414860aa9d3dc0f94f9737404f6e5 (diff) | |
| download | zig-ff38f560402aa61ce8e4ae38b4fa0ff2ddbaede6.tar.gz zig-ff38f560402aa61ce8e4ae38b4fa0ff2ddbaede6.zip | |
default mabi based on RISC-V extensions and -mabi build option
The target abi can also be set in build.zig via LibExeObjStep.target_abi
The value passed in is checked that it is a valid value in
std.Target.TargetAbi
The target abi is also validated against the target cpu
Diffstat (limited to 'lib/std/build.zig')
| -rw-r--r-- | lib/std/build.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/build.zig b/lib/std/build.zig index 30296081b7..cd551924a9 100644 --- a/lib/std/build.zig +++ b/lib/std/build.zig @@ -1474,6 +1474,7 @@ pub const LibExeObjStep = struct { name_prefix: []const u8, filter: ?[]const u8, test_evented_io: bool = false, + target_abi: ?std.Target.TargetAbi = null, code_model: std.builtin.CodeModel = .default, wasi_exec_model: ?std.builtin.WasiExecModel = null, @@ -2458,6 +2459,9 @@ pub const LibExeObjStep = struct { try zig_args.append(builder.fmt("--global-base={d}", .{global_base})); } + if (self.target_abi) |target_abi| { + try zig_args.append(builder.fmt("-mabi={s}", .{@tagName(target_abi)})); + } if (self.code_model != .default) { try zig_args.append("-mcmodel"); try zig_args.append(@tagName(self.code_model)); |
