From: gmbeard <gmbeard@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] apr: update to 1.7.2.
Date: Sat, 25 Mar 2023 09:55:52 +0100 [thread overview]
Message-ID: <20230325085552.BzCPA-cqzg5vVp0bjXPmhhlmIuPYHXx63IT0wExLs5c@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-42972@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]
There is an updated pull request by gmbeard against master on the void-packages repository
https://github.com/gmbeard/void-packages apr/update-to-1.7.2
https://github.com/void-linux/void-packages/pull/42972
apr: update to 1.7.2.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **NO**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86\_64-glibc
- I built this PR locally for these architectures:
- aarch64
This also addresses #42441
- [x] apr
### Tests to fix
- [x] `testatomic`: consistency failure on atomic (i686)
- [ ] `testsockets`: Socket bind failure (x86\_64, i686, x86\_64-musl)
- [ ] `testdso` failure (x86\_64-musl)
A patch file from https://github.com/void-linux/void-packages/pull/42972.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-apr/update-to-1.7.2-42972.patch --]
[-- Type: text/x-diff, Size: 8173 bytes --]
From 9c7235c00890eaf89af9e8df6d391beb8698f579 Mon Sep 17 00:00:00 2001
From: Greg Beard <gmbeard@googlemail.com>
Date: Fri, 24 Mar 2023 06:54:43 +0000
Subject: [PATCH] apr: update to 1.7.2.
---
srcpkgs/apr/files/etc-services | 5 ++
srcpkgs/apr/files/musl-dso.patch | 21 ++++++++
srcpkgs/apr/patches/0001-testatomics.patch | 14 ++++++
srcpkgs/apr/patches/0002-mutex64.patch | 29 +++++++++++
srcpkgs/apr/patches/atomic64.patch | 56 ----------------------
srcpkgs/apr/template | 22 +++++----
6 files changed, 83 insertions(+), 64 deletions(-)
create mode 100644 srcpkgs/apr/files/etc-services
create mode 100644 srcpkgs/apr/files/musl-dso.patch
create mode 100644 srcpkgs/apr/patches/0001-testatomics.patch
create mode 100644 srcpkgs/apr/patches/0002-mutex64.patch
delete mode 100644 srcpkgs/apr/patches/atomic64.patch
diff --git a/srcpkgs/apr/files/etc-services b/srcpkgs/apr/files/etc-services
new file mode 100644
index 000000000000..eb7b714df6b0
--- /dev/null
+++ b/srcpkgs/apr/files/etc-services
@@ -0,0 +1,5 @@
+ftp 21/tcp
+ftp 21/udp
+ftp 21/sctp
+telnet 23/tcp
+telnet 23/udp
diff --git a/srcpkgs/apr/files/musl-dso.patch b/srcpkgs/apr/files/musl-dso.patch
new file mode 100644
index 000000000000..07e277c0cb55
--- /dev/null
+++ b/srcpkgs/apr/files/musl-dso.patch
@@ -0,0 +1,21 @@
+--- a/dso/unix/dso.c 2008-06-18 05:58:40.000000000 +0100
++++ b/dso/unix/dso.c 2023-03-25 08:22:08.655506799 +0000
+@@ -173,6 +173,18 @@
+ apr_dso_handle_t *handle,
+ const char *symname)
+ {
++ /* This is necessary for `testdso.c`. For some reason, musl
++ * builds fail the `test_unload_library` test if the below
++ * check isn't in place. `test_unload_library` unloads the
++ * library and then immediately calls this function. Maybe
++ * musl's `dlsym()` assumes the handle is never NULL and
++ * some UB is being invoked here...
++ */
++ if (handle->handle == NULL) {
++ handle->errormsg = "library not loaded";
++ return APR_ESYMNOTFOUND;
++ }
++
+ #if defined(DSO_USE_SHL)
+ void *symaddr = NULL;
+ int status;
diff --git a/srcpkgs/apr/patches/0001-testatomics.patch b/srcpkgs/apr/patches/0001-testatomics.patch
new file mode 100644
index 000000000000..cbd8533e9482
--- /dev/null
+++ b/srcpkgs/apr/patches/0001-testatomics.patch
@@ -0,0 +1,14 @@
+diff --git a/test/testatomic.c b/test/testatomic.c
+index a6df042..4571faa 100644
+--- a/test/testatomic.c
++++ b/test/testatomic.c
+
+@@ -662,6 +662,9 @@
+ pthread_setconcurrency(8);
+ #endif
+
++ mutex_locks64 = 0;
++ apr_atomic_set64(&atomic_ops64, 0);
++
+ rv = apr_thread_mutex_create(&thread_lock64, APR_THREAD_MUTEX_DEFAULT, p);
+ APR_ASSERT_SUCCESS(tc, "Could not create lock", rv);
\ No newline at end of file
diff --git a/srcpkgs/apr/patches/0002-mutex64.patch b/srcpkgs/apr/patches/0002-mutex64.patch
new file mode 100644
index 000000000000..b58626004d6f
--- /dev/null
+++ b/srcpkgs/apr/patches/0002-mutex64.patch
@@ -0,0 +1,29 @@
+--- a/atomic/unix/mutex64.c 2023/02/09 12:45:02 1907540
++++ b/atomic/unix/mutex64.c 2023/02/09 13:36:18 1907541
+@@ -96,7 +96,26 @@
+
+ APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem)
+ {
++ /* On 32bit CPUs this loads with two instructions (tearing),
++ * so a lock is needed to ensure atomicity.
++ *
++ * APR_SIZEOF_VOIDP is probably not the right check for 32 vs 64 bits CPUs
++ * but it spares an (hardly-)exhaustive list of supported CPUs (and using
++ * assembly). If APR_SIZEOF_VOIDP==4 means that the compiler generates
++ * 32bit instructions (-m32 or whatever) then it's the right check though.
++ */
++#if APR_SIZEOF_VOIDP >= 8
+ return *mem;
++#else
++ apr_uint64_t cur_value;
++ DECLARE_MUTEX_LOCKED(mutex, mem);
++
++ cur_value = *mem;
++
++ MUTEX_UNLOCK(mutex);
++
++ return cur_value;
++#endif
+ }
+
+ APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val)
diff --git a/srcpkgs/apr/patches/atomic64.patch b/srcpkgs/apr/patches/atomic64.patch
deleted file mode 100644
index ced9b7df0abd..000000000000
--- a/srcpkgs/apr/patches/atomic64.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-commit 69e9378eb86357d4361322256d5d5a39ff4a592d
-Author: q66 <daniel@octaforge.org>
-Date: Fri Jan 10 13:04:37 2020 +0100
-
- use __atomic builtins instead of legacy __sync
-
- This allows for 64-bit atomic ops on platforms that don't natively
- support them such as armv6 and ppc32.
-
-diff --git atomic/unix/builtins64.c atomic/unix/builtins64.c
-index 4a4b685..90b5c5e 100644
---- a/atomic/unix/builtins64.c
-+++ b/atomic/unix/builtins64.c
-@@ -30,35 +30,34 @@ APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val)
-
- APR_DECLARE(apr_uint64_t) apr_atomic_add64(volatile apr_uint64_t *mem, apr_uint64_t val)
- {
-- return __sync_fetch_and_add(mem, val);
-+ return __atomic_fetch_add(mem, val, __ATOMIC_SEQ_CST);
- }
-
- APR_DECLARE(void) apr_atomic_sub64(volatile apr_uint64_t *mem, apr_uint64_t val)
- {
-- __sync_fetch_and_sub(mem, val);
-+ __atomic_fetch_sub(mem, val, __ATOMIC_SEQ_CST);
- }
-
- APR_DECLARE(apr_uint64_t) apr_atomic_inc64(volatile apr_uint64_t *mem)
- {
-- return __sync_fetch_and_add(mem, 1);
-+ return __atomic_fetch_add(mem, 1, __ATOMIC_SEQ_CST);
- }
-
- APR_DECLARE(int) apr_atomic_dec64(volatile apr_uint64_t *mem)
- {
-- return __sync_sub_and_fetch(mem, 1);
-+ return (int)__atomic_sub_fetch(mem, 1, __ATOMIC_SEQ_CST);
- }
-
- APR_DECLARE(apr_uint64_t) apr_atomic_cas64(volatile apr_uint64_t *mem, apr_uint64_t with,
- apr_uint64_t cmp)
- {
-- return __sync_val_compare_and_swap(mem, cmp, with);
-+ __atomic_compare_exchange_n(mem, &cmp, with, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
-+ return cmp;
- }
-
- APR_DECLARE(apr_uint64_t) apr_atomic_xchg64(volatile apr_uint64_t *mem, apr_uint64_t val)
- {
-- __sync_synchronize();
--
-- return __sync_lock_test_and_set(mem, val);
-+ return __atomic_exchange_n(mem, val, __ATOMIC_SEQ_CST);
- }
-
- #endif /* USE_ATOMICS_BUILTINS */
diff --git a/srcpkgs/apr/template b/srcpkgs/apr/template
index 6fb1fefd4f62..40bbbf875f8e 100644
--- a/srcpkgs/apr/template
+++ b/srcpkgs/apr/template
@@ -1,7 +1,7 @@
# Template file for 'apr'
pkgname=apr
-version=1.7.0
-revision=4
+version=1.7.2
+revision=1
build_style=gnu-configure
configure_args="--with-installbuilddir=/usr/share/apr-1/build"
makedepends="expat-devel libuuid-devel"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
license="Apache-2.0"
homepage="https://apr.apache.org/"
distfiles="https://www.apache.org/dist/apr/apr-${version}.tar.bz2"
-checksum=e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea
+checksum=75e77cc86776c030c0a5c408dfbd0bf2a0b75eed5351e52d5439fa1e5509a43e
# Do not redefine struct iovec in include/apr_want.h
CFLAGS="-DAPR_IOVEC_DEFINED=1"
@@ -29,14 +29,21 @@ if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
LDFLAGS="-latomic"
fi
+do_check() {
+ cp "${FILESDIR}/etc-services" "${XBPS_MASTERDIR}/etc/services"
+ make test
+}
+
+post_extract() {
+ if [ "${XBPS_TARGET_LIBC}" = "musl" ]; then
+ patch -d "${wrksrc}" -Np1 <"${FILESDIR}/musl-dso.patch"
+ fi
+}
+
pre_build() {
if [ "$CROSS_BUILD" ]; then
- vsed -i Makefile \
- -e "/LINK_PROG.*OBJECTS_gen_test_char/s|.*|\t${BUILD_CC} ${BUILD_CFLAGS} tools/gen_test_char.c -o tools/gen_test_char|"
# Fixup some not detected configure results to match native builds
vsed -i include/apr.h \
- -e "/#define APR_HAVE_SHMEM_MMAP_ZERO/s;0;1;" \
- -e "/#define APR_HAVE_IOVEC/s;0;1;" \
-e "/#define APR_HAS_POSIXSEM_SERIALIZE/s;0;1;" \
-e "/#define APR_HAS_PROC_PTHREAD_SERIALIZE/s;0;1;"
fi
@@ -45,7 +52,6 @@ pre_build() {
post_install() {
if [ "$CROSS_BUILD" ]; then
vsed -i -e "s,$XBPS_CROSS_BASE,,g" \
- "$DESTDIR/usr/bin/apr-1-config" \
"$DESTDIR/usr/share/apr-1/build/apr_rules.mk"
fi
}
next prev parent reply other threads:[~2023-03-25 8:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-24 6:58 [PR PATCH] " gmbeard
2023-03-24 7:45 ` [PR PATCH] [Updated] " gmbeard
2023-03-24 8:28 ` gmbeard
2023-03-24 17:49 ` gmbeard
2023-03-25 8:55 ` gmbeard [this message]
2023-03-25 8:58 ` gmbeard
2023-03-25 11:34 ` gmbeard
2023-03-25 12:00 ` gmbeard
2023-03-28 19:37 ` gmbeard
2023-03-28 20:08 ` gmbeard
2023-04-05 4:29 ` gmbeard
2023-04-19 19:46 ` [PR REVIEW] " paper42
2023-04-19 19:46 ` paper42
2023-04-19 19:54 ` nekopsykose
2023-04-21 6:21 ` [PR PATCH] [Updated] " gmbeard
2023-04-21 6:23 ` [PR REVIEW] apr: update to 1.7.4 gmbeard
2023-04-21 6:26 ` gmbeard
2023-04-21 6:28 ` gmbeard
2023-04-21 6:44 ` [PR REVIEW] " gmbeard
2023-04-21 6:45 ` gmbeard
2023-07-21 1:55 ` github-actions
2023-08-05 1:48 ` [PR PATCH] [Closed]: " github-actions
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230325085552.BzCPA-cqzg5vVp0bjXPmhhlmIuPYHXx63IT0wExLs5c@z \
--to=gmbeard@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).