public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/maskray/grte] Add clang version of __hidden_proto
@ 2021-08-27 23:20 Fangrui Song
  0 siblings, 0 replies; only message in thread
From: Fangrui Song @ 2021-08-27 23:20 UTC (permalink / raw)
  To: glibc-cvs

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

commit c9a3019796caed959028d9fe531d5f224c1fb791
Author: Stan Shebs <stanshebs@google.com>
Date:   Fri Jan 19 12:23:55 2018 -0800

    Add clang version of __hidden_proto

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

diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 6137304b0b..eb4dbbe777 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -459,9 +459,19 @@ for linking")
   __hidden_proto (name, , __GI_##name, ##attrs)
 #  define hidden_tls_proto(name, attrs...) \
   __hidden_proto (name, __thread, __GI_##name, ##attrs)
+#ifndef __clang__
 #  define __hidden_proto(name, thread, internal, attrs...)	     \
   extern thread __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
   __hidden_proto_hiddenattr (attrs);
+#else
+# define __hidden_proto(name, thread, internal, attrs...)	     \
+  extern thread __typeof (name) name \
+  __hidden_proto_hiddenattr (attrs); \
+  _Pragma (__redefine(name, internal))
+/* Note that this macro does not use __hidden_asmname, since it produces a string.  */
+#  define __redefine(name, internal) __stringize(redefine_extname name internal)
+#  define __stringize(X) #X
+#endif
 #  define __hidden_asmname(name) \
   __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
 #  define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-27 23:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27 23:20 [glibc/maskray/grte] Add clang version of __hidden_proto Fangrui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).