1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-05 20:12:52 +00:00
nixpkgs/pkgs/development/libraries/boehm-gc/riscv.patch
2018-02-18 09:02:06 -05:00

54 lines
1.3 KiB
Diff

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