diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-06-29 17:56:04 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-30 15:13:30 +0200 |
commit | fe2716df216ec4a31818f6f1c0a47d64454a23f0 (patch) | |
tree | e8135fe4170c4dd6ab785b0a6e58042167a922df /Userland | |
parent | c0bd2c06919b43f37acec2baea8187cfe6473b97 (diff) | |
download | serenity-fe2716df216ec4a31818f6f1c0a47d64454a23f0.zip |
Kernel: Disable __thread and TLS on x86_64 for now
They're not yet properly supported.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibC/pthread_tls.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibDl/dlfcn.cpp | 12 | ||||
-rw-r--r-- | Userland/Libraries/LibPthread/pthread.cpp | 10 |
3 files changed, 22 insertions, 5 deletions
diff --git a/Userland/Libraries/LibC/pthread_tls.cpp b/Userland/Libraries/LibC/pthread_tls.cpp index 6c32260dcd..393964a7ed 100644 --- a/Userland/Libraries/LibC/pthread_tls.cpp +++ b/Userland/Libraries/LibC/pthread_tls.cpp @@ -26,7 +26,10 @@ struct SpecificTable { static KeyTable s_keys; -__thread SpecificTable t_specifics; +# ifndef X86_64_NO_TLS +__thread +# endif + 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 077f62a101..861df60476 100644 --- a/Userland/Libraries/LibDl/dlfcn.cpp +++ b/Userland/Libraries/LibDl/dlfcn.cpp @@ -11,8 +11,16 @@ #include <string.h> // FIXME: use thread_local and a String once TLS works -__thread char* s_dlerror_text = NULL; -__thread bool s_dlerror_retrieved = false; +#ifndef X86_64_NO_TLS +__thread +#endif + char* s_dlerror_text + = NULL; +#ifndef X86_64_NO_TLS +__thread +#endif + 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 763de5b74d..831145d106 100644 --- a/Userland/Libraries/LibPthread/pthread.cpp +++ b/Userland/Libraries/LibPthread/pthread.cpp @@ -33,8 +33,14 @@ 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? -__thread void* s_stack_location; -__thread size_t s_stack_size; +#ifndef X86_64_NO_TLS +__thread +#endif + void* s_stack_location; +#ifndef X86_64_NO_TLS +__thread +#endif + size_t s_stack_size; #define __RETURN_PTHREAD_ERROR(rc) \ return ((rc) < 0 ? -(rc) : 0) |