Skip to content

Commit

Permalink
Add support for RISC-V 64
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Jan 9, 2023
1 parent 4b239dd commit 917fd9a
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
xutils-dev (1:7.7.2-deepin1) unstable; urgency=medium

* Add support for RISC-V 64

-- Clansty <i@gao4.pw> Mon, 09 Jan 2023 17:25:04 +0800

xutils-dev (1:7.7.1-1+dde) UNRELEASED; urgency=medium

* update
Expand Down
75 changes: 75 additions & 0 deletions debian/patches/10_riscv_support.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
From: https://github.com/bmwiedemann/openSUSE/blob/4eded4be9125b3e8b4e2e0730d07b4f1e536b052/packages/x/xorg-cf-files/u_riscv.patch
Author: Andreas Schwab <schwab@suse.de>
Subject: Add support for riscv64
Date: Mon, 09 Jan 2023 17:25:04 +0800

Index: xutils-dev/xorg-cf-files/Imake.cf
===================================================================
--- xutils-dev.orig/xorg-cf-files/Imake.cf
+++ xutils-dev/xorg-cf-files/Imake.cf
@@ -1047,6 +1047,11 @@ XCOMM Keep cpp from replacing path eleme
# endif
# undef __sw_64__
# endif /* __sw_64__ */
+# if defined(__riscv) && __riscv_xlen == 64
+# define RiscV64Architecture
+# undef __riscv
+# undef __riscv_xlen
+# endif
#endif /* linux || __GLIBC__ */

#if (defined(__Lynx__) || defined(Lynx)) && (defined(i386) || defined(__i386__) || defined(__x86__) || defined(__powerpc__) || defined(__sparc__) || defined(sparc))
Index: xutils-dev/xorg-cf-files/linux.cf
===================================================================
--- xutils-dev.orig/xorg-cf-files/linux.cf
+++ xutils-dev/xorg-cf-files/linux.cf
@@ -1139,6 +1139,15 @@ InstallNamedTargetNoClobber(install,file
# endif
#endif /* Sw64Architecture */

+#ifdef RiscV64Architecture
+# ifndef OptimizedCDebugFlags
+# define OptimizedCDebugFlags DefaultGcc2RiscV64Opt
+# endif
+# define LinuxMachineDefines -D__riscv -D__riscv_xlen=64
+# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME
+# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
+#endif /* RiscV64Architecture */
+
#ifndef StandardDefines
# ifdef __linux__
# define StandardDefines -Dlinux LinuxMachineDefines LinuxSourceDefines
Index: xutils-dev/xorg-cf-files/xfree86.cf
===================================================================
--- xutils-dev.orig/xorg-cf-files/xfree86.cf
+++ xutils-dev/xorg-cf-files/xfree86.cf
@@ -2091,6 +2091,12 @@ XFREE86JAPANESEDOCDIR = $(DOCDIR)/Japane
# endif
#endif

+#if HasGcc2 && defined(RiscV64Architecture)
+# ifndef DefaultGcc2RiscV64Opt
+# define DefaultGcc2RiscV64Opt -O2 GccAliasingArgs
+# endif
+#endif
+
#ifndef DefaultGcc2DebugOpt
# define DefaultGcc2DebugOpt -g
#endif
Index: xutils-dev/xorg-cf-files/xorg.cf
===================================================================
--- xutils-dev.orig/xorg-cf-files/xorg.cf
+++ xutils-dev/xorg-cf-files/xorg.cf
@@ -1663,6 +1663,12 @@ XFREE86JAPANESEDOCDIR = $(DOCDIR)/Japane
# endif
#endif

+#if HasGcc2 && defined(RiscV64Architecture)
+# ifndef DefaultGcc2RiscV64Opt
+# define DefaultGcc2RiscV64Opt -O2 GccAliasingArgs
+# endif
+#endif
+
#ifndef DefaultGcc2DebugOpt
# define DefaultGcc2DebugOpt -g
#endif
1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
06_font_path.diff
07_gnu_manpath.diff
09-add-sunway-support.diff
10_riscv_support.diff

0 comments on commit 917fd9a

Please sign in to comment.