diff --git a/CMakeLists.txt b/CMakeLists.txt index 62fd60c7534..992292e470c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,11 +93,6 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -if("${SERENITY_ARCH}" STREQUAL "x86_64") - # FIXME: Implement TLS support and get rid of this - add_compile_definitions(NO_TLS X86_64_NO_TLS) -endif() - add_compile_options(-Wno-literal-suffix) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") add_compile_options(-fconcepts) diff --git a/Userland/Libraries/LibC/pthread_tls.cpp b/Userland/Libraries/LibC/pthread_tls.cpp index 393964a7ed1..6c32260dcd4 100644 --- a/Userland/Libraries/LibC/pthread_tls.cpp +++ b/Userland/Libraries/LibC/pthread_tls.cpp @@ -26,10 +26,7 @@ struct SpecificTable { static KeyTable s_keys; -# ifndef X86_64_NO_TLS -__thread -# endif - SpecificTable t_specifics; +__thread SpecificTable t_specifics; int __pthread_key_create(pthread_key_t* key, KeyDestructor destructor) { diff --git a/Userland/Libraries/LibDl/dlfcn.cpp b/Userland/Libraries/LibDl/dlfcn.cpp index 861df60476d..077f62a101e 100644 --- a/Userland/Libraries/LibDl/dlfcn.cpp +++ b/Userland/Libraries/LibDl/dlfcn.cpp @@ -11,16 +11,8 @@ #include // FIXME: use thread_local and a String once TLS works -#ifndef X86_64_NO_TLS -__thread -#endif - char* s_dlerror_text - = NULL; -#ifndef X86_64_NO_TLS -__thread -#endif - bool s_dlerror_retrieved - = false; +__thread char* s_dlerror_text = NULL; +__thread bool s_dlerror_retrieved = false; static void store_error(const String& error) { diff --git a/Userland/Libraries/LibPthread/pthread.cpp b/Userland/Libraries/LibPthread/pthread.cpp index 874f2dbb814..fcfc5b5864f 100644 --- a/Userland/Libraries/LibPthread/pthread.cpp +++ b/Userland/Libraries/LibPthread/pthread.cpp @@ -33,14 +33,8 @@ static constexpr size_t required_stack_alignment = 4 * MiB; static constexpr size_t highest_reasonable_guard_size = 32 * PAGE_SIZE; static constexpr size_t highest_reasonable_stack_size = 8 * MiB; // That's the default in Ubuntu? -#ifndef X86_64_NO_TLS -__thread -#endif - void* s_stack_location; -#ifndef X86_64_NO_TLS -__thread -#endif - size_t s_stack_size; +__thread void* s_stack_location; +__thread size_t s_stack_size; #define __RETURN_PTHREAD_ERROR(rc) \ return ((rc) < 0 ? -(rc) : 0)