| ... | ... | @@ -133,7 +133,7 @@ pub fn initTLS() void { |
| 133 | 133 | var at_phent: usize = undefined; |
| 134 | 134 | var at_phnum: usize = undefined; |
| 135 | 135 | var at_phdr: usize = undefined; |
| 136 | | var at_hwcap: ?usize = null; |
| 136 | var at_hwcap: usize = undefined; |
| 137 | 137 | |
| 138 | 138 | var i: usize = 0; |
| 139 | 139 | while (auxv[i].a_type != std.elf.AT_NULL) : (i += 1) { |
| ... | ... | @@ -146,16 +146,6 @@ pub fn initTLS() void { |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | | // If the cpu is arm-based, check if it supports the TLS register |
| 150 | | if (at_hwcap) |hwcap| { |
| 151 | | if (builtin.arch == builtin.Arch.arm and hwcap & std.os.linux.HWCAP_TLS == 0) { |
| 152 | | // If the CPU does not support TLS via a coprocessor register, |
| 153 | | // a kernel helper function can be used instead on certain linux kernels. |
| 154 | | // See linux/arch/arm/include/asm/tls.h and musl/src/thread/arm/__set_thread_area.c. |
| 155 | | @panic("TODO: Implement ARM fallback TLS functionality"); |
| 156 | | } |
| 157 | | } |
| 158 | | |
| 159 | 149 | // Sanity check |
| 160 | 150 | assert(at_phent == @sizeOf(elf.Phdr)); |
| 161 | 151 | |
| ... | ... | @@ -171,6 +161,14 @@ pub fn initTLS() void { |
| 171 | 161 | } |
| 172 | 162 | |
| 173 | 163 | if (tls_phdr) |phdr| { |
| 164 | // If the cpu is arm-based, check if it supports the TLS register |
| 165 | if (builtin.arch == builtin.Arch.arm and hwcap & std.os.linux.HWCAP_TLS == 0) { |
| 166 | // If the CPU does not support TLS via a coprocessor register, |
| 167 | // a kernel helper function can be used instead on certain linux kernels. |
| 168 | // See linux/arch/arm/include/asm/tls.h and musl/src/thread/arm/__set_thread_area.c. |
| 169 | @panic("TODO: Implement ARM fallback TLS functionality"); |
| 170 | } |
| 171 | |
| 174 | 172 | // Offsets into the allocated TLS area |
| 175 | 173 | var tcb_offset: usize = undefined; |
| 176 | 174 | var dtv_offset: usize = undefined; |