apr: update to 1.7.4.

This commit is contained in:
Đoàn Trần Công Danh 2024-03-29 21:11:35 +07:00 committed by Đoàn Trần Công Danh
parent 88a25c8f62
commit 3571de8a06
4 changed files with 78 additions and 76 deletions

View File

@ -239,6 +239,5 @@ hook() {
generic_wrapper3 giblib-config
python_wrapper python-config 2.7
python_wrapper python3-config 3.12
apr_apu_wrapper apr-1-config
apr_apu_wrapper apu-1-config
}

View File

@ -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 */

View File

@ -0,0 +1,51 @@
musl never unload libraries
--- a/test/testdso.c
+++ b/test/testdso.c
@@ -117,6 +117,7 @@ static void test_dso_sym_return_value(ab
static void test_unload_module(abts_case *tc, void *data)
{
+#ifdef __GLIBC__
apr_dso_handle_t *h = NULL;
apr_status_t status;
char errstr[256];
@@ -131,6 +132,7 @@ static void test_unload_module(abts_case
status = apr_dso_sym(&func1, h, "print_hello");
ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status));
+#endif
}
@@ -203,6 +205,7 @@ static void test_dso_sym_return_value_li
static void test_unload_library(abts_case *tc, void *data)
{
+#ifdef __GLIBC__
apr_dso_handle_t *h = NULL;
apr_status_t status;
char errstr[256];
@@ -217,6 +220,7 @@ static void test_unload_library(abts_cas
status = apr_dso_sym(&func1, h, "print_hello");
ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status));
+#endif
}
#endif /* def(LIB_NAME) */
--- a/test/testsockets.c
+++ b/test/testsockets.c
@@ -228,10 +228,13 @@ abts_suite *testsockets(abts_suite *suit
abts_run_test(suite, tcp6_socket, NULL);
abts_run_test(suite, udp6_socket, NULL);
+#define BROKEN_IN_CI 1
+#if BROKEN_IN_CI
abts_run_test(suite, sendto_receivefrom6, NULL);
#endif
abts_run_test(suite, socket_userdata, NULL);
+#endif
return suite;
}

View File

@ -1,27 +1,28 @@
# Template file for 'apr'
pkgname=apr
version=1.7.0
revision=4
version=1.7.4
revision=1
build_style=gnu-configure
configure_args="--with-installbuilddir=/usr/share/apr-1/build"
makedepends="expat-devel libuuid-devel"
checkdepends="gdb iana-etc"
short_desc="Apache Portable Runtime Library"
maintainer="Orphaned <orphan@voidlinux.org>"
license="Apache-2.0"
homepage="https://apr.apache.org/"
distfiles="https://archive.apache.org/dist/apr/apr-${version}.tar.bz2"
checksum=e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea
# Do not redefine struct iovec in include/apr_want.h
CFLAGS="-DAPR_IOVEC_DEFINED=1"
checksum=fc648de983f3a2a6c9e78dea1f180639bd2fad6c06d556d4367a701fe5c35577
# Can't run test programs when cross compiling
# NOTE always diff between native and cross build!!!
if [ "$CROSS_BUILD" ]; then
configure_args+=" apr_cv_pthreads_cflags=-pthread"
configure_args+=" apr_cv_process_shared_works=yes"
configure_args+=" apr_cv_mutex_robust_shared=yes"
configure_args+=" apr_cv_tcp_nodelay_with_cork=yes"
configure_args+=" ac_cv_func_sem_open=sem_open"
configure_args+=" ac_cv_func_sem_open=yes"
configure_args+=" ac_cv_mmap__dev_zero=yes"
configure_args+=" ac_cv_struct_rlimit=yes"
fi
# The apr package doesn't use crypt_r, however apr-util does,
@ -30,29 +31,36 @@ if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
makedepends+=" libxcrypt-devel"
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;"
do_check() {
local _args
cd test
if [ "$XBPS_BUILD_ENVIRONMENT" = void-packages-ci ]; then
sed -i 's/if BROKEN_IN_CI/if 0/' testsockets.c
if [ "$XBPS_LIBC" = musl ]; then
# unable to resolve back from 127.0.0.1
_args="-x testsock"
fi
fi
make ${makejobs}
./testall ${_args}
}
post_install() {
sed -i -e 's,-ffile-prefix-map=[^[:space:]]*,,' \
"$DESTDIR/usr/share/apr-1/build/apr_rules.mk"
if [ "$CROSS_BUILD" ]; then
vsed -i -e "s,$XBPS_CROSS_BASE,,g" \
"$DESTDIR/usr/bin/apr-1-config" \
sed -i -e 's;cross_compiling=.*;cross_compiling=;' \
"$DESTDIR/usr/bin/apr-1-config"
sed -i -e "s,$XBPS_CROSS_BASE,,g" \
"$DESTDIR/usr/share/apr-1/build/apr_rules.mk"
fi
}
apr-devel_package() {
depends="libtool libuuid-devel apr>=${version}_${revision}"
if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
depends+=" libxcrypt-devel"
fi
short_desc+=" - development files"
pkg_install() {
vmove usr/include