Function requiresLibC [src]

Does this target require linking libc? This may be the case if the target has an unstable syscall interface, for example.

Prototype

pub fn requiresLibC(target: *const Target) bool

Parameters

target: *const Target

Source

pub fn requiresLibC(target: *const Target) bool { return switch (target.os.tag) { .aix, .driverkit, .macos, .ios, .tvos, .watchos, .visionos, .dragonfly, .openbsd, .haiku, .solaris, .illumos, .serenity, => true, // 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, .freestanding, .fuchsia, .managarm, .ps3, .zos, .rtems, .cuda, .nvcl, .amdhsa, .ps4, .ps5, .vita, .mesa3d, .contiki, .amdpal, .hermit, .hurd, .wasi, .emscripten, .uefi, .opencl, .opengl, .vulkan, .plan9, .other, .@"3ds", => false, }; }