diff --git a/lib/std/core/env.c3 b/lib/std/core/env.c3 index 81217f7c0..f8525fb6d 100644 --- a/lib/std/core/env.c3 +++ b/lib/std/core/env.c3 @@ -159,6 +159,7 @@ const bool MEMORY_SANITIZER = $$MEMORY_SANITIZER; const bool THREAD_SANITIZER = $$THREAD_SANITIZER; const bool ANY_SANITIZER = ADDRESS_SANITIZER || MEMORY_SANITIZER || THREAD_SANITIZER; const int LANGUAGE_DEV_VERSION = $$LANGUAGE_DEV_VERSION; +const bool HAS_NATIVE_ERRNO = env::LINUX || env::ANDROID || env::DARWIN || env::WIN32; macro bool os_is_darwin() @const { diff --git a/lib/std/libc/os/errno.c3 b/lib/std/libc/os/errno.c3 index 3c1c3ee29..01c68438c 100644 --- a/lib/std/libc/os/errno.c3 +++ b/lib/std/libc/os/errno.c3 @@ -1,7 +1,6 @@ module libc::os @if(env::LIBC); import std::core::env; -const HAS_NATIVE_ERRNO = env::LINUX || env::ANDROID || env::DARWIN || env::WIN32; // Linux extern fn int* __errno_location() @if(env::LINUX); macro int errno() @if(env::LINUX) => *__errno_location(); @@ -29,7 +28,7 @@ extern fn void _get_errno(int* result) @if(env::WIN32); extern fn void _set_errno(int err) @if(env::WIN32); // Default -module libc::os @if(!env::LIBC || !HAS_NATIVE_ERRNO); +module libc::os @if(!env::LIBC || !env::HAS_NATIVE_ERRNO); tlocal int _errno_c3 = 0; fn void errno_set(int err) => _errno_c3 = err; fn int errno() => _errno_c3; diff --git a/src/compiler/linker.c b/src/compiler/linker.c index 29be6511a..45a7b7a2e 100644 --- a/src/compiler/linker.c +++ b/src/compiler/linker.c @@ -463,6 +463,11 @@ static void linker_setup_linux(const char ***args_ref, Linker linker_type, bool static void linker_setup_android(const char ***args_ref, Linker linker_type, bool is_dylib) { + if (!compiler.build.android.ndk_path) + { + linker_setup_linux(args_ref, linker_type, is_dylib); + return; + } #ifdef __linux__ #define ANDROID_HOST_TAG "linux-x86_64" #elif __APPLE__