From af2320b8a36838a78e179b8a033097c4c6f78846 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 25 Jun 2021 01:35:13 +0000 Subject: [PATCH] Pull in support from a future clang for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_x defines because we need it now from https://reviews.llvm.org/D91784 ok mlarkin kettenis --- gnu/llvm/clang/lib/Basic/Targets/RISCV.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gnu/llvm/clang/lib/Basic/Targets/RISCV.cpp b/gnu/llvm/clang/lib/Basic/Targets/RISCV.cpp index 4ba703c8dd1..6154c0f9900 100644 --- a/gnu/llvm/clang/lib/Basic/Targets/RISCV.cpp +++ b/gnu/llvm/clang/lib/Basic/Targets/RISCV.cpp @@ -115,8 +115,14 @@ void RISCVTargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("__riscv_muldiv"); } - if (HasA) + if (HasA) { Builder.defineMacro("__riscv_atomic"); + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"); + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2"); + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4"); + if (Is64Bit) + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"); + } if (HasF || HasD) { Builder.defineMacro("__riscv_flen", HasD ? "64" : "32"); -- 2.20.1