summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-08-02 20:23:01 +0300
committerEfraim Flashner <efraim@flashner.co.il>2023-08-02 20:23:01 +0300
commit23e2ff223c0511317edf236504fb474e3b5ac301 (patch)
treef34e560f34a23c27956bbf3c742d7702ac40b908 /gnu/packages/patches
parent6ccfa48d83b9c513b40835ae0c5896102b4dd915 (diff)
downloadguix-23e2ff223c0511317edf236504fb474e3b5ac301.tar.gz
gnu: apr: Fix building on powerpc-linux.
* gnu/packages/apr.scm (apr): When building for powerpc-linux add a
phase to apply a patch.
[native-inputs]: When building for powerpc-linux add a patch.
* gnu/packages/patches/apr-fix-atomics.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/apr-fix-atomics.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/gnu/packages/patches/apr-fix-atomics.patch b/gnu/packages/patches/apr-fix-atomics.patch
new file mode 100644
index 0000000000..94cce9b5f1
--- /dev/null
+++ b/gnu/packages/patches/apr-fix-atomics.patch
@@ -0,0 +1,49 @@
+This patch is taken from Debian, using Debian version 1.7.0-8.
+A new patch will be needed when apr is updated.
+
+# quick and dirty fix for FTBFS on mipsel
+# There should be a proper configure check, see 
+# https://bz.apache.org/bugzilla/show_bug.cgi?id=63566
+Index: apr-1.7.0/include/arch/unix/apr_arch_atomic.h
+===================================================================
+--- apr-1.7.0.orig/include/arch/unix/apr_arch_atomic.h
++++ apr-1.7.0/include/arch/unix/apr_arch_atomic.h
+@@ -26,6 +26,9 @@
+ /* noop */
+ #elif HAVE_ATOMIC_BUILTINS
+ #   define USE_ATOMICS_BUILTINS
++#   if (__INTPTR_WIDTH__ == 32) && ( defined(__MIPSEL__) || defined(__powerpc__) ) || defined(__m68k__) || defined(__sh__)
++#       define NEED_ATOMICS_GENERIC64
++#   endif
+ #elif defined(SOLARIS2) && SOLARIS2 >= 10
+ #   define USE_ATOMICS_SOLARIS
+ #   define NEED_ATOMICS_GENERIC64
+Index: apr-1.7.0/atomic/unix/builtins64.c
+===================================================================
+--- apr-1.7.0.orig/atomic/unix/builtins64.c
++++ apr-1.7.0/atomic/unix/builtins64.c
+@@ -16,7 +16,7 @@
+ 
+ #include "apr_arch_atomic.h"
+ 
+-#ifdef USE_ATOMICS_BUILTINS
++#if defined(USE_ATOMICS_BUILTINS) && ! defined(NEED_ATOMICS_GENERIC64)
+ 
+ APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem)
+ {
+Index: apr-1.7.0/atomic/unix/builtins.c
+===================================================================
+--- apr-1.7.0.orig/atomic/unix/builtins.c
++++ apr-1.7.0/atomic/unix/builtins.c
+@@ -20,7 +20,11 @@
+ 
+ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p)
+ {
++#if defined (NEED_ATOMICS_GENERIC64)
++    return apr__atomic_generic64_init(p);
++#else
+     return APR_SUCCESS;
++#endif
+ }
+ 
+ APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem)