[Mesa-dev] [PATCH 2/4] add visibility hidden to tls entry points

Matt Turner mattst88 at gmail.com
Mon Feb 16 10:25:20 PST 2015


On Mon, Feb 16, 2015 at 1:36 AM, Marc Dietrich <marvin24 at gmx.de> wrote:
> Avoid redefined symbol errors in clang. Based on a suggestion from
> Rafael à vila de Espíndola <rafael.espindola at gmail.com> in
> http://llvm.org/bugs/show_bug.cgi?id=19778.
>
> Signed-off-by: Marc Dietrich <marvin24 at gmx.de>
> ---
>  src/mapi/entry_x86-64_tls.h | 3 ++-
>  src/mapi/entry_x86_tls.h    | 5 +++--
>  src/mapi/entry_x86_tsd.h    | 5 +++--
>  3 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/src/mapi/entry_x86-64_tls.h b/src/mapi/entry_x86-64_tls.h
> index 71e9d60..d36556c 100644
> --- a/src/mapi/entry_x86-64_tls.h
> +++ b/src/mapi/entry_x86-64_tls.h
> @@ -26,6 +26,7 @@
>   */
>
>  #include "u_macros.h"
> +#include "../util/macros.h"

Let's add -I$(top_srcdir)src/util to src/mapi/Makefile.am's
AM_CPPFLAGS and include "util/macros.h". Occurs again in this patch.

>
>  __asm__(".text\n"
>          ".balign 32\n"
> @@ -62,7 +63,7 @@ entry_patch_public(void)
>  {
>  }
>
> -static char
> +extern char HIDDEN

So, reading the bug report... adding extern HIDDEN is kind of a hack.

I have some patches in a wip branch that attempt to make LTO work, and
one of them replaces the __asm__ seen at the end of the previous hunk
with

static void
__attribute__((__used__))
x86_64_entry_start()
{
}

and just removes this char[] declaration. It /seems/ to work. I
suspect we'd also want to use aligned function attribute (and use
macros for the attributes).

Interested in giving that a try?


More information about the mesa-dev mailing list