From 391f5f087e602884334e6ddcf03737cecd0e5353 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sat, 8 Feb 2020 21:39:01 +0100 Subject: [PATCH] apr: bump to 1.7.0 & sync with master This is a squash of the following cherry-picked commits: 40a29bf0555c522f76e984f6cccb395d84fbe0d2 40c7e95210a44bc314f612bc66ef7864de2c09ba 893a804c957ea73c6060aa4964d5175432588f2d 12037b3f29f72be080c6f23498e2a38d89d01232 193c3913b6a1c8d273cb86e2598848fc8b3920b6 430ab5f9b3f1e439e1990dcf3405309fd03a9979 0c6d461cc9fea34eaf59517f5cb5ed1214a217de 86396c6a49a90a3b0bd2045e472b999a23ba3e77 Short summary: - version is bumped to 1.7.0 - Makefile and patches are updated and cleaned - adds myself as maintainer - improves the cross-compile setup (via configure variables, patches & sed scripts) For more details please check the individual commits provided above. Signed-off-by: Sebastian Kemper --- libs/apr/Makefile | 89 +++++++++++-------- libs/apr/patches/001-autoconf-compat.patch | 26 ------ libs/apr/patches/001-cross-compile.patch | 56 ++++++++++++ libs/apr/patches/002-sys-param-h.patch | 37 ++++++++ libs/apr/patches/101-fix_apr_time_now.patch | 13 --- .../patches/201-upgrade-and-fix-1.5.1.patch | 51 ----------- ...ze-doesn-t-match-in-glibc-when-cross.patch | 21 ++--- .../302-add-cache-for-strerror_r.patch | 30 +++++++ .../patches/303-add-cache-for-mmap-zero.patch | 25 ++++++ 9 files changed, 209 insertions(+), 139 deletions(-) delete mode 100644 libs/apr/patches/001-autoconf-compat.patch create mode 100644 libs/apr/patches/001-cross-compile.patch create mode 100644 libs/apr/patches/002-sys-param-h.patch delete mode 100644 libs/apr/patches/101-fix_apr_time_now.patch delete mode 100644 libs/apr/patches/201-upgrade-and-fix-1.5.1.patch create mode 100644 libs/apr/patches/302-add-cache-for-strerror_r.patch create mode 100644 libs/apr/patches/303-add-cache-for-mmap-zero.patch diff --git a/libs/apr/Makefile b/libs/apr/Makefile index 89fe9d2926..41cf7b7749 100644 --- a/libs/apr/Makefile +++ b/libs/apr/Makefile @@ -8,18 +8,24 @@ include $(TOPDIR)/rules.mk PKG_NAME:=apr -PKG_VERSION:=1.6.5 -PKG_RELEASE:=3 +PKG_VERSION:=1.7.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@APACHE/apr/ -PKG_HASH:=a67ca9fcf9c4ff59bce7f428a323c8b5e18667fdea7b0ebad47d194371b0a105 +PKG_HASH:=e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea + +PKG_MAINTAINER:=Thomas Heil , \ + Sebastian Kemper -PKG_MAINTAINER:=Thomas Heil PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +PKG_CPE_ID:=cpe:/a:apache:apr + +PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=autoreconf -PKG_REMOVE_FILES:=aclocal.m4 build/ltmain.sh PKG_INSTALL:=1 @@ -33,53 +39,64 @@ define Package/libapr URL:=https://apr.apache.org/ endef -TARGET_CFLAGS += $(FPIC) - CONFIGURE_ARGS += \ - --without-pic \ --with-devrandom=/dev/urandom \ $(call autoconf_bool,CONFIG_IPV6,ipv6) # XXX: ac_cv_sizeof_struct_iovec=1 is just to trick configure +# XXX: don't set apr_cv_use_lfs64=yes, see +# https://www.openwall.com/lists/musl/2020/02/03/18 +# XXX: the atomic builtins used require 8-byte intrinsics, which are available +# on all 64-bit architectures and some arm as well as x86 32-bit platforms CONFIGURE_VARS += \ + ap_cv_atomic_builtins=$(if $(CONFIG_ARCH_64BIT),yes,no) \ + ac_cv_file__dev_zero=yes \ + ac_cv_func_pthread_mutexattr_setpshared=yes \ + ac_cv_func_sem_open=yes \ + ac_cv_func_setpgrp_void=yes \ + ac_cv_mmap__dev_zero=yes \ + ac_cv_negative_eai=yes \ + ac_cv_o_nonblock_inherited=no \ ac_cv_sizeof_struct_iovec=1 \ ac_cv_struct_rlimit=yes \ - ac_cv_func_sem_open=yes \ - ac_cv_func_pthread_mutexattr_setpshared=yes \ + apr_cv_accept4=yes \ + apr_cv_dup3=yes \ + apr_cv_epoll=yes \ + apr_cv_epoll_create1=yes \ + apr_cv_gai_addrconfig=yes \ + apr_cv_mutex_recursive=yes \ apr_cv_mutex_robust_shared=yes \ - apr_cv_tcp_nodelay_with_cork=yes \ - apr_cv_sock_cloexec=yes \ apr_cv_process_shared_works=yes \ - apr_cv_mutex_recursive=yes \ - apr_cv_epoll_create1=yes \ - apr_cv_epoll=yes \ - apr_cv_dup3=yes \ - apr_cv_accept4=yes + apr_cv_pthreads_lib=-lpthread \ + apr_cv_sock_cloexec=yes \ + apr_cv_tcp_nodelay_with_cork=yes + +ifeq ($(call qstrip,$(CONFIG_LIBC)),musl) +CONFIGURE_VARS += \ + ac_cv_strerror_r_rc_int=yes +endif define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1 $(1)/usr/lib $(1)/usr/lib/pkgconfig $(1)/usr/share/build-1 - $(CP) $(PKG_INSTALL_DIR)/usr/bin/apr-1-config \ - $(1)/usr/bin/ - $(CP) $(PKG_INSTALL_DIR)/usr/include/apr-1/* \ - $(1)/usr/include/apr-1/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.{la,a,so*} \ - $(1)/usr/lib/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-1.pc \ - $(1)/usr/lib/pkgconfig/ - $(CP) $(PKG_INSTALL_DIR)/usr/share/build-1/* \ - $(1)/usr/share/build-1/ - $(SED) 's,^datadir=\"/usr/share\",datadir=\"$(STAGING_DIR)/usr/share\",g' $(1)/usr/bin/apr-1-config - $(SED) 's,^installbuilddir=\"/usr/share/build-1\",installbuilddir=\"$(STAGING_DIR)/usr/share/build-1\",g' $(1)/usr/bin/apr-1-config - $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(1)/usr/bin/apr-1-config - $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/apr-1-config - $(SED) 's,-L$$$$libdir,,g' $(1)/usr/bin/apr-1-config - $(SED) 's,-R$$$$libdir,,g' $(1)/usr/bin/apr-1-config - $(SED) 's,/usr/share/build-1,$(STAGING_DIR)/usr/share/build-1,g' $(1)/usr/share/build-1/apr_rules.mk + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1 \ + $(1)/usr/lib/pkgconfig $(1)/usr/share/build-1 + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/apr-1-config \ + $(1)/usr/bin + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/apr-1/* \ + $(1)/usr/include/apr-1 + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.{a,so*} $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-1.pc \ + $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/share/build-1/* $(1)/usr/share/build-1 + $(SED) '/^prefix=\|^exec_prefix=/s|/usr|$(STAGING_DIR)/usr|' \ + $(1)/usr/bin/apr-1-config + $(SED) '/^datadir=/s|/usr|$$$${prefix}|' $(1)/usr/bin/apr-1-config + $(SED) 's,/usr/share/build-1,$(STAGING_DIR)/usr/share/build-1,g' \ + $(1)/usr/share/build-1/apr_rules.mk endef define Package/libapr/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.so.* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.so.* $(1)/usr/lib endef $(eval $(call BuildPackage,libapr)) diff --git a/libs/apr/patches/001-autoconf-compat.patch b/libs/apr/patches/001-autoconf-compat.patch deleted file mode 100644 index acc94fc3f1..0000000000 --- a/libs/apr/patches/001-autoconf-compat.patch +++ /dev/null @@ -1,26 +0,0 @@ -Index: apr-1.5.2/Makefile.in -=================================================================== ---- apr-1.5.2.orig/Makefile.in -+++ apr-1.5.2/Makefile.in -@@ -3,6 +3,7 @@ srcdir=@srcdir@ - VPATH=@srcdir@ - top_srcdir=@apr_srcdir@ - top_blddir=@apr_builddir@ -+top_builddir=@top_builddir@ - - # - # APR (Apache Portable Runtime) library Makefile. -Index: apr-1.5.2/configure.in -=================================================================== ---- apr-1.5.2.orig/configure.in -+++ apr-1.5.2/configure.in -@@ -245,9 +245,6 @@ case $host in - gcc $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL.c - ;; - *) -- if test "x$LTFLAGS" = "x"; then -- LTFLAGS='--silent' -- fi - if test "$experimental_libtool" = "yes"; then - # Use a custom-made libtool replacement - echo "using jlibtool" diff --git a/libs/apr/patches/001-cross-compile.patch b/libs/apr/patches/001-cross-compile.patch new file mode 100644 index 0000000000..7fdb952fb9 --- /dev/null +++ b/libs/apr/patches/001-cross-compile.patch @@ -0,0 +1,56 @@ +Fix cross-compilation + +Patch was backported from Apache httpd: +http://svn.apache.org/viewvc?view=revision&revision=1327907 +http://svn.apache.org/viewvc?view=revision&revision=1328390 +http://svn.apache.org/viewvc?view=revision&revision=1328714 + +Patch submitted upstream: +https://issues.apache.org/bugzilla/show_bug.cgi?id=57058 + +Signed-off-by: Bernd Kuhls + +--- a/configure.in ++++ b/configure.in +@@ -118,6 +118,16 @@ AC_CANONICAL_SYSTEM + echo "Configuring APR library" + echo "Platform: $host" + ++dnl In case of cross compilation we set CC_FOR_BUILD to cc unless ++dnl we got already CC_FOR_BUILD from environment. ++if test "x${build_alias}" != "x${host_alias}"; then ++ if test "x${CC_FOR_BUILD}" = "x"; then ++ CC_FOR_BUILD=cc ++ fi ++fi ++AC_SUBST(CC_FOR_BUILD) ++AC_SUBST(CFLAGS_FOR_BUILD) ++ + dnl Some initial steps for configuration. We setup the default directory + dnl and which files are to be configured. + +--- a/Makefile.in ++++ b/Makefile.in +@@ -8,6 +8,8 @@ top_blddir=@apr_builddir@ + # APR (Apache Portable Runtime) library Makefile. + # + CPP = @CPP@ ++CC_FOR_BUILD = @CC_FOR_BUILD@ ++CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ + + # get substituted into some targets + APR_MAJOR_VERSION=@APR_MAJOR_VERSION@ +@@ -136,8 +138,13 @@ tools/gen_test_char.lo: tools/gen_test_c + $(APR_MKDIR) tools + $(LT_COMPILE) + ++ifdef CC_FOR_BUILD ++tools/gen_test_char@EXEEXT@: tools/gen_test_char.c $(LOCAL_LIBS) ++ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DCROSS_COMPILE -o $@ $< ++else + tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) + $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) ++endif + + include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@ + $(APR_MKDIR) include/private diff --git a/libs/apr/patches/002-sys-param-h.patch b/libs/apr/patches/002-sys-param-h.patch new file mode 100644 index 0000000000..220f427fa6 --- /dev/null +++ b/libs/apr/patches/002-sys-param-h.patch @@ -0,0 +1,37 @@ +Fix PATH_MAX detection by including sys/param.h if available + +Patch sent upstream: +https://bz.apache.org/bugzilla/show_bug.cgi?id=63782 + +Signed-off-by: Bernd Kuhls + +--- a/configure.in ++++ b/configure.in +@@ -1596,6 +1596,7 @@ AC_SUBST(stdlibh) + AC_SUBST(stringh) + AC_SUBST(stringsh) + AC_SUBST(sys_ioctlh) ++AC_SUBST(sys_paramh) + AC_SUBST(sys_sendfileh) + AC_SUBST(sys_signalh) + AC_SUBST(sys_socketh) +--- a/include/apr.h.in ++++ b/include/apr.h.in +@@ -95,6 +95,7 @@ + #define APR_HAVE_STRINGS_H @stringsh@ + #define APR_HAVE_INTTYPES_H @inttypesh@ + #define APR_HAVE_SYS_IOCTL_H @sys_ioctlh@ ++#define APR_HAVE_SYS_PARAM_H @sys_paramh@ + #define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@ + #define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ + #define APR_HAVE_SYS_SOCKET_H @sys_socketh@ +@@ -218,6 +219,9 @@ + #ifdef __cplusplus + extern "C" { + #endif ++#if APR_HAVE_SYS_PARAM_H ++#include ++#endif + + /** + * @addtogroup apr_platform diff --git a/libs/apr/patches/101-fix_apr_time_now.patch b/libs/apr/patches/101-fix_apr_time_now.patch deleted file mode 100644 index 6ad14a37c1..0000000000 --- a/libs/apr/patches/101-fix_apr_time_now.patch +++ /dev/null @@ -1,13 +0,0 @@ -https://dev.openwrt.org/ticket/9287 - ---- a/time/unix/time.c -+++ b/time/unix/time.c -@@ -75,7 +75,7 @@ APR_DECLARE(apr_time_t) apr_time_now(voi - { - struct timeval tv; - gettimeofday(&tv, NULL); -- return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec; -+ return tv.tv_sec * (apr_time_t)APR_USEC_PER_SEC + (apr_time_t)tv.tv_usec; - } - - static void explode_time(apr_time_exp_t *xt, apr_time_t t, diff --git a/libs/apr/patches/201-upgrade-and-fix-1.5.1.patch b/libs/apr/patches/201-upgrade-and-fix-1.5.1.patch deleted file mode 100644 index b4e5ab75b5..0000000000 --- a/libs/apr/patches/201-upgrade-and-fix-1.5.1.patch +++ /dev/null @@ -1,51 +0,0 @@ -Makefile.in: fix cross compiling failed - -The tools/gen_test_char was invoked at build time, -and it didn't work for the cross compiling, so we -compile it with $BUILDCC. - -Remove the 'tools' dir creation, it always existed. -And it caused gen_test_char unexpected rebuilt at -do_install time. - -Upstream-Status: inappropriate [oe specific] - -Signed-off-by: Hongxu Jia ---- - Makefile.in | 10 ++-------- - 1 file changed, 2 insertions(+), 8 deletions(-) - -Index: apr-1.5.2/Makefile.in -=================================================================== ---- apr-1.5.2.orig/Makefile.in -+++ apr-1.5.2/Makefile.in -@@ -20,7 +20,7 @@ INCDIR=./include - OSDIR=$(top_srcdir)/include/arch/@OSDIR@ - DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ - INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include/arch/@DEFAULT_OSDIR@ -I$(top_srcdir)/include -I$(top_srcdir)/include/private -I$(top_blddir)/include/private -- -+BUILDCC=gcc - # - # Macros for target determination - # -@@ -47,7 +47,6 @@ LT_VERSION = @LT_VERSION@ - - CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ - build/apr_rules.out tools/gen_test_char@EXEEXT@ \ -- tools/gen_test_char.o tools/gen_test_char.lo \ - include/private/apr_escape_test_char.h - DISTCLEAN_TARGETS = config.cache config.log config.status \ - include/apr.h include/arch/unix/apr_private.h \ -@@ -138,9 +137,9 @@ tools/gen_test_char.lo: tools/gen_test_c - $(APR_MKDIR) tools - $(LT_COMPILE) - --tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) -- $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) -- -+tools/gen_test_char@EXEEXT@: tools/gen_test_char.c -+ $(BUILDCC) $(CFLAGS_FOR_BUILD) $< -o $@ -+ - include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@ - $(APR_MKDIR) include/private - tools/gen_test_char@EXEEXT@ > $@ diff --git a/libs/apr/patches/301-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch b/libs/apr/patches/301-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch index d1b234f26f..ff0dc108d1 100644 --- a/libs/apr/patches/301-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch +++ b/libs/apr/patches/301-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch @@ -33,11 +33,9 @@ Upstream-Status: Pending configure.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -diff --git a/configure.in b/configure.in -index 3b10422..a227e72 100644 --- a/configure.in +++ b/configure.in -@@ -1771,7 +1771,7 @@ else +@@ -1809,7 +1809,7 @@ else socklen_t_value="int" fi @@ -46,25 +44,25 @@ index 3b10422..a227e72 100644 if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_short"; then pid_t_fmt='#define APR_PID_T_FMT "hd"' -@@ -1840,7 +1840,7 @@ APR_CHECK_TYPES_COMPATIBLE(ssize_t, long, [ssize_t_fmt="ld"]) - APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned int, [size_t_fmt="u"]) - APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned long, [size_t_fmt="lu"]) +@@ -1881,7 +1881,7 @@ APR_CHECK_TYPES_FMT_COMPATIBLE(size_t, u + APR_CHECK_TYPES_FMT_COMPATIBLE(size_t, unsigned int, u, [size_t_fmt="u"]) + ]) -APR_CHECK_SIZEOF_EXTENDED([#include ], ssize_t, 8) +AC_CHECK_SIZEOF(ssize_t) + dnl the else cases below should no longer occur; AC_MSG_CHECKING([which format to use for apr_ssize_t]) - if test -n "$ssize_t_fmt"; then -@@ -1857,7 +1857,7 @@ fi +@@ -1899,7 +1899,7 @@ fi ssize_t_fmt="#define APR_SSIZE_T_FMT \"$ssize_t_fmt\"" -APR_CHECK_SIZEOF_EXTENDED([#include ], size_t, 8) +AC_CHECK_SIZEOF(size_t) + # else cases below should no longer occur; AC_MSG_CHECKING([which format to use for apr_size_t]) - if test -n "$size_t_fmt"; then -@@ -1874,7 +1874,7 @@ fi +@@ -1917,7 +1917,7 @@ fi size_t_fmt="#define APR_SIZE_T_FMT \"$size_t_fmt\"" @@ -73,6 +71,3 @@ index 3b10422..a227e72 100644 if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then # Enable LFS --- -1.8.3.1 - diff --git a/libs/apr/patches/302-add-cache-for-strerror_r.patch b/libs/apr/patches/302-add-cache-for-strerror_r.patch new file mode 100644 index 0000000000..c25175d590 --- /dev/null +++ b/libs/apr/patches/302-add-cache-for-strerror_r.patch @@ -0,0 +1,30 @@ +--- a/build/apr_common.m4 ++++ b/build/apr_common.m4 +@@ -526,8 +526,9 @@ dnl string. + dnl + dnl + AC_DEFUN([APR_CHECK_STRERROR_R_RC], [ +-AC_MSG_CHECKING(for type of return code from strerror_r) +-AC_TRY_RUN([ ++AC_CACHE_CHECK([whether return code from strerror_r has type int], ++[ac_cv_strerror_r_rc_int], ++[AC_TRY_RUN([ + #include + #include + #include +@@ -543,14 +544,10 @@ main() + }], [ + ac_cv_strerror_r_rc_int=yes ], [ + ac_cv_strerror_r_rc_int=no ], [ +- ac_cv_strerror_r_rc_int=no ] ) ++ ac_cv_strerror_r_rc_int=no ] ) ] ) + if test "x$ac_cv_strerror_r_rc_int" = xyes; then + AC_DEFINE(STRERROR_R_RC_INT, 1, [Define if strerror returns int]) +- msg="int" +-else +- msg="pointer" + fi +-AC_MSG_RESULT([$msg]) + ] ) + + dnl diff --git a/libs/apr/patches/303-add-cache-for-mmap-zero.patch b/libs/apr/patches/303-add-cache-for-mmap-zero.patch new file mode 100644 index 0000000000..482b99caa9 --- /dev/null +++ b/libs/apr/patches/303-add-cache-for-mmap-zero.patch @@ -0,0 +1,25 @@ +--- a/configure.in ++++ b/configure.in +@@ -1191,8 +1191,9 @@ AC_CHECK_FILE(/dev/zero) + # Not all systems can mmap /dev/zero (such as HP-UX). Check for that. + if test "$ac_cv_func_mmap" = "yes" && + test "$ac_cv_file__dev_zero" = "yes"; then +- AC_MSG_CHECKING(for mmap that can map /dev/zero) +- AC_TRY_RUN([ ++ AC_CACHE_CHECK([for mmap that can map /dev/zero], ++ [ac_cv_mmap__dev_zero], ++ [AC_TRY_RUN([ + #include + #include + #include +@@ -1215,9 +1216,7 @@ if test "$ac_cv_func_mmap" = "yes" && + return 3; + } + return 0; +- }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no]) +- +- AC_MSG_RESULT($ac_cv_file__dev_zero) ++ }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no])]) + fi + + # Now we determine which one is our anonymous shmem preference. -- 2.30.2