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

Emulated TLS depends on libc pthread functions.

Closes #24589.
This commit is contained in:
Alex Rønne Petersen 2025-07-30 18:59:08 +02:00
parent 259b7c3f3f
commit 03facba496
No known key found for this signature in database

View File

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