On Sat, Nov 13 2021, j...@wxcvbn.org wrote: > Bulk build on riscv64.ports.openbsd.org
[...] > http://build-failures.rhaalovely.net/riscv64/2021-11-05/graphics/blender.log Brad asked me to try building blender on riscv64. It's failing despite the commit I backported from upstream (see below). Obviously the Makefile hunk would need testing on other archs. Index: Makefile =================================================================== RCS file: /home/cvs/ports/graphics/blender/Makefile,v retrieving revision 1.106 diff -u -p -r1.106 Makefile --- Makefile 2 Nov 2021 00:01:15 -0000 1.106 +++ Makefile 14 Nov 2021 12:40:01 -0000 @@ -1,6 +1,6 @@ # $OpenBSD: Makefile,v 1.106 2021/11/02 00:01:15 sthen Exp $ -ONLY_FOR_ARCHS = amd64 +ONLY_FOR_ARCHS = ${LP64_ARCHS} DPB_PROPERTIES = parallel COMMENT = 3D creation software Index: patches/patch-intern_atomic_intern_atomic_ops_unix_h =================================================================== RCS file: patches/patch-intern_atomic_intern_atomic_ops_unix_h diff -N patches/patch-intern_atomic_intern_atomic_ops_unix_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-intern_atomic_intern_atomic_ops_unix_h 14 Nov 2021 12:38:12 -0000 @@ -0,0 +1,21 @@ +$OpenBSD$ + +Add support for RISC-V architecture +https://git.blender.org/gitweb/gitweb.cgi/blender.git/commitdiff/468d59e496eb3263c1b0284459c03b599fe84a2a + +Index: intern/atomic/intern/atomic_ops_unix.h +--- intern/atomic/intern/atomic_ops_unix.h.orig ++++ 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 Index: patches/patch-intern_numaapi_source_build_config_h =================================================================== RCS file: patches/patch-intern_numaapi_source_build_config_h diff -N patches/patch-intern_numaapi_source_build_config_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-intern_numaapi_source_build_config_h 14 Nov 2021 12:38:32 -0000 @@ -0,0 +1,35 @@ +$OpenBSD$ + +Add support for RISC-V architecture +https://git.blender.org/gitweb/gitweb.cgi/blender.git/commitdiff/468d59e496eb3263c1b0284459c03b599fe84a2a + +Index: intern/numaapi/source/build_config.h +--- intern/numaapi/source/build_config.h.orig ++++ 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 +@@ -380,6 +390,9 @@ + #endif + #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 -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE