authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-07-30 18:59:08+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-07-31 17:08:25+02:00
log03facba4963abd142985c9617ca38de46b1615f1
tree54b3c5980fcb5c811e63244b9577e628b18a9a58
parent259b7c3f3fc3f8902f8aa4e6e7539df271073a47
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Target: require libc for Android API levels prior to 29

Emulated TLS depends on libc pthread functions. Closes #24589.

1 files changed, 6 insertions(+), 1 deletions(-)

lib/std/Target.zig+6-1
......@@ -2023,7 +2023,12 @@ pub fn requiresLibC(target: *const Target) bool {
20232023 .serenity,
20242024 => true,
20252025
2026 .linux
2026 // Android API levels prior to 29 did not have native TLS support. For these API levels, TLS
2027 // is implemented through calls to `__emutls_get_address`. We provide this function in
2028 // compiler-rt, but it's implemented by way of `pthread_key_create` et al, so linking libc
2029 // is required.
2030 .linux => target.abi.isAndroid() and target.os.version_range.linux.android < 29,
2031
20272032 .windows,
20282033 .freebsd,
20292034 .netbsd,