[clang] [Driver] Enable outline atomics for OpenBSD/aarch64 (PR #155713)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 27 15:56:29 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-driver
@llvm/pr-subscribers-clang
Author: Brad Smith (brad0)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/155713.diff
2 Files Affected:
- (modified) clang/lib/Driver/ToolChains/OpenBSD.h (+5)
- (modified) clang/test/Driver/openbsd.c (+5)
``````````diff
diff --git a/clang/lib/Driver/ToolChains/OpenBSD.h b/clang/lib/Driver/ToolChains/OpenBSD.h
index 11b873cb30032..ad0f9e6799568 100644
--- a/clang/lib/Driver/ToolChains/OpenBSD.h
+++ b/clang/lib/Driver/ToolChains/OpenBSD.h
@@ -79,6 +79,11 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic_ELF {
void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
+ bool IsAArch64OutlineAtomicsDefault(
+ const llvm::opt::ArgList &Args) const override {
+ return true;
+ }
+
std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component,
FileType Type = ToolChain::FT_Static,
bool IsFortran = false) const override;
diff --git a/clang/test/Driver/openbsd.c b/clang/test/Driver/openbsd.c
index 1f12cfca9488b..5fa827a584ceb 100644
--- a/clang/test/Driver/openbsd.c
+++ b/clang/test/Driver/openbsd.c
@@ -140,6 +140,11 @@
// RUN: | FileCheck -check-prefix=CHECK-LTO-FLAGS %s
// CHECK-LTO-FLAGS: "-plugin-opt=mcpu=x86-64"
+// Check 64-bit ARM for outline atomics
+// RUN: %clang --target=aarch64-unknown-openbsd -### -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AARCH64-ATOMIC %s
+// CHECK-AARCH64-ATOMIC: "-target-feature" "+outline-atomics"
+
// Check 64-bit ARM for BTI and PAC flags
// RUN: %clang --target=aarch64-unknown-openbsd -### -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-AARCH64-BTI-PAC %s
``````````
</details>
https://github.com/llvm/llvm-project/pull/155713
More information about the cfe-commits
mailing list