unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Fangrui Song via Libc-alpha <libc-alpha@sourceware.org>
To: Szabolcs Nagy <szabolcs.nagy@arm.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v2] aarch64: Skip traditional GD/LD TLS which are unsupported by Clang and LLD [BZ #28205]
Date: Wed, 11 Aug 2021 08:57:18 -0700	[thread overview]
Message-ID: <20210811155718.f3hvsh2y5ddaaebs@google.com> (raw)
In-Reply-To: <20210811121740.GL20410@arm.com>

On 2021-08-11, Szabolcs Nagy wrote:
>The 08/10/2021 14:14, Fangrui Song via Libc-alpha wrote:
>> On 2021-08-10, Fangrui Song wrote:
>> > TLSDESC is the default on aarch64.  Clang doesn't support
>> > -mtls-dialect=trad.  Its integrated assembler doesn't support the
>> > marker.  LLD's doesn't support R_AARCH64_TLSGD_*/R_AARCH64_TLSLD_*
>> > relocations.  Just skip the tests.
>> >
>> > With https://sourceware.org/pipermail/libc-alpha/2021-August/129966.html
>> > ("aarch64: Make elf_machine_{load_address, dynamic} robust [BZ #28203]"),
>> > if we allow LLD in configure.ac,
>> > `make check` test results of LLD are on par with GNU ld.
>>
>> I messed up in the diff.
>> The correct diff needs `#include <config.h>` to make HAVE_TRAD_TLS
>> defined.
>
>the fixed patch looks good to me.
>
>but now i looked at elf/tls-macros.h and it seems
>to be for when there is on compiler support.
>
>i think the only thing the compiler does not
>support is mixing different tls access models to a
>variable in the same tu, but i'm not sure if that's
>useful or necessary for the tests: we can use many
>files with different -ftls-model= or
>__attribute__((tls_model(...))).
>
>is there a need for these hard to maintain macros?

In GCC, mixing different tls access models to a variable in the same tu
can be emulated by:

   __thread int a __attribute__((tls_model("global-dynamic")));
   extern __thread int b __attribute__((alias("a"), tls_model("initial-exec")));

In Clang only one model is used.


Seems a good idea to switch them to variable attributes.

  reply	other threads:[~2021-08-11 15:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 21:02 [PATCH v2] aarch64: Skip traditional GD/LD TLS which are unsupported by Clang and LLD [BZ #28205] Fangrui Song via Libc-alpha
2021-08-10 21:14 ` Fangrui Song via Libc-alpha
2021-08-11 12:17   ` Szabolcs Nagy via Libc-alpha
2021-08-11 15:57     ` Fangrui Song via Libc-alpha [this message]
2021-08-11 21:34       ` Fangrui Song via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210811155718.f3hvsh2y5ddaaebs@google.com \
    --to=libc-alpha@sourceware.org \
    --cc=maskray@google.com \
    --cc=szabolcs.nagy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).