From: deraadt Date: Fri, 25 Jun 2021 01:35:13 +0000 (+0000) Subject: Pull in support from a future clang for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_x X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=af2320b8a36838a78e179b8a033097c4c6f78846;p=openbsd 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 --- 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");