diff --git a/userspace/libraries/LibC/pthread.cpp b/userspace/libraries/LibC/pthread.cpp
index 52da1a07ed..d6f98d3967 100644
--- a/userspace/libraries/LibC/pthread.cpp
+++ b/userspace/libraries/LibC/pthread.cpp
@@ -362,6 +362,7 @@ int pthread_spin_unlock(pthread_spinlock_t* lock)
 	return 0;
 }
 
+#if not __disable_thread_local_storage
 struct tls_index
 {
 	unsigned long int ti_module;
@@ -379,3 +380,4 @@ extern "C" void* __attribute__((__regparm__(1))) ___tls_get_addr(tls_index* ti)
 	return reinterpret_cast<void*>(get_uthread()->dtv[ti->ti_module] + ti->ti_offset);
 }
 #endif
+#endif