From eadc79708f644b00680938906a62015240eda8ab Mon Sep 17 00:00:00 2001 From: Daniel Hammer Date: Thu, 16 Jul 2026 18:51:30 +0200 Subject: [PATCH] refactor: drop the bfd TLS workaround, binutils uses real TLS now With the TLS runtime landed (PT_TLS loading + per-thread FS base) and tls-test.elf passing on the OS, the sysdep.h hunk that degraded BFD's _Thread_local error state to plain globals is no longer needed. Native binutils is rebuilt with genuine thread-locals: the shipped tools now carry a PT_TLS segment and %fs-relative accesses, exercising the new runtime in every invocation. Co-Authored-By: Claude Fable 5 --- .../patches/binutils-2.43.1-montauk.patch | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/toolchain/patches/binutils-2.43.1-montauk.patch b/toolchain/patches/binutils-2.43.1-montauk.patch index 99a00b8..31bf02d 100644 --- a/toolchain/patches/binutils-2.43.1-montauk.patch +++ b/toolchain/patches/binutils-2.43.1-montauk.patch @@ -45,21 +45,3 @@ x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia* | x86_64-*-genode*) targ_emul=elf_x86_64 targ_extra_emuls="elf_i386 elf_iamcu elf32_x86_64" ---- a/bfd/sysdep.h -+++ b/bfd/sysdep.h -@@ -27,6 +27,15 @@ - #endif - - #include "config.h" -+ -+/* MontaukOS provides no runtime TLS yet (no FS-base setup, no PT_TLS -+ handling in the ELF loader), so a _Thread_local access traps at -+ %fs:0. Degrade BFD's thread-local error state to plain globals; -+ the native tools are single-threaded. */ -+#ifdef __montauk__ -+#undef TLS -+#define TLS -+#endif - #include - - #ifdef HAVE_SYS_TYPES_H