Source: zycore-c Version: 1.1.0-4 Severity: wishlist Tags: patch User: debian-riscv@lists.debian.org Usertags: riscv64 X-Debbugs-Cc: debian-riscv@lists.debian.org Dear zycore-c Maintainer, The zycore-c package can be built on real riscv64 hardware with the patch attached, could you please add supoort for riscv64 arch? thanks. Bo -- Best Regards
diff -Nru zycore-c-1.1.0/debian/control zycore-c-1.1.0/debian/control
--- zycore-c-1.1.0/debian/control 2021-12-07 10:45:44.000000000 +0000
+++ zycore-c-1.1.0/debian/control 2021-12-07 11:43:25.000000000 +0000
@@ -12,7 +12,7 @@
Rules-Requires-Root: no
Package: libzycore1.1
-Architecture: any-amd64 any-arm any-arm64 any-i386
+Architecture: any-amd64 any-arm any-arm64 any-i386 riscv64
Depends: ${misc:Depends},
${shlibs:Depends}
Description: Zyan Core Library for C
@@ -23,7 +23,7 @@
Package: libzycore-dev
Section: libdevel
-Architecture: any-amd64 any-arm any-arm64 any-i386
+Architecture: any-amd64 any-arm any-arm64 any-i386 riscv64
Depends: libzycore1.1 (= ${binary:Version}),
${misc:Depends}
Description: Zyan Core Library for C - development
diff -Nru zycore-c-1.1.0/debian/patches/add-support-riscv64.patch zycore-c-1.1.0/debian/patches/add-support-riscv64.patch
--- zycore-c-1.1.0/debian/patches/add-support-riscv64.patch 1970-01-01 00:00:00.000000000 +0000
+++ zycore-c-1.1.0/debian/patches/add-support-riscv64.patch 2021-12-07 11:43:25.000000000 +0000
@@ -0,0 +1,31 @@
+--- a/include/Zycore/Defines.h
++++ b/include/Zycore/Defines.h
+@@ -131,6 +131,8 @@
+ # define ZYAN_AARCH64
+ #elif defined(_M_ARM) || defined(_M_ARMT) || defined(__arm__) || defined(__thumb__)
+ # define ZYAN_ARM
++#elif defined(_M_RISCV64) || defined(__riscv) && __riscv_xlen == 64
++# define ZYAN_RISCV64
+ #elif defined(__EMSCRIPTEN__)
+ // Nothing to do, `ZYAN_EMSCRIPTEN` is both platform and arch macro for this one.
+ #else
+--- a/src/Format.c
++++ b/src/Format.c
+@@ -423,7 +423,7 @@
+
+ ZyanStatus ZyanStringAppendDecU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length)
+ {
+-#if defined(ZYAN_X64) || defined(ZYAN_AARCH64)
++#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_RISCV64)
+ return ZyanStringAppendDecU64(string, value, padding_length);
+ #else
+ // Working with 64-bit values is slow on non 64-bit systems
+@@ -464,7 +464,7 @@
+ ZyanStatus ZyanStringAppendHexU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length,
+ ZyanBool uppercase)
+ {
+-#if defined(ZYAN_X64) || defined(ZYAN_AARCH64)
++#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_RISCV64)
+ return ZyanStringAppendHexU64(string, value, padding_length, uppercase);
+ #else
+ // Working with 64-bit values is slow on non 64-bit systems
diff -Nru zycore-c-1.1.0/debian/patches/series zycore-c-1.1.0/debian/patches/series
--- zycore-c-1.1.0/debian/patches/series 2021-11-12 12:15:38.000000000 +0000
+++ zycore-c-1.1.0/debian/patches/series 2021-12-07 11:43:25.000000000 +0000
@@ -1,2 +1,3 @@
test-make-tests-runnable-with-ctest.patch
build-use-system-GTest-when-available.patch
+add-support-riscv64.patch
Attachment:
signature.asc
Description: PGP signature