[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#996917: blender: Please add support for riscv64



Package: blender
Version: 2.93.4+dfsg-1
Severity: wishlist
Tags: ftbfs upstream patch
User: debian-riscv@lists.debian.org
Usertags: riscv64

Dear maintainer,

kodi currently fails to build from source on riscv64 due to missing
support for this architecture [1]. There are two reasons for that:

- Missing upstream support for this architecture. This is something that
  has been fixed recently [2], however it is only available on the
  master branch.

- Unavailability of gold linker on riscv64 and broken upstream support
  for bfd linker. I have proposed a patch to fix that [3].

I have included the corresponding patches in a debdiff patch attached,
and verified that the resulting package build successfully on riscv64.
If you are fine with this patch, could you please consider applying it
for the future uploads? 

Regards,
Aurelien


[1] https://buildd.debian.org/status/fetch.php?pkg=blender&arch=riscv64&ver=2.93.4%2Bdfsg-1&stamp=1633013030&raw=0
[2] https://developer.blender.org/rB468d59e496eb3263c1b0284459c03b599fe84a2a
[3] https://developer.blender.org/D12911
--- blender-2.93.4+dfsg/debian/patches/0006-add-support-for-risc-v-architecture.patch
+++ blender-2.93.4+dfsg/debian/patches/0006-add-support-for-risc-v-architecture.patch
@@ -0,0 +1,67 @@
+From 468d59e496eb3263c1b0284459c03b599fe84a2a Mon Sep 17 00:00:00 2001
+From: Heinrich Schuchardt <xypron>
+Date: Thu, 15 Jul 2021 14:22:08 +0200
+Subject: [PATCH] Add support for RISC-V architecture
+
+* On RISC-V GCC 10.3 does not define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n.
+* Avoid a build error
+  "Please add support for your platform in build_config.h"
+  Cf: https://github.com/sergeyvfx/libNumaAPI/pull/3
+
+Differential Revision: https://developer.blender.org/D11910
+---
+ intern/atomic/intern/atomic_ops_unix.h |  6 +++---
+ intern/numaapi/source/build_config.h   | 13 +++++++++++++
+ 2 files changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/intern/atomic/intern/atomic_ops_unix.h b/intern/atomic/intern/atomic_ops_unix.h
+index dc1e71cda76..b08a0e9bc28 100644
+--- a/intern/atomic/intern/atomic_ops_unix.h
++++ b/intern/atomic/intern/atomic_ops_unix.h
+@@ -49,9 +49,9 @@
+ 
+ #include "atomic_ops_utils.h"
+ 
+-#if defined(__arm__)
+-/* Attempt to fix compilation error on Debian armel kernel.
+- * arm7 architecture does have both 32 and 64bit atomics, however
++#if defined(__arm__) || defined(__riscv)
++/* Attempt to fix compilation error on Debian armel and RISC-V kernels.
++ * Both architectures do have both 32 and 64bit atomics, however
+  * its gcc doesn't have __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n defined.
+  */
+ #  define JE_FORCE_SYNC_COMPARE_AND_SWAP_1
+diff --git a/intern/numaapi/source/build_config.h b/intern/numaapi/source/build_config.h
+index fdd6ff704c3..49d82aa3e87 100644
+--- a/intern/numaapi/source/build_config.h
++++ b/intern/numaapi/source/build_config.h
+@@ -324,6 +324,16 @@
+ #  define ARCH_CPU_ARM64 1
+ #  define ARCH_CPU_64_BITS 1
+ #  define ARCH_CPU_LITTLE_ENDIAN 1
++#elif defined(__riscv) && __riscv_xlen == 32
++#  define ARCH_CPU_RISCV_FAMILY 1
++#  define ARCH_CPU_RISCV32 1
++#  define ARCH_CPU_64_BITS 0
++#  define ARCH_CPU_LITTLE_ENDIAN 1
++#elif defined(__riscv) && __riscv_xlen == 64
++#  define ARCH_CPU_RISCV_FAMILY 1
++#  define ARCH_CPU_RISCV64 1
++#  define ARCH_CPU_64_BITS 1
++#  define ARCH_CPU_LITTLE_ENDIAN 1
+ #elif defined(__pnacl__) || defined(__asmjs__) || defined(__wasm__)
+ #  define ARCH_CPU_32_BITS 1
+ #  define ARCH_CPU_LITTLE_ENDIAN 1
+@@ -381,6 +391,9 @@
+ #if !defined(ARCH_CPU_PPC64_FAMILY)
+ #  define ARCH_CPU_PPC64_FAMILY 0
+ #endif
++#if !defined(ARCH_CPU_RISCV_FAMILY)
++#  define ARCH_CPU_RISCV_FAMILY 0
++#endif
+ #if !defined(ARCH_CPU_S390_FAMILY)
+ #  define ARCH_CPU_S390_FAMILY 0
+ #endif
+-- 
+2.30.2
+
--- blender-2.93.4+dfsg/debian/patches/0007-cmake-fix-linking-with-with-x11-xf86vmode-and-bfd.patch
+++ blender-2.93.4+dfsg/debian/patches/0007-cmake-fix-linking-with-with-x11-xf86vmode-and-bfd.patch
@@ -0,0 +1,25 @@
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon Oct 18 23:02:51 2021 +0200
+Subject: fix linking with WITH_X11_XF86VMODE and bfd
+Forwarded: https://developer.blender.org/D12911
+
+Fix typos in the variables of the Xxf86vm libray to fix link failure
+with bfd.  These variables are defined in platform_unix.cmake.
+
+diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
+index 05423209c71..64faf464290 100644
+--- a/intern/ghost/CMakeLists.txt
++++ b/intern/ghost/CMakeLists.txt
+@@ -245,10 +245,10 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
+     if(WITH_X11_XF86VMODE)
+       add_definitions(-DWITH_X11_XF86VMODE)
+       list(APPEND INC_SYS
+-        ${X11_xf86vmode_INCLUDE_PATH}
++        ${X11_Xxf86vmode_INCLUDE_PATH}
+       )
+       list(APPEND LIB
+-        ${X11_Xf86vmode_LIB}
++        ${X11_Xxf86vmode_LIB}
+       )
+     endif()
+ 
--- blender-2.93.4+dfsg/debian/patches/series
+++ blender-2.93.4+dfsg/debian/patches/series
@@ -3,3 +3,5 @@
 0003-do_not_use_version_number_in_system_path.patch
 0004-locales_directory_install.patch
 0005-fix_atomics.patch
+0006-add-support-for-risc-v-architecture.patch
+0007-cmake-fix-linking-with-with-x11-xf86vmode-and-bfd.patch

Reply to: