Re: Bug#978018: libapr1: Please add 64-bit atomics workaround for m68k and sh4
Control: tags -1 +patch
Attaching a patch. Please include sh3 in this change as well.
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz@debian.org
`. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
diff -Nru apr.old/apr-1.7.0/debian/changelog apr/apr-1.7.0/debian/changelog
--- apr.old/apr-1.7.0/debian/changelog 2020-11-21 21:06:09.000000000 +0100
+++ apr/apr-1.7.0/debian/changelog 2020-12-24 18:01:25.611495190 +0100
@@ -1,3 +1,9 @@
+apr (1.7.0-4+ports) unstable; urgency=medium
+
+ * Fix atomics for m68k, sh3 and sh4.
+
+ -- John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Thu, 24 Dec 2020 18:01:15 +0100
+
apr (1.7.0-4) unstable; urgency=low
[ Debian Janitor ]
diff -Nru apr.old/apr-1.7.0/debian/patches/generic-64bit-atomics.patch apr/apr-1.7.0/debian/patches/generic-64bit-atomics.patch
--- apr.old/apr-1.7.0/debian/patches/generic-64bit-atomics.patch 2020-08-30 21:07:53.000000000 +0200
+++ apr/apr-1.7.0/debian/patches/generic-64bit-atomics.patch 2020-12-24 17:44:40.797741482 +0100
@@ -1,20 +1,24 @@
# 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
---- apr.orig/include/arch/unix/apr_arch_atomic.h
-+++ apr/include/arch/unix/apr_arch_atomic.h
+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__) )
++# 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
---- apr.orig/atomic/unix/builtins64.c
-+++ apr/atomic/unix/builtins64.c
+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"
@@ -24,8 +28,10 @@
APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem)
{
---- apr.orig/atomic/unix/builtins.c
-+++ apr/atomic/unix/builtins.c
+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)
diff -Nru apr.old/apr-1.7.0/debian/patches/generic-64bit-atomics.patch~ apr/apr-1.7.0/debian/patches/generic-64bit-atomics.patch~
--- apr.old/apr-1.7.0/debian/patches/generic-64bit-atomics.patch~ 1970-01-01 01:00:00.000000000 +0100
+++ apr/apr-1.7.0/debian/patches/generic-64bit-atomics.patch~ 2020-08-30 21:07:53.000000000 +0200
@@ -0,0 +1,40 @@
+# 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
+--- apr.orig/include/arch/unix/apr_arch_atomic.h
++++ apr/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__) )
++# define NEED_ATOMICS_GENERIC64
++# endif
+ #elif defined(SOLARIS2) && SOLARIS2 >= 10
+ # define USE_ATOMICS_SOLARIS
+ # define NEED_ATOMICS_GENERIC64
+--- apr.orig/atomic/unix/builtins64.c
++++ apr/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)
+ {
+--- apr.orig/atomic/unix/builtins.c
++++ apr/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)
diff -Nru apr.old/apr-1.7.0/debian/symbols.common apr/apr-1.7.0/debian/symbols.common
--- apr.old/apr-1.7.0/debian/symbols.common 2020-08-30 21:07:02.000000000 +0200
+++ apr/apr-1.7.0/debian/symbols.common 2020-12-24 17:54:31.659743330 +0100
@@ -588,4 +588,4 @@
apr_vformatter@Base 1.2.7
apr_vsnprintf@Base 1.2.7
apr_wait_for_io_or_timeout@Base 1.2.7
- (arch=mipsel powerpc)apr__atomic_generic64_init@Base 1.7.0-3~
+ (arch=mipsel m68k powerpc sh3 sh4)apr__atomic_generic64_init@Base 1.7.0-3~
Reply to: