[glibc/azanella/clang] Fix inhibit_stack_protector for clang

Adhemerval Zanella azanella@sourceware.org
Wed Apr 17 20:04:57 GMT 2024


https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=68cbe438b55b250c651f69d731e5cf08f03a11cd

commit 68cbe438b55b250c651f69d731e5cf08f03a11cd
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 9 17:43:42 2022 -0300

    Fix inhibit_stack_protector for clang

Diff:
---
 include/libc-symbols.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 4367aa6740..0635e0dff7 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -365,8 +365,13 @@ for linking")
 /* Used to disable stack protection in sensitive places, like ifunc
    resolvers and early static TLS init.  */
 #ifdef HAVE_CC_NO_STACK_PROTECTOR
-# define inhibit_stack_protector \
+# ifdef __clang__
+#  define inhibit_stack_protector \
+     __attribute__((no_stack_protector))
+# else
+#  define inhibit_stack_protector \
     __attribute__ ((__optimize__ ("-fno-stack-protector")))
+# endif
 #else
 # define inhibit_stack_protector
 #endif


More information about the Glibc-cvs mailing list