From e4a977f9e41165168fed7628134c701e9060a741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Thu, 26 Mar 2026 05:42:23 +0100 Subject: [PATCH] compiler: do not enforce PIC for Android This requirement was put here many years ago in stage1 and I have no idea why because Android does not actually require PIC. --- src/target.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/target.zig b/src/target.zig index e5df8c86a7a0a409011cac1d7303eb4f8d54e794..43858ea5f200b4f0b4a2271b158e22d2313d62ca 100644 --- a/src/target.zig +++ b/src/target.zig @@ -54,8 +54,7 @@ pub fn libCxxNeedsLibUnwind(target: *const std.Target) bool { /// This function returns whether non-pic code is completely invalid on the given target. pub fn requiresPic(target: *const std.Target, linking_libc: bool) bool { - return target.abi.isAndroid() or - ((target.os.tag == .windows or target.os.tag == .uefi) and (target.cpu.arch == .aarch64 or target.cpu.arch == .x86_64)) or + return ((target.os.tag == .windows or target.os.tag == .uefi) and (target.cpu.arch == .aarch64 or target.cpu.arch == .x86_64)) or target.requiresLibC() or (linking_libc and target.isGnuLibC()); } -- 2.54.0