-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[llvm] Enable TLSDESC by default on Fuchsia targets #124990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: Paul Kirth (ilovepi) ChangesFuchsia uses TLSDESC by default for all target architectures. Full diff: https://github.com/llvm/llvm-project/pull/124990.diff 2 Files Affected:
diff --git a/clang/test/Driver/tls-dialect.c b/clang/test/Driver/tls-dialect.c
index 3471b55b0ebae9..9ab79e87353d88 100644
--- a/clang/test/Driver/tls-dialect.c
+++ b/clang/test/Driver/tls-dialect.c
@@ -10,6 +10,11 @@
/// TLSDESC is not on by default in Linux, even on RISC-V, and is covered above
// RUN: %clang -### --target=riscv64-android %s 2>&1 | FileCheck --check-prefix=DESC %s
+/// Fuchsia supports TLSDESC by default for all architectures.
+// RUN: %clang -### --target=riscv64-unknown-fuchsia %s 2>&1 | FileCheck --check-prefix=DESC %s
+// RUN: %clang -### --target=aarch64-unknown-fuchsia %s 2>&1 | FileCheck --check-prefix=DESC %s
+// RUN: %clang -### --target=x86_64-unknown-fuchsia %s 2>&1 | FileCheck --check-prefix=DESC %s
+
/// LTO
// RUN: %clang -### --target=loongarch64-linux -flto -mtls-dialect=desc %s 2>&1 | FileCheck --check-prefix=LTO-DESC %s
// RUN: %clang -### --target=loongarch64-linux -flto %s 2>&1 | FileCheck --check-prefix=LTO-NODESC %s
diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h
index 8097300c6e630c..6afc6ec974ca72 100644
--- a/llvm/include/llvm/TargetParser/Triple.h
+++ b/llvm/include/llvm/TargetParser/Triple.h
@@ -1119,7 +1119,9 @@ class Triple {
/// True if the target supports both general-dynamic and TLSDESC, and TLSDESC
/// is enabled by default.
- bool hasDefaultTLSDESC() const { return isAndroid() && isRISCV64(); }
+ bool hasDefaultTLSDESC() const {
+ return (isAndroid() && isRISCV64()) || isOSFuchsia();
+ }
/// Tests whether the target uses -data-sections as default.
bool hasDefaultDataSections() const {
|
hiraditya
approved these changes
Jan 29, 2025
frobtech
approved these changes
Jan 29, 2025
Fuchsia uses TLSDESC by default for all target architectures. We also make the comment and check for hasDefaultTLSDESC more accurately reflect its usage.
6b6eb8c
to
94f3f43
Compare
TheBlindArchitect
pushed a commit
to XSLabs/fuchsia
that referenced
this pull request
May 15, 2025
After llvm/llvm-project#124990, LLVM sets TLSDESC as the default for Fuchsia targets. This patch moves the config setting into clang_defaults. Fixed: 322984857 Change-Id: Idca5a2c13e7f2128a5c28b337689db4ed4caf1ba Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1265705 Fuchsia-Auto-Submit: Paul Kirth <[email protected]> Reviewed-by: Roland McGrath <[email protected]> Commit-Queue: Auto-Submit <auto-submit-builder@fuchsia-internal-service-accts.iam.gserviceaccount.com>
TheBlindArchitect
pushed a commit
to XSLabs/integration
that referenced
this pull request
May 15, 2025
After llvm/llvm-project#124990, LLVM sets TLSDESC as the default for Fuchsia targets. This patch moves the config setting into clang_defaults. Original-Fixed: 322984857 Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1265705 Original-Revision: de98695b8e0d754cf3129d5c6ce3ffcab8942144 GitOrigin-RevId: 84140e178e483e2b8ecf96b44174d88b03dd3213 Change-Id: Ie3618aeae4b207ef3da51999bfa5dee2a43818bf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
clang:driver
'clang' and 'clang++' user-facing binaries. Not 'clang-cl'
clang
Clang issues not falling into any other category
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fuchsia uses TLSDESC by default for all target architectures.