pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/apr Work around missing 64bit atomic compiler bu...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9c5cdce1843c
branches:  trunk
changeset: 411771:9c5cdce1843c
user:      rin <rin%pkgsrc.org@localhost>
date:      Thu Feb 20 06:25:28 2020 +0000

description:
Work around missing 64bit atomic compiler builtins on IPL32 platforms
other than x86, that is handled manually (mess!).

It should be better to fix autoconf stuff rather than source codes.
However, (1) it requires to regen configure script, and (2) apr 2.0
uses cmake.

Thanks to @est_suzume for analysis.

diffstat:

 devel/apr/Makefile                                            |   3 +-
 devel/apr/distinfo                                            |   5 ++-
 devel/apr/patches/patch-atomic_unix_builtins.c                |  18 +++++++++
 devel/apr/patches/patch-atomic_unix_builtins64.c              |  21 +++++++++++
 devel/apr/patches/patch-include_arch_unix_apr__arch__atomic.h |  16 ++++++++
 5 files changed, 61 insertions(+), 2 deletions(-)

diffs (97 lines):

diff -r adba9cf9ab34 -r 9c5cdce1843c devel/apr/Makefile
--- a/devel/apr/Makefile        Thu Feb 20 06:23:22 2020 +0000
+++ b/devel/apr/Makefile        Thu Feb 20 06:25:28 2020 +0000
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.81 2020/01/18 23:30:22 rillig Exp $
+# $NetBSD: Makefile,v 1.82 2020/02/20 06:25:28 rin Exp $
 #
 # Take care, changelogs often include "PR 12345" strings
 # which cause GNATS indigestion.
 
 DISTNAME=      apr-1.7.0
+PKGREVISION=   1
 CATEGORIES=    devel
 MASTER_SITES=  ${MASTER_SITE_APACHE:=apr/}
 EXTRACT_SUFX=  .tar.bz2
diff -r adba9cf9ab34 -r 9c5cdce1843c devel/apr/distinfo
--- a/devel/apr/distinfo        Thu Feb 20 06:23:22 2020 +0000
+++ b/devel/apr/distinfo        Thu Feb 20 06:25:28 2020 +0000
@@ -1,7 +1,10 @@
-$NetBSD: distinfo,v 1.45 2019/04/12 13:02:44 wiz Exp $
+$NetBSD: distinfo,v 1.46 2020/02/20 06:25:28 rin Exp $
 
 SHA1 (apr-1.7.0.tar.bz2) = 58ebc7b35efaebb211c0b9df594ab16c4d874234
 RMD160 (apr-1.7.0.tar.bz2) = 4b282845f4ba1c4949b7b386c438e5ef98deaf4b
 SHA512 (apr-1.7.0.tar.bz2) = 3dc42d5caf17aab16f5c154080f020d5aed761e22db4c5f6506917f6bfd2bf8becfb40af919042bd4ce1077d5de74aa666f5edfba7f275efba78e8893c115148
 Size (apr-1.7.0.tar.bz2) = 872238 bytes
+SHA1 (patch-atomic_unix_builtins.c) = e90d0232013650c3d227fa3a8be952c51b7148e8
+SHA1 (patch-atomic_unix_builtins64.c) = e24316e93dae12efc1cbfc3f444e8622df5e5833
 SHA1 (patch-include_apr__general.h) = bff357eee11218a6c53769278fc3f9094b062fdf
+SHA1 (patch-include_arch_unix_apr__arch__atomic.h) = 6f226add54f5966a50985441f6903853a0728c88
diff -r adba9cf9ab34 -r 9c5cdce1843c devel/apr/patches/patch-atomic_unix_builtins.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/apr/patches/patch-atomic_unix_builtins.c    Thu Feb 20 06:25:28 2020 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-atomic_unix_builtins.c,v 1.1 2020/02/20 06:25:28 rin Exp $
+
+Work around missing 64bit atomic builtins for non-x86 ILP32 platforms.
+
+--- atomic/unix/builtins.c.orig        2020-02-19 16:07:42.205846916 +0900
++++ atomic/unix/builtins.c     2020-02-19 16:08:29.237974955 +0900
+@@ -20,7 +20,11 @@
+ 
+ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p)
+ {
++#ifdef 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 -r adba9cf9ab34 -r 9c5cdce1843c devel/apr/patches/patch-atomic_unix_builtins64.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/apr/patches/patch-atomic_unix_builtins64.c  Thu Feb 20 06:25:28 2020 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-atomic_unix_builtins64.c,v 1.1 2020/02/20 06:25:28 rin Exp $
+
+Work around missing 64bit atomic builtins for non-x86 ILP32 platforms.
+
+--- atomic/unix/builtins64.c.orig      2020-02-19 16:06:32.153732769 +0900
++++ atomic/unix/builtins64.c   2020-02-19 16:08:48.239198201 +0900
+@@ -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)
+ {
+@@ -61,4 +61,4 @@ APR_DECLARE(apr_uint64_t) apr_atomic_xch
+     return __sync_lock_test_and_set(mem, val);
+ }
+ 
+-#endif /* USE_ATOMICS_BUILTINS */
++#endif /* USE_ATOMICS_BUILTINS && !NEED_ATOMICS_GENERIC64 */
diff -r adba9cf9ab34 -r 9c5cdce1843c devel/apr/patches/patch-include_arch_unix_apr__arch__atomic.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/apr/patches/patch-include_arch_unix_apr__arch__atomic.h     Thu Feb 20 06:25:28 2020 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-include_arch_unix_apr__arch__atomic.h,v 1.1 2020/02/20 06:25:28 rin Exp $
+
+Work around missing 64bit atomic builtins for non-x86 ILP32 platforms.
+
+--- include/arch/unix/apr_arch_atomic.h.orig   2020-02-19 15:50:52.065380193 +0900
++++ include/arch/unix/apr_arch_atomic.h        2020-02-19 15:51:59.253483287 +0900
+@@ -26,6 +26,9 @@
+ /* noop */
+ #elif HAVE_ATOMIC_BUILTINS
+ #   define USE_ATOMICS_BUILTINS
++#   ifndef __LP64__
++#     define NEED_ATOMICS_GENERIC64
++#   endif
+ #elif defined(SOLARIS2) && SOLARIS2 >= 10
+ #   define USE_ATOMICS_SOLARIS
+ #   define NEED_ATOMICS_GENERIC64



Home | Main Index | Thread Index | Old Index