Author: dim
Date: Wed Dec  9 18:37:43 2020
New Revision: 368489
URL: https://svnweb.freebsd.org/changeset/base/368489

Log:
  Merge commit 28de0fb48 from llvm git (by Luís Marques):
  
    [RISCV] Set __GCC_HAVE_SYNC_COMPARE_AND_SWAP_x defines
  
    The RISCV target did not set the GCC atomic compare and swap defines,
    unlike other targets. This broke builds for things like glib on
    RISCV.
  
    Patch by Kristof Provost (kprovost)
  
    Differential Revision: https://reviews.llvm.org/D91784
  
  This should fix building glib20 on RISC-V and unblock a number of
  dependent ports.
  
  Requested by: kp
  MFC after:    3 days

Modified:
  head/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cpp

Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cpp
==============================================================================
--- head/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cpp Wed Dec  9 
17:17:45 2020        (r368488)
+++ head/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cpp Wed Dec  9 
18:37:43 2020        (r368489)
@@ -115,8 +115,14 @@ void RISCVTargetInfo::getTargetDefines(const LangOptio
     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");
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to