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) {...@@ -9,6 +9,7 @@ pub const want_aeabi = switch (builtin.abi) {
9 .musleabihf,9 .musleabihf,
10 .gnueabi,10 .gnueabi,
11 .gnueabihf,11 .gnueabihf,
12 .android,
12 => switch (builtin.cpu.arch) {13 => switch (builtin.cpu.arch) {
13 .arm, .armeb, .thumb, .thumbeb => true,14 .arm, .armeb, .thumb, .thumbeb => true,
14 else => false,15 else => false,
lib/compiler_rt/emutls.zig+1-1
...@@ -18,7 +18,7 @@ const gcc_word = usize;...@@ -18,7 +18,7 @@ const gcc_word = usize;
18pub const panic = common.panic;18pub const panic = common.panic;
1919
20comptime {20comptime {
21 if (builtin.link_libc and builtin.os.tag == .openbsd) {21 if (builtin.link_libc and (builtin.abi == .android or builtin.os.tag == .openbsd)) {
22 @export(__emutls_get_address, .{ .name = "__emutls_get_address", .linkage = common.linkage });22 @export(__emutls_get_address, .{ .name = "__emutls_get_address", .linkage = common.linkage });
23 }23 }
24}24}
lib/std/c/linux.zig+3
...@@ -320,6 +320,9 @@ pub const pthread_rwlock_t = switch (native_abi) {...@@ -320,6 +320,9 @@ pub const pthread_rwlock_t = switch (native_abi) {
320 size: [56]u8 align(@alignOf(usize)) = [_]u8{0} ** 56,320 size: [56]u8 align(@alignOf(usize)) = [_]u8{0} ** 56,
321 },321 },
322};322};
323pub usingnamespace if (native_abi == .android) struct {
324 pub const pthread_key_t = c_int;
325} else struct {};
323pub const sem_t = extern struct {326pub const sem_t = extern struct {
324 __size: [__SIZEOF_SEM_T]u8 align(@alignOf(usize)),327 __size: [__SIZEOF_SEM_T]u8 align(@alignOf(usize)),
325};328};