git: 2c18bcdec1c9 - stable/12 - Reapply r322168 (partially, by br):

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Wed, 22 Dec 2021 10:05:30 UTC
The branch stable/12 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=2c18bcdec1c9b2759829a49e11d583b43fd0b072

commit 2c18bcdec1c9b2759829a49e11d583b43fd0b072
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2020-08-02 18:27:59 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-12-22 09:58:13 +0000

    Reapply r322168 (partially, by br):
    
    o Replace __riscv__ with __riscv
    o Replace __riscv64 with (__riscv && __riscv_xlen == 64)
    
    This is required to support new GCC 7.1 compiler.
    This is compatible with current GCC 6.1 compiler.
    
    RISC-V is extensible ISA and the idea here is to have built-in define
    per each extension, so together with __riscv we will have some subset
    of these as well (depending on -march string passed to compiler):
    
    __riscv_compressed
    __riscv_atomic
    __riscv_mul
    __riscv_div
    __riscv_muldiv
    __riscv_fdiv
    __riscv_fsqrt
    __riscv_float_abi_soft
    __riscv_float_abi_single
    __riscv_float_abi_double
    __riscv_cmodel_medlow
    __riscv_cmodel_medany
    __riscv_cmodel_pic
    __riscv_xlen
    
    Reviewed by:    ngie
    Sponsored by:   DARPA, AFRL
    
    Differential Revision:  https://reviews.freebsd.org/D11901
    
    (cherry picked from commit fd28fec2f0ba63a68ca0c9a041facc4fd86f4ba8)
---
 .../lib/sanitizer_common/sanitizer_platform_limits_posix.h            | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index 658b0abaece8..c3f9c1f0986d 100644
--- a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -122,7 +122,7 @@ const unsigned struct_kexec_segment_sz = 4 * sizeof(unsigned long);
 
 #if SANITIZER_LINUX
 
-#if defined(__powerpc64__) || defined(__s390__)
+#if defined(__powerpc64__) || defined(__riscv) || defined(__s390__)
 const unsigned struct___old_kernel_stat_sz = 0;
 #elif !defined(__sparc__)
 const unsigned struct___old_kernel_stat_sz = 32;
@@ -523,7 +523,7 @@ typedef long long __sanitizer___kernel_off_t;
 typedef long __sanitizer___kernel_off_t;
 #endif
 
-#if defined(__powerpc__) || defined(__mips__)
+#if defined(__powerpc__) || defined(__mips__) || defined(__riscv)
 typedef unsigned int __sanitizer___kernel_old_uid_t;
 typedef unsigned int __sanitizer___kernel_old_gid_t;
 #else