mapi: Massage code to allow clang to compile.
authorMatt Turner <mattst88@gmail.com>
Mon, 11 Jul 2016 17:44:25 +0000 (10:44 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 21 Jul 2016 17:45:28 +0000 (10:45 -0700)
According to https://llvm.org/bugs/show_bug.cgi?id=19778#c3 this code
was violating the spec, resulting in it failing to compile.

Cc: mesa-stable@lists.freedesktop.org
Co-authored-by: Tomasz Paweł Gajc <tpgxyz@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89599
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
configure.ac
src/mapi/entry_x86-64_tls.h
src/mapi/entry_x86_tls.h
src/mapi/entry_x86_tsd.h

index 3799d8dca30f6db47b0f1d84021d9b7df615bfcd..1ca8359b902251ef89863047cbe8ea1fff2725ef 100644 (file)
@@ -226,6 +226,7 @@ AX_GCC_FUNC_ATTRIBUTE([packed])
 AX_GCC_FUNC_ATTRIBUTE([pure])
 AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
 AX_GCC_FUNC_ATTRIBUTE([unused])
+AX_GCC_FUNC_ATTRIBUTE([visibility])
 AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
 AX_GCC_FUNC_ATTRIBUTE([weak])
 
index 38facccc870a1f7b5bae8e82bcc978b5d5897188..c5262a18ddb1ca442fc89a3646a0d405241d3ad5 100644 (file)
  *    Chia-I Wu <olv@lunarg.com>
  */
 
+#ifdef HAVE_FUNC_ATTRIBUTE_VISIBIITY
+#define HIDDEN __attribute__((visibility("hidden")))
+#else
+#define HIDDEN
+#endif
 
 __asm__(".text\n"
         ".balign 32\n"
@@ -54,8 +59,8 @@ entry_patch_public(void)
 {
 }
 
-static char
-x86_64_entry_start[];
+extern char
+x86_64_entry_start[] HIDDEN;
 
 mapi_func
 entry_get_public(int slot)
index 46d2eced24f87678c8ab781858e5d87ec3bbff15..231b4093fe6cd7e4f0c82175df4ef70b3207d53d 100644 (file)
 
 #include <string.h>
 
+#ifdef HAVE_FUNC_ATTRIBUTE_VISIBIITY
+#define HIDDEN __attribute__((visibility("hidden")))
+#else
+#define HIDDEN
+#endif
+
 __asm__(".text");
 
 __asm__("x86_current_tls:\n\t"
@@ -71,8 +77,8 @@ __asm__(".text");
 extern unsigned long
 x86_current_tls();
 
-static char x86_entry_start[];
-static char x86_entry_end[];
+extern char x86_entry_start[] HIDDEN;
+extern char x86_entry_end[] HIDDEN;
 
 void
 entry_patch_public(void)
index ea7bacb43e48c071bb6443c54f065dbaa2cc61ce..03d973520feeaeaff5430ca7040ac2a18678663f 100644 (file)
  *    Chia-I Wu <olv@lunarg.com>
  */
 
+#ifdef HAVE_FUNC_ATTRIBUTE_VISIBIITY
+#define HIDDEN __attribute__((visibility("hidden")))
+#else
+#define HIDDEN
+#endif
 
 #define X86_ENTRY_SIZE 32
 
@@ -58,8 +63,8 @@ __asm__(".balign 32\n"
 #include <string.h>
 #include "u_execmem.h"
 
-static const char x86_entry_start[];
-static const char x86_entry_end[];
+extern const char x86_entry_start[] HIDDEN;
+extern const char x86_entry_end[] HIDDEN;
 
 void
 entry_patch_public(void)