| author | |
| committer | |
| log | 55f0d8b41cc0c633effe51554f1bc67793f62623 |
| tree | 96f927ae71b5b4839688e90fae26cf26cd55bd24 |
| parent | 2651363c9d769ddb607c0eb7f93a1a90ba86b9e1 |
I have updated Felix's ZigAndroidTemplate to work with the latest
version of Zig and we are exploring adding Android support to Mach engine.
`std.c.getcontext` is _referenced_ but not _used_, and Android's bionic libc
does not implement `getcontext`. `std.os.linux.getcontext` also cannot be
used with bionic libc, so it seems prudent to just disable this extern for now.
This may not be the perfect long-term fix, but I have a golden rebuttal to that:
before I was unable to compile Zig applications for Android, and now I can.
<img width="828" alt="image" src="https://github.com/hexops/mach/assets/3173176/1e29142b-0419-4459-9c8b-75d92f87f822">
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>1 files changed, 5 insertions(+), 1 deletions(-)
lib/std/c.zig+5-1| ... | ... | @@ -408,7 +408,11 @@ pub extern "c" fn setlogmask(maskpri: c_int) c_int; |
| 408 | 408 | |
| 409 | 409 | pub extern "c" fn if_nametoindex([*:0]const u8) c_int; |
| 410 | 410 | |
| 411 | pub usingnamespace if (builtin.os.tag == .linux and builtin.target.isMusl()) struct { | |
| 411 | pub usingnamespace if (builtin.target.isAndroid()) struct { | |
| 412 | // android bionic libc does not implement getcontext, | |
| 413 | // and std.os.linux.getcontext also cannot be built for | |
| 414 | // bionic libc currently. | |
| 415 | } else if (builtin.os.tag == .linux and builtin.target.isMusl()) struct { | |
| 412 | 416 | // musl does not implement getcontext |
| 413 | 417 | pub const getcontext = std.os.linux.getcontext; |
| 414 | 418 | } else struct { |