Skip to content

Commit 6b6eb8c

Browse files
committed
[llvm] Enable TLSDESC by default on Fuchsia targets
Fuchsia uses TLSDESC by default for all target architectures.
1 parent d6315af commit 6b6eb8c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

clang/test/Driver/tls-dialect.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
/// TLSDESC is not on by default in Linux, even on RISC-V, and is covered above
1111
// RUN: %clang -### --target=riscv64-android %s 2>&1 | FileCheck --check-prefix=DESC %s
1212

13+
/// Fuchsia supports TLSDESC by default for all architectures.
14+
// RUN: %clang -### --target=riscv64-unknown-fuchsia %s 2>&1 | FileCheck --check-prefix=DESC %s
15+
// RUN: %clang -### --target=aarch64-unknown-fuchsia %s 2>&1 | FileCheck --check-prefix=DESC %s
16+
// RUN: %clang -### --target=x86_64-unknown-fuchsia %s 2>&1 | FileCheck --check-prefix=DESC %s
17+
1318
/// LTO
1419
// RUN: %clang -### --target=loongarch64-linux -flto -mtls-dialect=desc %s 2>&1 | FileCheck --check-prefix=LTO-DESC %s
1520
// RUN: %clang -### --target=loongarch64-linux -flto %s 2>&1 | FileCheck --check-prefix=LTO-NODESC %s

llvm/include/llvm/TargetParser/Triple.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,9 @@ class Triple {
11191119

11201120
/// True if the target supports both general-dynamic and TLSDESC, and TLSDESC
11211121
/// is enabled by default.
1122-
bool hasDefaultTLSDESC() const { return isAndroid() && isRISCV64(); }
1122+
bool hasDefaultTLSDESC() const {
1123+
return (isAndroid() && isRISCV64()) || isOSFuchsia();
1124+
}
11231125

11241126
/// Tests whether the target uses -data-sections as default.
11251127
bool hasDefaultDataSections() const {

0 commit comments

Comments
 (0)