mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 21:08:36 +00:00
Don't initialize the static TLS area in single-threaded builds
This commit is contained in:
parent
ed23615638
commit
b89158d6fd
@ -437,20 +437,22 @@ fn posixCallMainAndExit() callconv(.C) noreturn {
|
||||
std.os.linux.pie.relocate(phdrs);
|
||||
}
|
||||
|
||||
// ARMv6 targets (and earlier) have no support for TLS in hardware.
|
||||
// FIXME: Elide the check for targets >= ARMv7 when the target feature API
|
||||
// becomes less verbose (and more usable).
|
||||
if (comptime native_arch.isARM()) {
|
||||
if (at_hwcap & std.os.linux.HWCAP.TLS == 0) {
|
||||
// FIXME: Make __aeabi_read_tp call the kernel helper kuser_get_tls
|
||||
// For the time being use a simple abort instead of a @panic call to
|
||||
// keep the binary bloat under control.
|
||||
std.os.abort();
|
||||
if (!builtin.single_threaded) {
|
||||
// ARMv6 targets (and earlier) have no support for TLS in hardware.
|
||||
// FIXME: Elide the check for targets >= ARMv7 when the target feature API
|
||||
// becomes less verbose (and more usable).
|
||||
if (comptime native_arch.isARM()) {
|
||||
if (at_hwcap & std.os.linux.HWCAP.TLS == 0) {
|
||||
// FIXME: Make __aeabi_read_tp call the kernel helper kuser_get_tls
|
||||
// For the time being use a simple abort instead of a @panic call to
|
||||
// keep the binary bloat under control.
|
||||
std.os.abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize the TLS area.
|
||||
std.os.linux.tls.initStaticTLS(phdrs);
|
||||
// Initialize the TLS area.
|
||||
std.os.linux.tls.initStaticTLS(phdrs);
|
||||
}
|
||||
|
||||
// The way Linux executables represent stack size is via the PT_GNU_STACK
|
||||
// program header. However the kernel does not recognize it; it always gives 8 MiB.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user