summary refs log tree commit diff
path: root/pkgs/development/libraries/boehm-gc/riscv.patch
blob: 249137d0a0dc98d027697ebe42aeefc425b81d42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index a8e55dd2..439cc88d 100644
--- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h
@@ -650,6 +650,15 @@
 #   endif
 #   define mach_type_known
 # endif
+# if defined(__riscv) && defined(LINUX)
+#   if __riscv_xlen == 32
+#     define RISCV32
+#     define mach_type_known
+#   elif __riscv_xlen == 64
+#     define RISCV64
+#     define mach_type_known
+#   endif
+# endif
 
 # if defined(SN_TARGET_PSP2)
 #   define mach_type_known
@@ -2970,6 +2979,32 @@
 #   endif
 # endif
 
+# ifdef RISCV32
+#   define CPP_WORDSZ 32
+#   define MACH_TYPE "RISC-V 32"
+#   define ALIGNMENT 4
+#   ifdef LINUX
+#     define OS_TYPE "LINUX"
+      extern int __data_start[];
+#     define DATASTART ((ptr_t)__data_start)
+#     define LINUX_STACKBOTTOM
+#     define DYNAMIC_LOADING
+#   endif
+# endif
+
+# ifdef RISCV64
+#   define CPP_WORDSZ 64
+#   define MACH_TYPE "RISC-V 64"
+#   define ALIGNMENT 8
+#   ifdef LINUX
+#     define OS_TYPE "LINUX"
+      extern int __data_start[];
+#     define DATASTART ((ptr_t)__data_start)
+#     define LINUX_STACKBOTTOM
+#     define DYNAMIC_LOADING
+#   endif
+# endif
+
 #if defined(__GLIBC__) && !defined(DONT_USE_LIBC_PRIVATES)
   /* Use glibc's stack-end marker. */
 # define USE_LIBC_PRIVATES