diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-09-28 13:30:19 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-28 13:30:19 -0400 |
| commit | 543e729398c2ae2a6fbae8ab54ce0737d35004a0 (patch) | |
| tree | 0d2e1a26dd54da64ac6e8183212dfb7032b47b3a /src/target.cpp | |
| parent | ce0e7940926ec4c4eeb95e2d5b67554de3863a56 (diff) | |
| parent | 030abfa0d2a95fb5cb9da61c59bb8332c65f8819 (diff) | |
| download | zig-543e729398c2ae2a6fbae8ab54ce0737d35004a0.tar.gz zig-543e729398c2ae2a6fbae8ab54ce0737d35004a0.zip | |
Merge pull request #3331 from meme/android-ndk
Support Android NDK
Diffstat (limited to 'src/target.cpp')
| -rw-r--r-- | src/target.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/target.cpp b/src/target.cpp index be85fff7b4..1cab9253a0 100644 --- a/src/target.cpp +++ b/src/target.cpp @@ -1594,10 +1594,14 @@ bool target_supports_stack_probing(const ZigTarget *target) { bool target_requires_pic(const ZigTarget *target, bool linking_libc) { // This function returns whether non-pic code is completely invalid on the given target. - return target->os == OsWindows || target->os == OsUefi || target_os_requires_libc(target->os) || + return target_is_android(target) || target->os == OsWindows || target->os == OsUefi || target_os_requires_libc(target->os) || (linking_libc && target_is_glibc(target)); } +bool target_requires_pie(const ZigTarget *target) { + return target_is_android(target); +} + bool target_is_glibc(const ZigTarget *target) { return target->os == OsLinux && target_abi_is_gnu(target->abi); } @@ -1880,7 +1884,7 @@ bool target_supports_libunwind(const ZigTarget *target) { } bool target_libc_needs_crti_crtn(const ZigTarget *target) { - if (target->arch == ZigLLVM_riscv32 || target->arch == ZigLLVM_riscv64) { + if (target->arch == ZigLLVM_riscv32 || target->arch == ZigLLVM_riscv64 || target_is_android(target)) { return false; } return true; |
