From 1a963d3278c2daab7e12125371442cd129c09954 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 28 Mar 2022 14:05:23 -0700 Subject: [PATCH] [Driver] Make -moutline-atomics default for aarch64-fuchsia targets This makes Fuchsia consistent with Linux on AArch64. Reviewed By: abrachet Differential Revision: https://reviews.llvm.org/D122613 --- clang/lib/Driver/ToolChains/Fuchsia.h | 25 ++++++++++++++----------- clang/test/Driver/fuchsia.c | 1 + 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Fuchsia.h b/clang/lib/Driver/ToolChains/Fuchsia.h index c0e69df..f9f3bbf 100644 --- a/clang/lib/Driver/ToolChains/Fuchsia.h +++ b/clang/lib/Driver/ToolChains/Fuchsia.h @@ -75,24 +75,27 @@ public: RuntimeLibType GetRuntimeLibType(const llvm::opt::ArgList &Args) const override; - CXXStdlibType - GetCXXStdlibType(const llvm::opt::ArgList &Args) const override; + CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override; + + bool IsAArch64OutlineAtomicsDefault( + const llvm::opt::ArgList &Args) const override { + return true; + } - void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, - llvm::opt::ArgStringList &CC1Args, - Action::OffloadKind DeviceOffloadKind) const override; + void + addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, + llvm::opt::ArgStringList &CC1Args, + Action::OffloadKind DeviceOffloadKind) const override; void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; - void - AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs, - llvm::opt::ArgStringList &CC1Args) const override; + void AddClangCXXStdlibIncludeArgs( + const llvm::opt::ArgList &DriverArgs, + llvm::opt::ArgStringList &CC1Args) const override; void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const override; - const char *getDefaultLinker() const override { - return "ld.lld"; - } + const char *getDefaultLinker() const override { return "ld.lld"; } protected: Tool *buildLinker() const override; diff --git a/clang/test/Driver/fuchsia.c b/clang/test/Driver/fuchsia.c index 3e8d721..888f6b1 100644 --- a/clang/test/Driver/fuchsia.c +++ b/clang/test/Driver/fuchsia.c @@ -34,6 +34,7 @@ // CHECK-AARCH64: "-fsanitize=shadow-call-stack" // CHECK-X86_64: "-fsanitize=safe-stack" // CHECK: "-stack-protector" "2" +// CHECK-AARCH64: "-target-feature" "+outline-atomics" // CHECK-NOT: "-fcommon" // CHECK: {{.*}}ld.lld{{.*}}" "-z" "max-page-size=4096" "-z" "now" "-z" "rodynamic" "-z" "separate-loadable-segments" "-z" "rel" "--pack-dyn-relocs=relr" // CHECK: "--sysroot=[[SYSROOT]]" -- 2.7.4