a1bfde
diff -ur gc-7.6.4.old/include/private/gcconfig.h gc-7.6.4.new/include/private/gcconfig.h
a1bfde
--- gc-7.6.4.old/include/private/gcconfig.h	2018-01-26 13:16:17.000000000 +0000
a1bfde
+++ gc-7.6.4.new/include/private/gcconfig.h	2018-02-27 09:33:05.840680540 +0000
a1bfde
@@ -602,6 +602,15 @@
a1bfde
 #   define I386
a1bfde
 #   define mach_type_known
a1bfde
 # endif
a1bfde
+# if defined(__riscv) && defined(LINUX)
a1bfde
+#   if __riscv_xlen == 32
a1bfde
+#     define RISCV32
a1bfde
+#     define mach_type_known
a1bfde
+#   elif __riscv_xlen == 64
a1bfde
+#     define RISCV64
a1bfde
+#     define mach_type_known
a1bfde
+#   endif
a1bfde
+# endif
a1bfde
 
a1bfde
 /* Feel free to add more clauses here */
a1bfde
 
a1bfde
@@ -2650,6 +2659,32 @@
a1bfde
 #   endif
a1bfde
 # endif
a1bfde
 
a1bfde
+# ifdef RISCV32
a1bfde
+#   define CPP_WORDSZ 32
a1bfde
+#   define MACH_TYPE "RISC-V32"
a1bfde
+#   define ALIGNMENT 4
a1bfde
+#   ifdef LINUX
a1bfde
+#     define OS_TYPE "LINUX"
a1bfde
+      extern int __data_start[];
a1bfde
+#     define DATASTART ((ptr_t)__data_start)
a1bfde
+#     define LINUX_STACKBOTTOM
a1bfde
+#     define DYNAMIC_LOADING
a1bfde
+#   endif
a1bfde
+# endif /* RISCV32 */
a1bfde
+
a1bfde
+# ifdef RISCV64
a1bfde
+#   define CPP_WORDSZ 64
a1bfde
+#   define MACH_TYPE "RISC-V64"
a1bfde
+#   define ALIGNMENT 8
a1bfde
+#   ifdef LINUX
a1bfde
+#     define OS_TYPE "LINUX"
a1bfde
+      extern int __data_start[];
a1bfde
+#     define DATASTART ((ptr_t)__data_start)
a1bfde
+#     define LINUX_STACKBOTTOM
a1bfde
+#     define DYNAMIC_LOADING
a1bfde
+#   endif
a1bfde
+# endif /* RISCV64 */
a1bfde
+
a1bfde
 #if defined(__GLIBC__) && !defined(DONT_USE_LIBC_PRIVATES)
a1bfde
   /* Use glibc's stack-end marker. */
a1bfde
 # define USE_LIBC_PRIVATES