From: Uros Bizjak Date: Sun, 17 Aug 2025 15:49:54 +0000 (+0200) Subject: x86_64: Remove stalled __GNUC_PREREQ (6, 0) test in THREAD_SELF() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=thirdparty%2Fglibc.git x86_64: Remove stalled __GNUC_PREREQ (6, 0) test in THREAD_SELF() Currenty GCC-12 is required as the minimum supported compiler version. Remove stalled __GNUC_PREREQ (6, 0) test for GCC compiler version in THREAD_SELF() macro definition. Signed-off-by: Uros Bizjak Cc: H.J.Lu Cc: Florian Weimer Cc: Carlos O'Donell Reviewed-by: H.J. Lu --- diff --git a/sysdeps/x86_64/nptl/tls.h b/sysdeps/x86_64/nptl/tls.h index 551d342d52..29b028cdcd 100644 --- a/sysdeps/x86_64/nptl/tls.h +++ b/sysdeps/x86_64/nptl/tls.h @@ -168,22 +168,9 @@ _Static_assert (offsetof (tcbhead_t, __glibc_unused2) == 0x80, THREAD_GETMEM (__pd, header.dtv); }) -/* Return the thread descriptor for the current thread. - - The contained asm must *not* be marked volatile since otherwise - assignments like - pthread_descr self = thread_self(); - do not get optimized away. */ -# if __GNUC_PREREQ (6, 0) +/* Return the thread descriptor for the current thread. */ # define THREAD_SELF \ (*(struct pthread *__seg_fs *) offsetof (struct pthread, header.self)) -# else -# define THREAD_SELF \ - ({ struct pthread *__self; \ - asm ("mov %%fs:%c1,%0" : "=r" (__self) \ - : "i" (offsetof (struct pthread, header.self))); \ - __self;}) -# endif /* Magic for libthread_db to know how to do THREAD_SELF. */ # define DB_THREAD_SELF_INCLUDE /* For the FS constant. */