Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161344445
D5021.id12568.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D5021.id12568.diff
View Options
Index: contrib/compiler-rt/lib/builtins/int_lib.h
===================================================================
--- contrib/compiler-rt/lib/builtins/int_lib.h
+++ 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
Index: contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
===================================================================
--- contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -76,6 +76,9 @@
#elif defined(__powerpc64__)
const unsigned struct_kernel_stat_sz = 144;
const unsigned struct_kernel_stat64_sz = 104;
+#elif defined(__riscv__)
+ 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 +106,7 @@
#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;
@@ -178,7 +181,7 @@
unsigned __seq;
u64 __unused1;
u64 __unused2;
-#elif defined(__mips__) || defined(__aarch64__)
+#elif defined(__mips__) || defined(__aarch64__) || defined(__riscv__)
unsigned int mode;
unsigned short __seq;
unsigned short __pad1;
@@ -481,7 +484,7 @@
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
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 4, 12:31 AM (2 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34640314
Default Alt Text
D5021.id12568.diff (2 KB)
Attached To
Mode
D5021: compiler_rt changes for RISC-V
Attached
Detach File
Event Timeline
Log In to Comment