| ... | @@ -69,16 +69,16 @@ fn posixCallMainAndExit() noreturn { | ... | @@ -69,16 +69,16 @@ fn posixCallMainAndExit() noreturn { |
| 69 | const envp = @ptrCast([*][*]u8, envp_optional)[0..envp_count]; | 69 | const envp = @ptrCast([*][*]u8, envp_optional)[0..envp_count]; |
| 70 | | 70 | |
| 71 | if (builtin.os == builtin.Os.linux) { | 71 | if (builtin.os == builtin.Os.linux) { |
| | 72 | // Find the beginning of the auxiliary vector |
| 72 | const auxv = @ptrCast([*]std.elf.Auxv, envp.ptr + envp_count + 1); | 73 | const auxv = @ptrCast([*]std.elf.Auxv, envp.ptr + envp_count + 1); |
| 73 | std.os.linux_elf_aux_maybe = auxv; | 74 | std.os.linux_elf_aux_maybe = auxv; |
| 74 | | 75 | // Initialize the TLS area |
| 75 | std.os.linux.tls.initTLS(); | 76 | std.os.linux.tls.initTLS(); |
| 76 | if (!builtin.single_threaded) { | 77 | |
| 77 | if (std.os.linux.tls.tls_image) |tls_img| { | 78 | if (std.os.linux.tls.tls_image) |tls_img| { |
| 78 | const tls_addr = std.os.linux.tls.allocateTLS(tls_img.alloc_size); | 79 | const tls_addr = std.os.linux.tls.allocateTLS(tls_img.alloc_size); |
| 79 | const tp = std.os.linux.tls.copyTLS(tls_addr); | 80 | const tp = std.os.linux.tls.copyTLS(tls_addr); |
| 80 | std.os.linux.tls.setThreadPointer(tp); | 81 | std.os.linux.tls.setThreadPointer(tp); |
| 81 | } | | |
| 82 | } | 82 | } |
| 83 | } | 83 | } |
| 84 | | 84 | |