5 Commits

Author SHA1 Message Date
Paul Kirth
08c76730f3
[llvm] Enable TLSDESC by default on Fuchsia targets (#124990)
Fuchsia uses TLSDESC by default for all target architectures. We also
make the comment and check for hasDefaultTLSDESC more accurately reflect
its usage.
2025-01-30 10:25:25 -08:00
wanglei
eb148aecb3
[LoongArch][Codegen] Add support for TLSDESC
The implementation only enables when the `-enable-tlsdesc` option is
passed and the TLS model is `dynamic`.

LoongArch's GCC has the same option(-mtls-dialet=) as RISC-V.

Reviewers: heiher, MaskRay, SixWeining

Reviewed By: SixWeining, MaskRay

Pull Request: https://github.com/llvm/llvm-project/pull/90159
2024-04-30 15:14:44 +08:00
Phoebe Wang
f4676b6be6
[X86] Add Support for X86 TLSDESC Relocations (#83136) 2024-03-15 22:09:56 +08:00
Paul Kirth
407f9c06ea
[clang][driver] Set TLSDESC as the default for Android on RISC-V (#81198) 2024-02-09 10:33:58 -08:00
Fangrui Song
36b4a9ccd9
[Driver,CodeGen] Support -mtls-dialect= (#79256)
GCC supports -mtls-dialect= for several architectures to select TLSDESC.
This patch supports the following values

* x86: "gnu". "gnu2" (TLSDESC) is not supported yet.
* RISC-V: "trad" (general dynamic), "desc" (TLSDESC, see #66915)

AArch64 toolchains seem to support TLSDESC from the beginning, and the
general dynamic model has poor support. Nobody seems to use the option
-mtls-dialect= at all, so we don't bother with it.
There also seems very little interest in AArch32's TLSDESC support.

TLSDESC does not change IR, but affects object file generation. Without
a backend option the option is a no-op for in-process ThinLTO.

There seems no motivation to have fine-grained control mixing trad/desc
for TLS, so we just pass -mllvm, and don't bother with a modules flag
metadata or function attribute.

Co-authored-by: Paul Kirth <paulkirth@google.com>
2024-01-26 09:25:38 -08:00