Support compiling for the android NDK (#13245)

This commit is contained in:
Louis Pearson 2022-10-21 16:32:56 -06:00 committed by GitHub
parent 3b2f0c3eee
commit 8d4778b4f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -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,

View File

@ -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 });
}
}

View File

@ -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)),
};