Skip to content

Commit

Permalink
fix: support zig-bootstrap for openharmony
Browse files Browse the repository at this point in the history
  • Loading branch information
richerfu committed May 21, 2024
1 parent 33d7815 commit c6364a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/compiler_rt/emutls.zig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const gcc_word = usize;
pub const panic = common.panic;

comptime {
if (builtin.link_libc and (builtin.abi == .android or builtin.os.tag == .openbsd)) {
if (builtin.link_libc and (builtin.abi == .android or builtin.os.tag == .openbsd or builtin.abi == .ohos) {
@export(__emutls_get_address, .{ .name = "__emutls_get_address", .linkage = common.linkage, .visibility = common.visibility });
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/std/c.zig
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub const pthread_mutex_t = switch (native_os) {
data: [data_len]u8 align(@alignOf(usize)) = [_]u8{0} ** data_len,

const data_len = switch (native_abi) {
.musl, .musleabi, .musleabihf => if (@sizeOf(usize) == 8) 40 else 24,
.musl, .musleabi, .musleabihf, .ohos => if (@sizeOf(usize) == 8) 40 else 24,
.gnu, .gnuabin32, .gnuabi64, .gnueabi, .gnueabihf, .gnux32 => switch (native_arch) {
.aarch64 => 48,
.x86_64 => if (native_abi == .gnux32) 40 else 32,
Expand Down
3 changes: 3 additions & 0 deletions lib/std/zig/target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub const available_libcs = [_]ArchOsAbi{
.{ .arch = .aarch64_be, .os = .windows, .abi = .gnu },
.{ .arch = .aarch64, .os = .linux, .abi = .gnu },
.{ .arch = .aarch64, .os = .linux, .abi = .musl },
.{ .arch = .aarch64, .os = .linux, .abi = .ohos },
.{ .arch = .aarch64, .os = .windows, .abi = .gnu },
.{ .arch = .aarch64, .os = .macos, .abi = .none, .os_ver = .{ .major = 11, .minor = 0, .patch = 0 } },
.{ .arch = .armeb, .os = .linux, .abi = .gnueabi },
Expand All @@ -25,6 +26,7 @@ pub const available_libcs = [_]ArchOsAbi{
.{ .arch = .arm, .os = .linux, .abi = .gnueabihf },
.{ .arch = .arm, .os = .linux, .abi = .musleabi },
.{ .arch = .arm, .os = .linux, .abi = .musleabihf },
.{ .arch = .arm, .os = .linux, .abi = .ohos },
.{ .arch = .thumb, .os = .linux, .abi = .gnueabi },
.{ .arch = .thumb, .os = .linux, .abi = .gnueabihf },
.{ .arch = .thumb, .os = .linux, .abi = .musleabi },
Expand Down Expand Up @@ -67,6 +69,7 @@ pub const available_libcs = [_]ArchOsAbi{
.{ .arch = .x86_64, .os = .linux, .abi = .gnu },
.{ .arch = .x86_64, .os = .linux, .abi = .gnux32 },
.{ .arch = .x86_64, .os = .linux, .abi = .musl },
.{ .arch = .x86_64, .os = .linux, .abi = .ohos },
.{ .arch = .x86_64, .os = .windows, .abi = .gnu },
.{ .arch = .x86_64, .os = .macos, .abi = .none, .os_ver = .{ .major = 10, .minor = 7, .patch = 0 } },
};
Expand Down

0 comments on commit c6364a4

Please sign in to comment.