commit 8d4778b4f9c731b2e9fab0b968e1ca6864fd3a72 (tree)
parent 3b2f0c3eeefa188e57cb1ee0874306f1d3734031
Author: Louis Pearson <opensource@louispearson.work>
Date: Fri, 21 Oct 2022 16:32:56 -0600
Support compiling for the android NDK (#13245)
Diffstat:
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/compiler_rt/common.zig b/lib/compiler_rt/common.zig
@@ -9,6 +9,7 @@ pub const want_aeabi = switch (builtin.abi) {
.musleabihf,
.gnueabi,
.gnueabihf,
+ .android,
=> switch (builtin.cpu.arch) {
.arm, .armeb, .thumb, .thumbeb => true,
else => false,
diff --git a/lib/compiler_rt/emutls.zig b/lib/compiler_rt/emutls.zig
@@ -18,7 +18,7 @@ const gcc_word = usize;
pub const panic = common.panic;
comptime {
- if (builtin.link_libc and builtin.os.tag == .openbsd) {
+ if (builtin.link_libc and (builtin.abi == .android or builtin.os.tag == .openbsd)) {
@export(__emutls_get_address, .{ .name = "__emutls_get_address", .linkage = common.linkage });
}
}
diff --git a/lib/std/c/linux.zig b/lib/std/c/linux.zig
@@ -320,6 +320,9 @@ pub const pthread_rwlock_t = switch (native_abi) {
size: [56]u8 align(@alignOf(usize)) = [_]u8{0} ** 56,
},
};
+pub usingnamespace if (native_abi == .android) struct {
+ pub const pthread_key_t = c_int;
+} else struct {};
pub const sem_t = extern struct {
__size: [__SIZEOF_SEM_T]u8 align(@alignOf(usize)),
};