nginx: update to 1.26.2.

This commit is contained in:
Duncaen 2024-08-18 14:13:59 +02:00
parent dc8aba8ed8
commit a8ac3d1dc1
No known key found for this signature in database
GPG Key ID: 335C1D17EC3D6E35
4 changed files with 415 additions and 2 deletions

View File

@ -0,0 +1,12 @@
--- a/nginx/ngx_js.c
+++ b/nginx/ngx_js.c
@@ -88,9 +88,6 @@
njs_module_t *njs_js_addon_modules[] = {
- &njs_webcrypto_module,
- &njs_xml_module,
- &njs_zlib_module,
NULL,
};

View File

@ -0,0 +1,15 @@
Fix compatibility with nginx 1.20.x.
See-Also: https://github.com/nginx/njs/issues/18
--- a/nginx/config.make
+++ b/nginx/config.make
@@ -3,7 +3,7 @@
$ngx_addon_dir/../build/libnjs.a: $NGX_MAKEFILE
cd $ngx_addon_dir/.. \\
&& if [ -f build/Makefile ]; then \$(MAKE) clean; fi \\
- && CFLAGS="\$(CFLAGS)" CC="\$(CC)" ./configure --no-openssl --no-libxml2 --no-zlib --no-pcre \\
+ && CFLAGS="\$(CFLAGS)" CC="\$(CC)" ./configure \\
&& \$(MAKE) libnjs
END

View File

@ -0,0 +1,386 @@
From 81c86a1eb0e112799814b3eadc377b1df9df29e4 Mon Sep 17 00:00:00 2001
From: Duncan Overbruck <mail@duncano.de>
Date: Tue, 18 Apr 2023 22:58:18 +0200
Subject: [PATCH] add cross build support
---
auto/cc/conf | 6 ++---
auto/cc/name | 6 ++++-
configure | 51 ++++++++++++++++++++++++++++------------
auto/endianness | 59 +++++++++++++++++++++++++++++++++--------------
auto/os/linux | 10 ++++----
auto/types/sizeof | 49 +++++++++++++++++++++++++++++++++------
auto/unix | 10 ++++----
7 files changed, 138 insertions(+), 53 deletions(-)
diff --git a/auto/cc/conf b/auto/cc/conf
index ba31cb88..fab32ccd 100644
--- a/auto/cc/conf
+++ b/auto/cc/conf
@@ -183,7 +183,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
else
ngx_feature="gcc builtin atomic operations"
ngx_feature_name=NGX_HAVE_GCC_ATOMIC
- ngx_feature_run=yes
+ ngx_feature_run=$NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
@@ -204,7 +204,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
else
ngx_feature="C99 variadic macros"
ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS"
- ngx_feature_run=yes
+ ngx_feature_run=$NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs="#include <stdio.h>
#define var(dummy, ...) sprintf(__VA_ARGS__)"
ngx_feature_path=
@@ -218,7 +218,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
ngx_feature="gcc variadic macros"
ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
- ngx_feature_run=yes
+ ngx_feature_run=$NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs="#include <stdio.h>
#define var(dummy, args...) sprintf(args)"
ngx_feature_path=
diff --git a/auto/cc/name b/auto/cc/name
index ded93f5b..b6494335 100644
--- a/auto/cc/name
+++ b/auto/cc/name
@@ -7,7 +7,11 @@ if [ "$NGX_PLATFORM" != win32 ]; then
ngx_feature="C compiler"
ngx_feature_name=
- ngx_feature_run=yes
+ if [ "$NGX_PLATFORM" = "$NGX_HOST_PLATFORM" ]; then
+ ngx_feature_run=yes
+ else
+ ngx_feature_run=no
+ fi
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
diff --git a/configure b/configure
index 5b88ebb4..e61465f5 100755
--- a/configure
+++ b/configure
@@ -23,28 +23,49 @@ if [ $NGX_DEBUG = YES ]; then
have=NGX_DEBUG . auto/have
fi
+echo "checking for OS"
-if test -z "$NGX_PLATFORM"; then
- echo "checking for OS"
+NGX_HOST_SYSTEM=`uname -s 2>/dev/null`
+NGX_HOST_RELEASE=`uname -r 2>/dev/null`
+NGX_HOST_MACHINE=`uname -m 2>/dev/null`
- NGX_SYSTEM=`uname -s 2>/dev/null`
- NGX_RELEASE=`uname -r 2>/dev/null`
- NGX_MACHINE=`uname -m 2>/dev/null`
+echo " + $NGX_HOST_SYSTEM $NGX_HOST_RELEASE $NGX_HOST_MACHINE"
- echo " + $NGX_SYSTEM $NGX_RELEASE $NGX_MACHINE"
+NGX_HOST_PLATFORM="$NGX_SYSTEM:$NGX_RELEASE:$NGX_MACHINE";
- NGX_PLATFORM="$NGX_SYSTEM:$NGX_RELEASE:$NGX_MACHINE";
+case "$NGX_HOST_SYSTEM" in
+ MINGW32_* | MINGW64_* | MSYS_*)
+ NGX_HOST_PLATFORM=win32
+ ;;
+esac
- case "$NGX_SYSTEM" in
- MINGW32_* | MINGW64_* | MSYS_*)
- NGX_PLATFORM=win32
- ;;
- esac
+if test -z "$NGX_PLATFORM"; then
+ NGX_SYSTEM=$NGX_HOST_SYSTEM
+ NGX_RELEASE=$NGX_HOST_RELEASE
+ NGX_MACHINE=$NGX_HOST_MACHINE
+ NGX_PLATFORM="$NGX_HOST_PLATFORM"
+ NGX_PLATFORM_FEATURE_RUN=yes
else
- echo "building for $NGX_PLATFORM"
- NGX_SYSTEM=$NGX_PLATFORM
- NGX_MACHINE=i386
+ echo "checking for target OS"
+
+ OIFS=$IFS
+ IFS=- read field1 field2 field3 field4 <<EOF
+$NGX_PLATFORM
+EOF
+ case "$NGX_PLATFORM" in
+ *-unknown-linux-* | *-pc-linux-* | *-linux-*)
+ NGX_SYSTEM=Linux
+ NGX_MACHINE=$field1
+ NGX_PLATFORM="$NGX_SYSTEM::$NGX_MACHINE"
+ NGX_PLATFORM_FEATURE_RUN=no
+ ;;
+ *)
+ NGX_SYSTEM=$NGX_PLATFORM
+ NGX_MACHINE=i386
+ NGX_PLATFORM_FEATURE_RUN=yes
+ esac
+ echo " + $NGX_SYSTEM $NGX_RELEASE $NGX_MACHINE"
fi
. auto/cc/conf
diff --git a/auto/endianness b/auto/endianness
index 1b552b6b..2f1379e2 100644
--- a/auto/endianness
+++ b/auto/endianness
@@ -12,8 +12,32 @@ checking for system byte ordering
END
+if [ $NGX_PLATFORM != $NGX_HOST_PLATFORM ]; then
-cat << END > $NGX_AUTOTEST.c
+ cat << END > $NGX_AUTOTEST.c
+#include <endian.h>
+
+int main(void) {
+ int a[BYTE_ORDER == LITTLE_ENDIAN ? 1 : -1];
+ return 1;
+}
+
+END
+ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
+
+ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
+
+ if [ -x $NGX_AUTOTEST ]; then
+ echo " little endian"
+ have=NGX_HAVE_LITTLE_ENDIAN . auto/have
+ else
+ echo " big endian"
+ fi
+
+else
+
+ cat << END > $NGX_AUTOTEST.c
int main(void) {
int i = 0x11223344;
@@ -26,25 +50,26 @@ int main(void) {
END
-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
+ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
+ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-if [ -x $NGX_AUTOTEST ]; then
- if $NGX_AUTOTEST >/dev/null 2>&1; then
- echo " little endian"
- have=NGX_HAVE_LITTLE_ENDIAN . auto/have
- else
- echo " big endian"
- fi
+ if [ -x $NGX_AUTOTEST ]; then
+ if $NGX_AUTOTEST >/dev/null 2>&1; then
+ echo " little endian"
+ have=NGX_HAVE_LITTLE_ENDIAN . auto/have
+ else
+ echo " big endian"
+ fi
- rm -rf $NGX_AUTOTEST*
+ rm -rf $NGX_AUTOTEST*
-else
- rm -rf $NGX_AUTOTEST*
+ else
+ rm -rf $NGX_AUTOTEST*
- echo
- echo "$0: error: cannot detect system byte ordering"
- exit 1
+ echo
+ echo "$0: error: cannot detect system byte ordering"
+ exit 1
+ fi
fi
diff --git a/auto/os/linux b/auto/os/linux
index eb670267..e1b067ee 100644
--- a/auto/os/linux
+++ b/auto/os/linux
@@ -36,7 +36,7 @@ fi
ngx_feature="epoll"
ngx_feature_name="NGX_HAVE_EPOLL"
-ngx_feature_run=yes
+ngx_feature_run=$NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs="#include <sys/epoll.h>"
ngx_feature_path=
ngx_feature_libs=
@@ -135,7 +135,7 @@ ngx_feature_test="int fd; struct stat sb;
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE"
ngx_feature="sendfile()"
ngx_feature_name="NGX_HAVE_SENDFILE"
-ngx_feature_run=yes
+ngx_feature_run=NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs="#include <sys/sendfile.h>
#include <errno.h>"
ngx_feature_path=
@@ -156,7 +156,7 @@ fi
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
ngx_feature="sendfile64()"
ngx_feature_name="NGX_HAVE_SENDFILE64"
-ngx_feature_run=yes
+ngx_feature_run=#NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs="#include <sys/sendfile.h>
#include <errno.h>"
ngx_feature_path=
@@ -174,7 +174,7 @@ ngx_include="sys/prctl.h"; . auto/include
ngx_feature="prctl(PR_SET_DUMPABLE)"
ngx_feature_name="NGX_HAVE_PR_SET_DUMPABLE"
-ngx_feature_run=yes
+ngx_feature_run=$NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs="#include <sys/prctl.h>"
ngx_feature_path=
ngx_feature_libs=
@@ -186,7 +186,7 @@ ngx_feature_test="if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) return 1"
ngx_feature="prctl(PR_SET_KEEPCAPS)"
ngx_feature_name="NGX_HAVE_PR_SET_KEEPCAPS"
-ngx_feature_run=yes
+ngx_feature_run=$NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs="#include <sys/prctl.h>"
ngx_feature_path=
ngx_feature_libs=
diff --git a/auto/types/sizeof b/auto/types/sizeof
index 480d8cfa..c4312f11 100644
--- a/auto/types/sizeof
+++ b/auto/types/sizeof
@@ -14,7 +14,41 @@ END
ngx_size=
-cat << END > $NGX_AUTOTEST.c
+if [ $NGX_PLATFORM != $NGX_HOST_PLATFORM ]; then
+ for ngx_try_sizeof in 4 8; do
+ cat << END > $NGX_AUTOTEST.c
+
+#include <sys/types.h>
+#include <sys/time.h>
+$NGX_INCLUDE_UNISTD_H
+#include <signal.h>
+#include <stdio.h>
+#include <sys/resource.h>
+$NGX_INCLUDE_INTTYPES_H
+$NGX_INCLUDE_AUTO_CONFIG_H
+
+int main(void) {
+ int a[sizeof($ngx_type) == $ngx_try_sizeof ? 1 : -1];
+ return 0;
+}
+
+END
+ rm -rf $NGX_AUTOTEST
+ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
+
+ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
+ if [ -x $NGX_AUTOTEST ]; then
+ ngx_size=$ngx_try_sizeof
+ echo " $ngx_size bytes"
+ break
+ fi
+ rm -rf $NGX_AUTOTEST*
+ done
+
+else
+
+ cat << END > $NGX_AUTOTEST.c
#include <sys/types.h>
#include <sys/time.h>
@@ -33,17 +67,18 @@ int main(void) {
END
-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
+ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-if [ -x $NGX_AUTOTEST ]; then
- ngx_size=`$NGX_AUTOTEST`
- echo " $ngx_size bytes"
-fi
+ if [ -x $NGX_AUTOTEST ]; then
+ ngx_size=`$NGX_AUTOTEST`
+ echo " $ngx_size bytes"
+ fi
+fi
case $ngx_size in
4)
diff --git a/auto/unix b/auto/unix
index 86710198..c9bd0120 100644
--- a/auto/unix
+++ b/auto/unix
@@ -99,7 +99,7 @@ if test -z "$NGX_KQUEUE_CHECKED"; then
ngx_feature="kqueue's EVFILT_TIMER"
ngx_feature_name="NGX_HAVE_TIMER_EVENT"
- ngx_feature_run=yes
+ ngx_feature_run=$NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs="#include <sys/event.h>
#include <sys/time.h>"
ngx_feature_path=
@@ -805,7 +805,7 @@ ngx_feature_test="void *p; p = memalign(4096, 4096);
ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
ngx_feature_name="NGX_HAVE_MAP_ANON"
-ngx_feature_run=yes
+ngx_feature_run=$NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs="#include <sys/mman.h>"
ngx_feature_path=
ngx_feature_libs=
@@ -818,7 +818,7 @@ ngx_feature_test="void *p;
ngx_feature='mmap("/dev/zero", MAP_SHARED)'
ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
-ngx_feature_run=yes
+ngx_feature_run=$NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs="#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>"
@@ -833,7 +833,7 @@ ngx_feature_test='void *p; int fd;
ngx_feature="System V shared memory"
ngx_feature_name="NGX_HAVE_SYSVSHM"
-ngx_feature_run=yes
+ngx_feature_run=$NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs="#include <sys/ipc.h>
#include <sys/shm.h>"
ngx_feature_path=
@@ -847,7 +847,7 @@ ngx_feature_test="int id;
ngx_feature="POSIX semaphores"
ngx_feature_name="NGX_HAVE_POSIX_SEM"
-ngx_feature_run=yes
+ngx_feature_run=$NGX_PLATFORM_FEATURE_RUN
ngx_feature_incs="#include <semaphore.h>"
ngx_feature_path=
ngx_feature_libs=
--
2.40.0

View File

@ -3,7 +3,7 @@
# Consider using mime.types from mime-types package
# See comments in mime-types template
pkgname=nginx
version=1.26.1
version=1.26.2
revision=1
_tests_commit=88730862618b
_njs_version=0.8.4
@ -66,7 +66,7 @@ changelog="https://nginx.org/en/CHANGES-${version%.*}"
distfiles="https://nginx.org/download/nginx-${version}.tar.gz
https://hg.nginx.org/nginx-tests/archive/${_tests_commit}.tar.gz
https://hg.nginx.org/njs/archive/${_njs_version}.tar.gz"
checksum="f9187468ff2eb159260bfd53867c25ff8e334726237acf227b9e870e53d3e36b
checksum="627fe086209bba80a2853a0add9d958d7ebbdffa1a8467a5784c9a6b4f03d738
6cc1e4b393c4d05cef06ac16f4a38d504d0e5674fca08c7be20052fd3b07b322
8191bff8491af9169a92e30e383ef8614717b0c6d40913d83b95051031e92321"
# Tests fail when nginx run as root and there is no nginx user