From d510d2aeb2facbd8f6c383d70fd1b033e1fee5dd Mon Sep 17 00:00:00 2001 From: Dan Klishch Date: Sat, 27 Apr 2024 23:09:43 -0400 Subject: [PATCH] LibC: Remove now redundant NO_TLS guards Since DynamicLoader is compiled with -fdata-sections and --gc-sections, unused thread_local variables won't create TLS section in it anymore. --- Userland/Libraries/LibC/dlfcn.cpp | 5 ----- Userland/Libraries/LibC/netdb.cpp | 4 ---- Userland/Libraries/LibC/netdb.h | 4 ---- 3 files changed, 13 deletions(-) diff --git a/Userland/Libraries/LibC/dlfcn.cpp b/Userland/Libraries/LibC/dlfcn.cpp index 0fe1ffa401d..ef578297fa4 100644 --- a/Userland/Libraries/LibC/dlfcn.cpp +++ b/Userland/Libraries/LibC/dlfcn.cpp @@ -17,13 +17,8 @@ [[gnu::weak]] Result __dladdr(void const*, Dl_info*) asm("__dladdr"); // FIXME: use thread_local and a String once TLS works -#ifdef NO_TLS -char* s_dlerror_text = NULL; -bool s_dlerror_retrieved = false; -#else __thread char* s_dlerror_text = NULL; __thread bool s_dlerror_retrieved = false; -#endif static void store_error(ByteString const& error) { diff --git a/Userland/Libraries/LibC/netdb.cpp b/Userland/Libraries/LibC/netdb.cpp index f4a55ecf8ff..b3b44130e36 100644 --- a/Userland/Libraries/LibC/netdb.cpp +++ b/Userland/Libraries/LibC/netdb.cpp @@ -19,11 +19,7 @@ extern "C" { -#ifdef NO_TLS -int h_errno; -#else __thread int h_errno; -#endif static hostent __gethostbyname_buffer; static in_addr_t __gethostbyname_address; diff --git a/Userland/Libraries/LibC/netdb.h b/Userland/Libraries/LibC/netdb.h index a111e2142b1..3a40ca04d9a 100644 --- a/Userland/Libraries/LibC/netdb.h +++ b/Userland/Libraries/LibC/netdb.h @@ -55,11 +55,7 @@ struct protoent* getprotobynumber(int proto); struct protoent* getprotoent(void); void setprotoent(int stay_open); -#ifdef NO_TLS -extern int h_errno; -#else extern __thread int h_errno; -#endif #define HOST_NOT_FOUND 101 #define NO_DATA 102