fix(android): pass --sysroot when compiling the android glue code

This prevents a `function-like macro '__GLIBC_USE' is not defined`
compilation error from happening with newer NDK versions (I tried r28)
This commit is contained in:
Hisham Aburaqibah
2025-04-05 11:22:05 +02:00
parent ef49d2f0b8
commit 106427b127

View File

@@ -655,6 +655,11 @@ try_cross_linking:;
glue = gb_string_append_length(glue, android_glue_object.text, android_glue_object.len);
glue = gb_string_appendc(glue, "\" ");
glue = gb_string_appendc(glue, "--sysroot \"");
glue = gb_string_append_length(glue, ODIN_ANDROID_NDK_TOOLCHAIN.text, ODIN_ANDROID_NDK_TOOLCHAIN.len);
glue = gb_string_appendc(glue, "sysroot");
glue = gb_string_appendc(glue, "\" ");
glue = gb_string_appendc(glue, "\"-I");
glue = gb_string_append_length(glue, ODIN_ANDROID_NDK_TOOLCHAIN.text, ODIN_ANDROID_NDK_TOOLCHAIN.len);
glue = gb_string_appendc(glue, "sysroot/usr/include/");