Skip to content

Commit 435b2f1

Browse files
author
vole-dev
committed
add target_abi to CrossTarget to use in build.zig
1 parent 5924789 commit 435b2f1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/std/build.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2423,6 +2423,9 @@ pub const LibExeObjStep = struct {
24232423
if (self.wasi_exec_model) |model| {
24242424
try zig_args.append(builder.fmt("-mexec-model={s}", .{@tagName(model)}));
24252425
}
2426+
if (self.target.target_abi) |target_abi| {
2427+
try zig_args.append(builder.fmt("-mabi={s}", .{target_abi.string()}));
2428+
}
24262429

24272430
if (!self.target.isNative()) {
24282431
try zig_args.append("-target");

lib/std/zig/cross_target.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ pub const CrossTarget = struct {
3737
/// `null` means the native C ABI, if `os_tag` is native, otherwise it means the default C ABI.
3838
abi: ?Target.Abi = null,
3939

40+
/// `null` means the default processor specific target-abi.
41+
target_abi: ?Target.TargetAbi = null,
42+
4043
/// When `os_tag` is `null`, then `null` means native. Otherwise it means the standard path
4144
/// based on the `os_tag`.
4245
dynamic_linker: DynamicLinker = DynamicLinker{},

0 commit comments

Comments
 (0)