mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
std.Target: Introduce Abi.ohoseabi to distinguish the soft float case.
For the same reason as #21504.
This commit is contained in:
parent
043b1adb8d
commit
84e192c88b
@ -699,7 +699,8 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
|
||||
.cygnus => "cygnus",
|
||||
.simulator => "simulator",
|
||||
.macabi => "macabi",
|
||||
.ohos => "openhos",
|
||||
.ohos => "ohos",
|
||||
.ohoseabi => "ohoseabi",
|
||||
};
|
||||
writer.writeAll(llvm_abi) catch unreachable;
|
||||
return stream.getWritten();
|
||||
|
||||
@ -677,6 +677,7 @@ pub const Abi = enum {
|
||||
simulator,
|
||||
macabi,
|
||||
ohos,
|
||||
ohoseabi,
|
||||
|
||||
// LLVM tags deliberately omitted:
|
||||
// - amplification
|
||||
@ -766,8 +767,18 @@ pub const Abi = enum {
|
||||
|
||||
pub inline fn isMusl(abi: Abi) bool {
|
||||
return switch (abi) {
|
||||
.musl, .musleabi, .musleabihf, .muslx32 => true,
|
||||
.ohos => true,
|
||||
.musl,
|
||||
.musleabi,
|
||||
.musleabihf,
|
||||
.muslx32,
|
||||
=> true,
|
||||
else => abi.isOpenHarmony(),
|
||||
};
|
||||
}
|
||||
|
||||
pub inline fn isOpenHarmony(abi: Abi) bool {
|
||||
return switch (abi) {
|
||||
.ohos, .ohoseabi => true,
|
||||
else => false,
|
||||
};
|
||||
}
|
||||
@ -786,7 +797,7 @@ pub const Abi = enum {
|
||||
.gnueabi,
|
||||
.musleabi,
|
||||
.gnusf,
|
||||
.ohos,
|
||||
.ohoseabi,
|
||||
=> .soft,
|
||||
else => .hard,
|
||||
};
|
||||
|
||||
@ -242,6 +242,7 @@ fn libCGenericName(target: std.Target) [:0]const u8 {
|
||||
.muslx32,
|
||||
.none,
|
||||
.ohos,
|
||||
.ohoseabi,
|
||||
=> return "musl",
|
||||
.code16,
|
||||
.eabi,
|
||||
|
||||
@ -185,6 +185,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
|
||||
.simulator => "simulator",
|
||||
.macabi => "macabi",
|
||||
.ohos => "ohos",
|
||||
.ohoseabi => "ohoseabi",
|
||||
};
|
||||
try llvm_triple.appendSlice(llvm_abi);
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ pub fn requiresPIC(target: std.Target, linking_libc: bool) bool {
|
||||
target.os.tag == .windows or target.os.tag == .uefi or
|
||||
osRequiresLibC(target) or
|
||||
(linking_libc and target.isGnuLibC()) or
|
||||
(target.abi == .ohos and target.cpu.arch == .aarch64);
|
||||
(target.cpu.arch == .aarch64 and target.abi == .ohos);
|
||||
}
|
||||
|
||||
pub fn picLevel(target: std.Target) u32 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user