[PATCH] D159390: Haiku: Enable thread-local storage and disable PIE by default
Brad Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 1 23:26:07 PDT 2023
brad updated this revision to Diff 555564.
brad added a comment.
x86_64 test for TLS.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D159390/new/
https://reviews.llvm.org/D159390
Files:
clang/lib/Basic/Targets/OSTargets.h
clang/lib/Driver/ToolChains/Haiku.h
clang/test/Driver/pic.c
clang/test/Sema/tls.c
Index: clang/test/Sema/tls.c
===================================================================
--- clang/test/Sema/tls.c
+++ clang/test/Sema/tls.c
@@ -16,7 +16,8 @@
// RUN: %clang_cc1 -triple x86_64-pc-openbsd -fsyntax-only %s
// RUN: %clang_cc1 -triple i386-pc-openbsd -fsyntax-only %s
-// Haiku does not support TLS.
-// RUN: not %clang_cc1 -triple i586-pc-haiku -fsyntax-only %s
+// Haiku supports TLS.
+// RUN: %clang_cc1 -triple x86_64-unknown-haiku -fsyntax-only %s
+// RUN: %clang_cc1 -triple i586-pc-haiku -fsyntax-only %s
__thread int x;
Index: clang/test/Driver/pic.c
===================================================================
--- clang/test/Driver/pic.c
+++ clang/test/Driver/pic.c
@@ -324,3 +324,9 @@
// RUN: -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIC-DATA-TEXT-REL-NON-SYSTEMZ
// RUN: not %clang -fpic -c --target=arm-arm-none-eabi -mpic-data-is-text-relative %s \
// RUN: -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIC-DATA-TEXT-REL-NON-SYSTEMZ
+
+// On Haiku, PIE is disabled by default.
+// RUN: %clang -c %s --target=x86_64-unknown-haiku -### 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
+// RUN: %clang -c %s --target=i586-pc-haiku -### 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
Index: clang/lib/Driver/ToolChains/Haiku.h
===================================================================
--- clang/lib/Driver/ToolChains/Haiku.h
+++ clang/lib/Driver/ToolChains/Haiku.h
@@ -22,10 +22,6 @@
Haiku(const Driver &D, const llvm::Triple &Triple,
const llvm::opt::ArgList &Args);
- bool isPIEDefault(const llvm::opt::ArgList &Args) const override {
- return getTriple().getArch() == llvm::Triple::x86_64;
- }
-
void AddClangSystemIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
Index: clang/lib/Basic/Targets/OSTargets.h
===================================================================
--- clang/lib/Basic/Targets/OSTargets.h
+++ clang/lib/Basic/Targets/OSTargets.h
@@ -268,7 +268,6 @@
this->IntPtrType = TargetInfo::SignedLong;
this->PtrDiffType = TargetInfo::SignedLong;
this->ProcessIDType = TargetInfo::SignedLong;
- this->TLSSupported = false;
switch (Triple.getArch()) {
default:
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159390.555564.patch
Type: text/x-patch
Size: 2307 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230902/944ea944/attachment.bin>
More information about the cfe-commits
mailing list