authorgravatar for opensource@louispearson.workLouis Pearson <opensource@louispearson.work> 2022-10-21 16:32:56-06:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-10-21 18:32:56-04:00
log8d4778b4f9c731b2e9fab0b968e1ca6864fd3a72
tree42122e372368331daadfa38181b40b9d8c6e2f89
parent3b2f0c3eeefa188e57cb1ee0874306f1d3734031
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Support compiling for the android NDK (#13245)


3 files changed, 5 insertions(+), 1 deletions(-)

lib/compiler_rt/common.zig+1
......@@ -9,6 +9,7 @@ pub const want_aeabi = switch (builtin.abi) {
99 .musleabihf,
1010 .gnueabi,
1111 .gnueabihf,
12 .android,
1213 => switch (builtin.cpu.arch) {
1314 .arm, .armeb, .thumb, .thumbeb => true,
1415 else => false,
lib/compiler_rt/emutls.zig+1-1
......@@ -18,7 +18,7 @@ const gcc_word = usize;
1818pub const panic = common.panic;
1919
2020comptime {
21 if (builtin.link_libc and builtin.os.tag == .openbsd) {
21 if (builtin.link_libc and (builtin.abi == .android or builtin.os.tag == .openbsd)) {
2222 @export(__emutls_get_address, .{ .name = "__emutls_get_address", .linkage = common.linkage });
2323 }
2424}
lib/std/c/linux.zig+3
......@@ -320,6 +320,9 @@ pub const pthread_rwlock_t = switch (native_abi) {
320320 size: [56]u8 align(@alignOf(usize)) = [_]u8{0} ** 56,
321321 },
322322};
323pub usingnamespace if (native_abi == .android) struct {
324 pub const pthread_key_t = c_int;
325} else struct {};
323326pub const sem_t = extern struct {
324327 __size: [__SIZEOF_SEM_T]u8 align(@alignOf(usize)),
325328};