summaryrefslogtreecommitdiffstats
path: root/contrib/compiler-rt
diff options
context:
space:
mode:
authorbr <br@FreeBSD.org>2016-01-22 16:59:06 +0000
committerbr <br@FreeBSD.org>2016-01-22 16:59:06 +0000
commit230837c0171d83159edbb6b0e8a4bf5c98815b14 (patch)
tree4570c33bb2e7667b16f37621b0b1e32f288b6863 /contrib/compiler-rt
parent8b90d96a7531dafc4c19a2587b491bc8f2c767a1 (diff)
downloadFreeBSD-src-230837c0171d83159edbb6b0e8a4bf5c98815b14.zip
FreeBSD-src-230837c0171d83159edbb6b0e8a4bf5c98815b14.tar.gz
Add support for RISC-V ISA.
Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5021
Diffstat (limited to 'contrib/compiler-rt')
-rw-r--r--contrib/compiler-rt/lib/builtins/int_lib.h8
-rw-r--r--contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h8
2 files changed, 11 insertions, 5 deletions
diff --git a/contrib/compiler-rt/lib/builtins/int_lib.h b/contrib/compiler-rt/lib/builtins/int_lib.h
index ceb348c2..985534d 100644
--- a/contrib/compiler-rt/lib/builtins/int_lib.h
+++ b/contrib/compiler-rt/lib/builtins/int_lib.h
@@ -74,11 +74,13 @@
* global header to prevent other C files from making the detour
* through __c?zdi2() as well.
*
- * This problem has only been observed on FreeBSD for sparc64 and
- * mips64 with GCC 4.2.1.
+ * This problem has been observed on FreeBSD for sparc64 and
+ * mips64 with GCC 4.2.1, and for riscv with GCC 5.2.0.
+ * Presumably it's any version of GCC, and targeting an arch that
+ * does not have dedicated bit counting instructions.
*/
#if defined(__FreeBSD__) && (defined(__sparc64__) || \
- defined(__mips_n64) || defined(__mips_o64))
+ defined(__mips_n64) || defined(__mips_o64) || defined(__riscv__))
si_int __clzsi2(si_int);
si_int __ctzsi2(si_int);
#define __builtin_clz __clzsi2
diff --git a/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index 4da7c70..ea95fb6 100644
--- a/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -76,6 +76,10 @@ namespace __sanitizer {
#elif defined(__powerpc64__)
const unsigned struct_kernel_stat_sz = 144;
const unsigned struct_kernel_stat64_sz = 104;
+#elif defined(__riscv__)
+ /* RISCVTODO: check that these values are correct */
+ const unsigned struct_kernel_stat_sz = 128;
+ const unsigned struct_kernel_stat64_sz = 128;
#elif defined(__mips__)
#if SANITIZER_WORDSIZE == 64
const unsigned struct_kernel_stat_sz = 216;
@@ -103,7 +107,7 @@ namespace __sanitizer {
#if SANITIZER_LINUX || SANITIZER_FREEBSD
-#if defined(__powerpc64__)
+#if defined(__powerpc64__) || defined(__riscv__)
const unsigned struct___old_kernel_stat_sz = 0;
#else
const unsigned struct___old_kernel_stat_sz = 32;
@@ -481,7 +485,7 @@ namespace __sanitizer {
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
OpenPOWER on IntegriCloud