https://github.com/ilovepi updated https://github.com/llvm/llvm-project/pull/81198
>From 3221a5e60c58e64dabdf23c52d33ba7ed5bdf81e Mon Sep 17 00:00:00 2001 From: Paul Kirth <paulki...@google.com> Date: Thu, 8 Feb 2024 14:21:49 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF-8?q?itial=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.4 --- llvm/include/llvm/TargetParser/Triple.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h index 98d8490cc9f7a2..0382d97d3fe38b 100644 --- a/llvm/include/llvm/TargetParser/Triple.h +++ b/llvm/include/llvm/TargetParser/Triple.h @@ -1036,8 +1036,7 @@ class Triple { /// True if the target supports both general-dynamic and TLSDESC, and TLSDESC /// is enabled by default. bool hasDefaultTLSDESC() const { - // TODO: Improve check for other platforms, like Android, and RISC-V - return false; + return isAndroid() && (!isAndroidVersionLT(29) || isRISCV64()); } /// Tests whether the target uses -data-sections as default. >From 567ccdff99f28cbf9598628e0150458f6302cc28 Mon Sep 17 00:00:00 2001 From: Paul Kirth <paulki...@google.com> Date: Thu, 8 Feb 2024 16:15:07 -0800 Subject: [PATCH 2/2] Update test to check for defaults on Android (enabled) and Linux (not enabled) Created using spr 1.3.4 --- clang/test/Driver/tls-dialect.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clang/test/Driver/tls-dialect.c b/clang/test/Driver/tls-dialect.c index 4e105ce3cea5d9..f309f4a44fbc3f 100644 --- a/clang/test/Driver/tls-dialect.c +++ b/clang/test/Driver/tls-dialect.c @@ -3,6 +3,11 @@ // RUN: %clang -### --target=riscv64-linux %s 2>&1 | FileCheck --check-prefix=NODESC %s // RUN: %clang -### --target=x86_64-linux -mtls-dialect=gnu %s 2>&1 | FileCheck --check-prefix=NODESC %s +/// Android supports TLSDESC by default after Android version 29 and all RISC-V +/// TLSDESC is not on by default in Linux, even on RISC-V +// RUN: %clang -### --target=riscv64-android %s 2>&1 | FileCheck --check-prefix=DESC %s +// RUN: %clang -### --target=riscv64-linux %s 2>&1 | FileCheck --check-prefix=NODESC %s + /// LTO // RUN: %clang -### --target=riscv64-linux -flto -mtls-dialect=desc %s 2>&1 | FileCheck --check-prefix=LTO-DESC %s // RUN: %clang -### --target=riscv64-linux -flto %s 2>&1 | FileCheck --check-prefix=LTO-NODESC %s _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits