| ... | @@ -437,20 +437,22 @@ fn posixCallMainAndExit() callconv(.C) noreturn { | ... | @@ -437,20 +437,22 @@ fn posixCallMainAndExit() callconv(.C) noreturn { |
| 437 | std.os.linux.pie.relocate(phdrs); | 437 | std.os.linux.pie.relocate(phdrs); |
| 438 | } | 438 | } |
| 439 | | 439 | |
| 440 | // ARMv6 targets (and earlier) have no support for TLS in hardware. | 440 | if (!builtin.single_threaded) { |
| 441 | // FIXME: Elide the check for targets >= ARMv7 when the target feature API | 441 | // ARMv6 targets (and earlier) have no support for TLS in hardware. |
| 442 | // becomes less verbose (and more usable). | 442 | // FIXME: Elide the check for targets >= ARMv7 when the target feature API |
| 443 | if (comptime native_arch.isARM()) { | 443 | // becomes less verbose (and more usable). |
| 444 | if (at_hwcap & std.os.linux.HWCAP.TLS == 0) { | 444 | if (comptime native_arch.isARM()) { |
| 445 | // FIXME: Make __aeabi_read_tp call the kernel helper kuser_get_tls | 445 | if (at_hwcap & std.os.linux.HWCAP.TLS == 0) { |
| 446 | // For the time being use a simple abort instead of a @panic call to | 446 | // FIXME: Make __aeabi_read_tp call the kernel helper kuser_get_tls |
| 447 | // keep the binary bloat under control. | 447 | // For the time being use a simple abort instead of a @panic call to |
| 448 | std.os.abort(); | 448 | // keep the binary bloat under control. |
| | 449 | std.os.abort(); |
| | 450 | } |
| 449 | } | 451 | } |
| 450 | } | | |
| 451 | | 452 | |
| 452 | // Initialize the TLS area. | 453 | // Initialize the TLS area. |
| 453 | std.os.linux.tls.initStaticTLS(phdrs); | 454 | std.os.linux.tls.initStaticTLS(phdrs); |
| | 455 | } |
| 454 | | 456 | |
| 455 | // The way Linux executables represent stack size is via the PT_GNU_STACK | 457 | // The way Linux executables represent stack size is via the PT_GNU_STACK |
| 456 | // program header. However the kernel does not recognize it; it always gives 8 MiB. | 458 | // program header. However the kernel does not recognize it; it always gives 8 MiB. |