summaryrefslogtreecommitdiffstats
path: root/patches/nginx-1.24.0
diff options
context:
space:
mode:
Diffstat (limited to 'patches/nginx-1.24.0')
-rw-r--r--patches/nginx-1.24.0/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch85
-rw-r--r--patches/nginx-1.24.0/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch131
-rw-r--r--patches/nginx-1.24.0/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch203
-rw-r--r--patches/nginx-1.24.0/0004-auto-lib-libxslt-conf-use-pkg-config.patch30
-rw-r--r--patches/nginx-1.24.0/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch131
-rw-r--r--patches/nginx-1.24.0/0006-auto-lib-openssl-conf-use-pkg-config.patch247
-rw-r--r--patches/nginx-1.24.0/0007-auto-lib-libgd-conf-use-pkg-config.patch32
-rw-r--r--patches/nginx-1.24.0/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch29
-rw-r--r--patches/nginx-1.24.0/0009-auto-os-linux-fix-build-with-libxcrypt.patch34
-rw-r--r--patches/nginx-1.24.0/0010-Allow-forcing-of-endianness-for-cross-compilation.patch114
-rw-r--r--patches/nginx-1.24.0/0100-auto-unix-allow-overriding-the-IPv6-build-tests.patch55
-rw-r--r--patches/nginx-1.24.0/series16
12 files changed, 1107 insertions, 0 deletions
diff --git a/patches/nginx-1.24.0/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch b/patches/nginx-1.24.0/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch
new file mode 100644
index 000000000..2353f6400
--- /dev/null
+++ b/patches/nginx-1.24.0/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch
@@ -0,0 +1,85 @@
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Tue, 4 Jul 2017 11:09:20 -0400
+Subject: [PATCH] auto/type/sizeof: rework autotest to be cross-compilation
+ friendly
+
+Rework the sizeof test to do the checks at compile time instead of at
+runtime. This way, it does not break when cross-compiling for a
+different CPU architecture.
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+
+Refresh for 1.8.0.
+
+Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
+[martin@barkynet.com: Updated for 1.10.0]
+Signed-off-by: Martin Bark <martin@barkynet.com>
+Signed-off-by: Adam Duskett <aduskett@gmail.com>
+Refresh for 1.12.0
+---
+ auto/types/sizeof | 37 ++++++++++++++++++++++++++++---------
+ 1 file changed, 28 insertions(+), 9 deletions(-)
+
+diff --git a/auto/types/sizeof b/auto/types/sizeof
+index 480d8cfa49aa..61dcd2de5d44 100644
+--- a/auto/types/sizeof
++++ b/auto/types/sizeof
+@@ -14,7 +14,7 @@ END
+
+ ngx_size=
+
+-cat << END > $NGX_AUTOTEST.c
++cat << _EOF > $NGX_AUTOTEST.c
+
+ #include <sys/types.h>
+ #include <sys/time.h>
+@@ -25,22 +25,41 @@ $NGX_INCLUDE_UNISTD_H
+ $NGX_INCLUDE_INTTYPES_H
+ $NGX_INCLUDE_AUTO_CONFIG_H
+
+-int main(void) {
+- printf("%d", (int) sizeof($ngx_type));
++#if !defined( PASTE)
++#define PASTE2( x, y) x##y
++#define PASTE( x, y) PASTE2( x, y)
++#endif /* PASTE */
++
++#define SAY_IF_SIZEOF( typename, type, size) \\
++ static char PASTE( PASTE( PASTE( sizeof_, typename), _is_), size) \\
++ [(sizeof(type) == (size)) ? 1 : -1]
++
++SAY_IF_SIZEOF(TEST_TYPENAME, TEST_TYPE, TEST_SIZE);
++
++int main(void)
++{
+ return 0;
+ }
+
+-END
++_EOF
+
+
+-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
++_ngx_typename=`echo "$ngx_type" | sed 's/ /_/g;s/\*/p/'`
++ngx_size="-1"
++ngx_size=`for i in 1 2 4 8 16 ; do \
++ $CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
++ -DTEST_TYPENAME="$_ngx_typename" -DTEST_TYPE="$ngx_type" -DTEST_SIZE="$i" \
++ $NGX_AUTOTEST.c -o $NGX_AUTOTEST \
++ $NGX_LD_OPT $ngx_feature_libs >/dev/null 2>&1 || continue ;\
++ echo $i ; break ; done`
+
+-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
++rm -rf $NGX_AUTOTEST*
+
++if test -z $ngx_size ; then
++ ngx_size=-1
++fi
+
+-if [ -x $NGX_AUTOTEST ]; then
+- ngx_size=`$NGX_AUTOTEST`
++if [ $ngx_size -gt 0 ]; then
+ echo " $ngx_size bytes"
+ fi
+
diff --git a/patches/nginx-1.24.0/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch b/patches/nginx-1.24.0/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch
new file mode 100644
index 000000000..4742694ce
--- /dev/null
+++ b/patches/nginx-1.24.0/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch
@@ -0,0 +1,131 @@
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Sun, 4 May 2014 00:40:49 +0200
+Subject: [PATCH] auto/feature: add mechanism allowing to force feature run
+ test result
+
+Whenever a feature needs to run a test, the ngx_feature_run_force_result
+variable can be set to the desired test result, and thus skip the test.
+
+Therefore, the generated config.h file will honor these presets.
+
+This mechanism aims to make easier cross-compilation support.
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+---
+ auto/feature | 80 ++++++++++++++++++++++++++++++++++++++++++++----------------
+ 1 file changed, 59 insertions(+), 21 deletions(-)
+
+diff --git a/auto/feature b/auto/feature
+index 3561f5941f24..8016d802e7a8 100644
+--- a/auto/feature
++++ b/auto/feature
+@@ -52,50 +52,88 @@ if [ -x $NGX_AUTOTEST ]; then
+ case "$ngx_feature_run" in
+
+ yes)
+- # /bin/sh is used to intercept "Killed" or "Abort trap" messages
+- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
+- echo " found"
++ if test -n "$ngx_feature_run_force_result" ; then
++ echo " not tested (maybe cross-compiling)"
++ if test -n "$ngx_feature_name" ; then
++ if test "$ngx_feature_run_force_result" = "yes" ; then
++ have=$ngx_have_feature . auto/have
++ fi
++ fi
+ ngx_found=yes
++ else
+
+- if test -n "$ngx_feature_name"; then
+- have=$ngx_have_feature . auto/have
++ # /bin/sh is used to intercept "Killed" or "Abort trap" messages
++ if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
++ echo " found"
++ ngx_found=yes
++
++ if test -n "$ngx_feature_name"; then
++ have=$ngx_have_feature . auto/have
++ fi
++
++ else
++ echo " found but is not working"
+ fi
+
+- else
+- echo " found but is not working"
+ fi
+ ;;
+
+ value)
+- # /bin/sh is used to intercept "Killed" or "Abort trap" messages
+- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
+- echo " found"
++ if test -n "$ngx_feature_run_force_result" ; then
++ echo " not tested (maybe cross-compiling)"
++ cat << END >> $NGX_AUTO_CONFIG_H
++
++#ifndef $ngx_feature_name
++#define $ngx_feature_name $ngx_feature_run_force_result
++#endif
++
++END
+ ngx_found=yes
++ else
+
+- cat << END >> $NGX_AUTO_CONFIG_H
++ # /bin/sh is used to intercept "Killed" or "Abort trap" messages
++ if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
++ echo " found"
++ ngx_found=yes
++
++ cat << END >> $NGX_AUTO_CONFIG_H
+
+ #ifndef $ngx_feature_name
+ #define $ngx_feature_name `$NGX_AUTOTEST`
+ #endif
+
+ END
+- else
+- echo " found but is not working"
++ else
++ echo " found but is not working"
++ fi
++
+ fi
+ ;;
+
+ bug)
+- # /bin/sh is used to intercept "Killed" or "Abort trap" messages
+- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
+- echo " not found"
+-
+- else
+- echo " found"
++ if test -n "$ngx_feature_run_force_result" ; then
++ echo " not tested (maybe cross-compiling)"
++ if test -n "$ngx_feature_name"; then
++ if test "$ngx_feature_run_force_result" = "yes" ; then
++ have=$ngx_have_feature . auto/have
++ fi
++ fi
+ ngx_found=yes
++ else
+
+- if test -n "$ngx_feature_name"; then
+- have=$ngx_have_feature . auto/have
++ # /bin/sh is used to intercept "Killed" or "Abort trap" messages
++ if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
++ echo " not found"
++
++ else
++ echo " found"
++ ngx_found=yes
++
++ if test -n "$ngx_feature_name"; then
++ have=$ngx_have_feature . auto/have
++ fi
+ fi
++
+ fi
+ ;;
+
diff --git a/patches/nginx-1.24.0/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch b/patches/nginx-1.24.0/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch
new file mode 100644
index 000000000..187dccaa4
--- /dev/null
+++ b/patches/nginx-1.24.0/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch
@@ -0,0 +1,203 @@
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Thu, 29 May 2014 18:52:10 +0200
+Subject: [PATCH] auto/*: set ngx_feature_run_force_result for each feature
+ requiring run test
+
+Each feature requiring a run test has a matching preset variable (called
+ngx_force_*) used to set ngx_feature_run_force_result.
+
+These ngx_force_* variables are passed through the environment at configure
+time.
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+
+Refresh for 1.8.0.
+
+Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
+[rebased against v1.20.1]
+Signed-off-by: Adam Duskett <Aduskett@gmail.com>
+---
+ auto/cc/conf | 3 +++
+ auto/cc/name | 1 +
+ auto/lib/libatomic/conf | 1 +
+ auto/os/darwin | 3 +++
+ auto/os/linux | 4 ++++
+ auto/unix | 7 +++++++
+ 6 files changed, 19 insertions(+)
+
+diff --git a/auto/cc/conf b/auto/cc/conf
+index ba31cb88c9c6..2995131ca904 100644
+--- a/auto/cc/conf
++++ b/auto/cc/conf
+@@ -184,6 +184,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
+ ngx_feature="gcc builtin atomic operations"
+ ngx_feature_name=NGX_HAVE_GCC_ATOMIC
+ ngx_feature_run=yes
++ ngx_feature_run_force_result="$ngx_force_gcc_have_atomic"
+ ngx_feature_incs=
+ ngx_feature_path=
+ ngx_feature_libs=
+@@ -205,6 +206,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
+ ngx_feature="C99 variadic macros"
+ ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS"
+ ngx_feature_run=yes
++ ngx_feature_run_force_result="$ngx_force_c99_have_variadic_macros"
+ ngx_feature_incs="#include <stdio.h>
+ #define var(dummy, ...) sprintf(__VA_ARGS__)"
+ ngx_feature_path=
+@@ -219,6 +221,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_force_result="$ngx_force_gcc_have_variadic_macros"
+ 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 ded93f5bc989..7c3cb74a2bd1 100644
+--- a/auto/cc/name
++++ b/auto/cc/name
+@@ -8,6 +8,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
+ ngx_feature="C compiler"
+ ngx_feature_name=
+ ngx_feature_run=yes
++ ngx_feature_run_force_result="$ngx_force_c_compiler"
+ ngx_feature_incs=
+ ngx_feature_path=
+ ngx_feature_libs=
+diff --git a/auto/lib/libatomic/conf b/auto/lib/libatomic/conf
+index d1e484ab32ee..37249161ea2f 100644
+--- a/auto/lib/libatomic/conf
++++ b/auto/lib/libatomic/conf
+@@ -15,6 +15,7 @@ else
+ ngx_feature="atomic_ops library"
+ ngx_feature_name=NGX_HAVE_LIBATOMIC
+ ngx_feature_run=yes
++ ngx_feature_run_force_result="$ngx_force_have_libatomic"
+ ngx_feature_incs="#define AO_REQUIRE_CAS
+ #include <atomic_ops.h>"
+ ngx_feature_path=
+diff --git a/auto/os/darwin b/auto/os/darwin
+index 429468f7fd40..1ed47cca5c89 100644
+--- a/auto/os/darwin
++++ b/auto/os/darwin
+@@ -33,6 +33,7 @@ NGX_KQUEUE_CHECKED=YES
+ ngx_feature="kqueue's EVFILT_TIMER"
+ ngx_feature_name="NGX_HAVE_TIMER_EVENT"
+ ngx_feature_run=yes
++ngx_feature_run_force_result="$ngx_force_have_timer_event"
+ ngx_feature_incs="#include <sys/event.h>
+ #include <sys/time.h>"
+ ngx_feature_path=
+@@ -63,6 +64,7 @@ ngx_feature_test="int kq;
+ ngx_feature="Darwin 64-bit kqueue millisecond timeout bug"
+ ngx_feature_name=NGX_DARWIN_KEVENT_BUG
+ ngx_feature_run=bug
++ngx_feature_run_force_result="$ngx_force_kevent_bug"
+ ngx_feature_incs="#include <sys/event.h>
+ #include <sys/time.h>"
+ ngx_feature_path=
+@@ -92,6 +94,7 @@ ngx_feature_test="int kq;
+ ngx_feature="sendfile()"
+ ngx_feature_name="NGX_HAVE_SENDFILE"
+ ngx_feature_run=yes
++ngx_feature_run_force_result="$ngx_force_have_sendfile"
+ ngx_feature_incs="#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/uio.h>
+diff --git a/auto/os/linux b/auto/os/linux
+index eb6702679a4b..1d7a0af7ae19 100644
+--- a/auto/os/linux
++++ b/auto/os/linux
+@@ -37,6 +37,7 @@ fi
+ ngx_feature="epoll"
+ ngx_feature_name="NGX_HAVE_EPOLL"
+ ngx_feature_run=yes
++ngx_feature_run_force_result="$ngx_force_have_epoll"
+ ngx_feature_incs="#include <sys/epoll.h>"
+ ngx_feature_path=
+ ngx_feature_libs=
+@@ -136,6 +137,7 @@ 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_force_result="$ngx_force_have_sendfile"
+ ngx_feature_incs="#include <sys/sendfile.h>
+ #include <errno.h>"
+ ngx_feature_path=
+@@ -157,6 +159,7 @@ 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_force_result="$ngx_force_have_sendfile64"
+ ngx_feature_incs="#include <sys/sendfile.h>
+ #include <errno.h>"
+ ngx_feature_path=
+@@ -175,6 +178,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_force_result="$ngx_force_have_pr_set_dumpable"
+ ngx_feature_incs="#include <sys/prctl.h>"
+ ngx_feature_path=
+ ngx_feature_libs=
+diff --git a/auto/unix b/auto/unix
+index 867101982440..679e21213879 100644
+--- a/auto/unix
++++ b/auto/unix
+@@ -100,6 +100,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_force_result="$ngx_force_have_timer_event"
+ ngx_feature_incs="#include <sys/event.h>
+ #include <sys/time.h>"
+ ngx_feature_path=
+@@ -722,6 +723,7 @@ if [ $ngx_found = no ]; then
+ ngx_feature="sys_nerr"
+ ngx_feature_name="NGX_SYS_NERR"
+ ngx_feature_run=value
++ ngx_feature_run_force_result="$ngx_force_sys_nerr"
+ ngx_feature_incs='#include <errno.h>
+ #include <stdio.h>'
+ ngx_feature_path=
+@@ -737,6 +739,7 @@ if [ $ngx_found = no ]; then
+ ngx_feature="_sys_nerr"
+ ngx_feature_name="NGX_SYS_NERR"
+ ngx_feature_run=value
++ ngx_feature_run_force_result="$ngx_force_sys_nerr"
+ ngx_feature_incs='#include <errno.h>
+ #include <stdio.h>'
+ ngx_feature_path=
+@@ -806,6 +809,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_force_result="$ngx_force_have_map_anon"
+ ngx_feature_incs="#include <sys/mman.h>"
+ ngx_feature_path=
+ ngx_feature_libs=
+@@ -819,6 +823,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_force_result="$ngx_force_have_map_devzero"
+ ngx_feature_incs="#include <sys/mman.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>"
+@@ -834,6 +839,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_force_result="$ngx_force_have_sysvshm"
+ ngx_feature_incs="#include <sys/ipc.h>
+ #include <sys/shm.h>"
+ ngx_feature_path=
+@@ -848,6 +854,7 @@ ngx_feature_test="int id;
+ ngx_feature="POSIX semaphores"
+ ngx_feature_name="NGX_HAVE_POSIX_SEM"
+ ngx_feature_run=yes
++ngx_feature_run_force_result="$ngx_force_have_posix_sem"
+ ngx_feature_incs="#include <semaphore.h>"
+ ngx_feature_path=
+ ngx_feature_libs=
diff --git a/patches/nginx-1.24.0/0004-auto-lib-libxslt-conf-use-pkg-config.patch b/patches/nginx-1.24.0/0004-auto-lib-libxslt-conf-use-pkg-config.patch
new file mode 100644
index 000000000..b881dc028
--- /dev/null
+++ b/patches/nginx-1.24.0/0004-auto-lib-libxslt-conf-use-pkg-config.patch
@@ -0,0 +1,30 @@
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Thu, 29 May 2014 19:22:27 +0200
+Subject: [PATCH] auto/lib/libxslt/conf: use pkg-config
+
+Change to using pkg-config to find the path to libxslt and its
+dependencies.
+
+Signed-off-by: Martin Bark <martin@barkynet.com>
+[Peter: updated for 1.15.6]
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+---
+ auto/lib/libxslt/conf | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/auto/lib/libxslt/conf b/auto/lib/libxslt/conf
+index 3063ac7ce0c0..3209e3642fdc 100644
+--- a/auto/lib/libxslt/conf
++++ b/auto/lib/libxslt/conf
+@@ -12,8 +12,9 @@
+ #include <libxslt/xsltInternals.h>
+ #include <libxslt/transform.h>
+ #include <libxslt/xsltutils.h>"
+- ngx_feature_path="/usr/include/libxml2"
+- ngx_feature_libs="-lxml2 -lxslt"
++ ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I libxslt|
++ sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')"
++ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs libxslt)"
+ ngx_feature_test="xmlParserCtxtPtr ctxt = NULL;
+ xsltStylesheetPtr sheet = NULL;
+ xmlDocPtr doc = NULL;
diff --git a/patches/nginx-1.24.0/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch b/patches/nginx-1.24.0/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch
new file mode 100644
index 000000000..b2949a069
--- /dev/null
+++ b/patches/nginx-1.24.0/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch
@@ -0,0 +1,131 @@
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Sun, 1 Jun 2014 16:05:04 +0200
+Subject: [PATCH] auto/unix: make sys_nerr guessing cross-friendly
+
+This patch replaces the default sys_nerr runtest with a test done at
+buildtime.
+
+The idea behind this buildtime test is finding the value of the ERR_MAX
+macro if defined, or the EHWPOISON (which is currently the last errno)
+otherwise.
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+
+Refresh for 1.8.0.
+
+Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
+[rebased against v1.20.1]
+Signed-off-by: Adam Duskett <Aduskett@gmail.com>
+---
+ auto/os/sys_nerr | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ auto/unix | 8 ++++++
+ 2 files changed, 86 insertions(+)
+ create mode 100644 auto/os/sys_nerr
+
+diff --git a/auto/os/sys_nerr b/auto/os/sys_nerr
+new file mode 100644
+index 000000000000..8970f5f6ec73
+--- /dev/null
++++ b/auto/os/sys_nerr
+@@ -0,0 +1,78 @@
++
++# Copyright (C) Samuel Martin <s.martin49@gmail.com>
++
++
++echo $ngx_n "checking for sys_nerr value...$ngx_c"
++
++# sys_nerr guessing is done using a (very) poor (but working)
++# heuristics, by checking for the value of ERR_MAX if defined, or
++# EHWPOISON otherwise.
++
++cat << END >> $NGX_AUTOCONF_ERR
++
++----------------------------------------
++checking for sys_nerr value
++
++END
++
++ngx_sys_nerr=
++
++cat << _EOF > $NGX_AUTOTEST.c
++
++#include <stdio.h>
++#include <errno.h>
++
++static char sys_nerr_test[ERR_MAX];
++int main(void)
++{
++ return 0;
++}
++
++_EOF
++
++if $CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
++ $NGX_AUTOTEST.c -o $NGX_AUTOTEST \
++ $NGX_LD_OPT $ngx_feature_libs >/dev/null 2>&1 ; then
++ _ngx_max_err_macro=ERR_MAX
++else
++ # the +2 has been empirically found!
++ _ngx_max_err_macro="EHWPOISON + 2"
++fi
++
++cat << _EOF > $NGX_AUTOTEST.c
++
++#include <stdio.h>
++#include <errno.h>
++
++static char sys_nerr_test[(TEST_ERR_MAX == $_ngx_max_err_macro) ? 1 : -1];
++int main(void)
++{
++ return 0;
++}
++
++_EOF
++
++
++ngx_sys_nerr=`for i in $(seq 0 2000) ; do \
++ $CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
++ -DTEST_ERR_MAX="$i" \
++ $NGX_AUTOTEST.c -o $NGX_AUTOTEST \
++ $NGX_LD_OPT $ngx_feature_libs >/dev/null 2>&1 || continue ;\
++ echo $i ; break ; done`
++
++rm -rf $NGX_AUTOTEST*
++
++if test -z $ngx_sys_nerr ; then
++ ngx_size=0
++ ngx_sys_nerr=0
++fi
++
++cat << END >> $NGX_AUTO_CONFIG_H
++
++#ifndef $ngx_feature_name
++#define $ngx_feature_name $ngx_sys_nerr
++#endif
++
++END
++
++echo " $ngx_sys_nerr"
+diff --git a/auto/unix b/auto/unix
+index 679e21213879..12059a2301f2 100644
+--- a/auto/unix
++++ b/auto/unix
+@@ -744,10 +744,18 @@ if [ $ngx_found = no ]; then
+ #include <stdio.h>'
+ ngx_feature_path=
+ ngx_feature_libs=
++ if false ; then
++ # Disabled because only valid for native build.
+ ngx_feature_test='printf("%d", _sys_nerr);'
+ . auto/feature
+ fi
+
++else
++ # Cross-compilation support
++ . auto/os/sys_nerr
++
++fi
++
+
+ ngx_feature="localtime_r()"
+ ngx_feature_name="NGX_HAVE_LOCALTIME_R"
diff --git a/patches/nginx-1.24.0/0006-auto-lib-openssl-conf-use-pkg-config.patch b/patches/nginx-1.24.0/0006-auto-lib-openssl-conf-use-pkg-config.patch
new file mode 100644
index 000000000..e06ffd6fe
--- /dev/null
+++ b/patches/nginx-1.24.0/0006-auto-lib-openssl-conf-use-pkg-config.patch
@@ -0,0 +1,247 @@
+From: Martin Bark <martin@barkynet.com>
+Date: Fri, 6 May 2016 14:48:31 +0100
+Subject: [PATCH] auto/lib/openssl/conf: use pkg-config
+
+Change to using pkg-config to find the path to openssl and its
+dependencies.
+
+Signed-off-by: Martin Bark <martin@barkynet.com>
+---
+ auto/lib/openssl/conf | 187 +++++++++++++++++++++++++-------------------------
+ 1 file changed, 94 insertions(+), 93 deletions(-)
+
+diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf
+index 4fb52df7fe17..9f30490d745d 100644
+--- a/auto/lib/openssl/conf
++++ b/auto/lib/openssl/conf
+@@ -1,4 +1,3 @@
+-
+ # Copyright (C) Igor Sysoev
+ # Copyright (C) Nginx, Inc.
+
+@@ -7,123 +6,125 @@ if [ $OPENSSL != NONE ]; then
+
+ case "$CC" in
+
+- cl | bcc32)
+- have=NGX_OPENSSL . auto/have
+- have=NGX_SSL . auto/have
+-
+- CFLAGS="$CFLAGS -DNO_SYS_TYPES_H"
+-
+- CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
+- CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h"
+-
+- if [ -f $OPENSSL/ms/do_ms.bat ]; then
+- # before OpenSSL 1.1.0
+- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/ssleay32.lib"
+- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libeay32.lib"
+- else
+- # OpenSSL 1.1.0+
+- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.lib"
+- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.lib"
+- fi
+-
+- # libeay32.lib requires gdi32.lib
+- CORE_LIBS="$CORE_LIBS gdi32.lib"
+- # OpenSSL 1.0.0 requires crypt32.lib
+- CORE_LIBS="$CORE_LIBS crypt32.lib"
+- ;;
+-
+- *)
+- have=NGX_OPENSSL . auto/have
+- have=NGX_SSL . auto/have
+-
+- CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
+- CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
+- CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
+- CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
+- CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
+- CORE_LIBS="$CORE_LIBS $NGX_LIBPTHREAD"
+-
+- if [ "$NGX_PLATFORM" = win32 ]; then
+- CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
+- fi
+- ;;
++ cl | bcc32)
++ have=NGX_OPENSSL . auto/have
++ have=NGX_SSL . auto/have
++
++ CFLAGS="$CFLAGS -DNO_SYS_TYPES_H"
++
++ CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
++ CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h"
++
++ if [ -f $OPENSSL/ms/do_ms.bat ]; then
++ # before OpenSSL 1.1.0
++ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/ssleay32.lib"
++ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libeay32.lib"
++ else
++ # OpenSSL 1.1.0+
++ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.lib"
++ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.lib"
++ fi
++
++ # libeay32.lib requires gdi32.lib
++ CORE_LIBS="$CORE_LIBS gdi32.lib"
++ # OpenSSL 1.0.0 requires crypt32.lib
++ CORE_LIBS="$CORE_LIBS crypt32.lib"
++ ;;
++
++ *)
++ have=NGX_OPENSSL . auto/have
++ have=NGX_SSL . auto/have
++
++ CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
++ CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
++ CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
++ CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
++ CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
++ CORE_LIBS="$CORE_LIBS $NGX_LIBPTHREAD"
++
++ if [ "$NGX_PLATFORM" = win32 ]; then
++ CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
++ fi
++ ;;
+ esac
+
+ else
+
+ if [ "$NGX_PLATFORM" != win32 ]; then
+
+- OPENSSL=NO
++ OPENSSL=NO
+
+- ngx_feature="OpenSSL library"
+- ngx_feature_name="NGX_OPENSSL"
+- ngx_feature_run=no
+- ngx_feature_incs="#include <openssl/ssl.h>"
+- ngx_feature_path=
+- ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL $NGX_LIBPTHREAD"
+- ngx_feature_test="SSL_CTX_set_options(NULL, 0)"
+- . auto/feature
++ ngx_feature="OpenSSL library"
++ ngx_feature_name="NGX_OPENSSL"
++ ngx_feature_run=no
++ ngx_feature_incs="#include <openssl/ssl.h>"
++ ngx_feature_path=
++ ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I openssl|
++ sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')"
++ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs openssl)"
++ ngx_feature_test="SSL_CTX_set_options(NULL, 0)"
++ . auto/feature
+
+- if [ $ngx_found = no ]; then
++ if [ $ngx_found = no ]; then
+
+- # FreeBSD port
++ # FreeBSD port
+
+- ngx_feature="OpenSSL library in /usr/local/"
+- ngx_feature_path="/usr/local/include"
++ ngx_feature="OpenSSL library in /usr/local/"
++ ngx_feature_path="/usr/local/include"
+
+- if [ $NGX_RPATH = YES ]; then
+- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto"
+- else
+- ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto"
+- fi
++ if [ $NGX_RPATH = YES ]; then
++ ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto"
++ else
++ ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto"
++ fi
+
+- ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
++ ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
+
+- . auto/feature
+- fi
++ . auto/feature
++ fi
+
+- if [ $ngx_found = no ]; then
++ if [ $ngx_found = no ]; then
+
+- # NetBSD port
++ # NetBSD port
+
+- ngx_feature="OpenSSL library in /usr/pkg/"
+- ngx_feature_path="/usr/pkg/include"
++ ngx_feature="OpenSSL library in /usr/pkg/"
++ ngx_feature_path="/usr/pkg/include"
+
+- if [ $NGX_RPATH = YES ]; then
+- ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto"
+- else
+- ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto"
+- fi
++ if [ $NGX_RPATH = YES ]; then
++ ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto"
++ else
++ ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto"
++ fi
+
+- ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
++ ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
+
+- . auto/feature
+- fi
++ . auto/feature
++ fi
+
+- if [ $ngx_found = no ]; then
++ if [ $ngx_found = no ]; then
+
+- # MacPorts
++ # MacPorts
+
+- ngx_feature="OpenSSL library in /opt/local/"
+- ngx_feature_path="/opt/local/include"
++ ngx_feature="OpenSSL library in /opt/local/"
++ ngx_feature_path="/opt/local/include"
+
+- if [ $NGX_RPATH = YES ]; then
+- ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto"
+- else
+- ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto"
+- fi
++ if [ $NGX_RPATH = YES ]; then
++ ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto"
++ else
++ ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto"
++ fi
+
+- ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
++ ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
+
+- . auto/feature
+- fi
++ . auto/feature
++ fi
+
+- if [ $ngx_found = yes ]; then
+- have=NGX_SSL . auto/have
+- CORE_INCS="$CORE_INCS $ngx_feature_path"
+- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+- OPENSSL=YES
+- fi
++ if [ $ngx_found = yes ]; then
++ have=NGX_SSL . auto/have
++ CORE_INCS="$CORE_INCS $ngx_feature_path"
++ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
++ OPENSSL=YES
++ fi
+ fi
+
+ if [ $OPENSSL != YES ]; then
+@@ -136,7 +137,7 @@ into the system, or build the OpenSSL library statically from the source
+ with nginx by using --with-openssl=<path> option.
+
+ END
+- exit 1
++ exit 1
+ fi
+
+ fi
diff --git a/patches/nginx-1.24.0/0007-auto-lib-libgd-conf-use-pkg-config.patch b/patches/nginx-1.24.0/0007-auto-lib-libgd-conf-use-pkg-config.patch
new file mode 100644
index 000000000..bc496436a
--- /dev/null
+++ b/patches/nginx-1.24.0/0007-auto-lib-libgd-conf-use-pkg-config.patch
@@ -0,0 +1,32 @@
+From: Martin Bark <martin@barkynet.com>
+Date: Fri, 6 May 2016 14:48:49 +0100
+Subject: [PATCH] auto/lib/libgd/conf: use pkg-config
+
+Change to using pkg-config to find the path to libgd and its
+dependencies.
+
+Signed-off-by: Martin Bark <martin@barkynet.com>
+[Peter: updated for 1.15.6]
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+[Fabrice: use pkg-config instead of gdlib-config]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ auto/lib/libgd/conf | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/auto/lib/libgd/conf b/auto/lib/libgd/conf
+index 678639767a63..031bcfec86ad 100644
+--- a/auto/lib/libgd/conf
++++ b/auto/lib/libgd/conf
+@@ -7,8 +7,9 @@
+ ngx_feature_name=
+ ngx_feature_run=no
+ ngx_feature_incs="#include <gd.h>"
+- ngx_feature_path=
+- ngx_feature_libs="-lgd"
++ ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I gdlib|
++ sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')"
++ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs gdlib)"
+ ngx_feature_test="gdImagePtr img = gdImageCreateFromGifPtr(1, NULL);
+ (void) img"
+ . auto/feature
diff --git a/patches/nginx-1.24.0/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch b/patches/nginx-1.24.0/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch
new file mode 100644
index 000000000..a1eb9e5cc
--- /dev/null
+++ b/patches/nginx-1.24.0/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch
@@ -0,0 +1,29 @@
+From: Martin Bark <martin@barkynet.com>
+Date: Fri, 6 May 2016 16:29:17 +0100
+Subject: [PATCH] src/os/unix/ngx_linux_config.h: only include dlfcn.h if
+ available
+
+Signed-off-by: Martin Bark <martin@barkynet.com>
+---
+ src/os/unix/ngx_linux_config.h | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/os/unix/ngx_linux_config.h b/src/os/unix/ngx_linux_config.h
+index 88fef47cefeb..ceb2f6175bf5 100644
+--- a/src/os/unix/ngx_linux_config.h
++++ b/src/os/unix/ngx_linux_config.h
+@@ -55,10 +55,12 @@
+ #include <crypt.h>
+ #include <sys/utsname.h> /* uname() */
+
+-#include <dlfcn.h>
++#include <ngx_auto_config.h>
+
+
+-#include <ngx_auto_config.h>
++#if (NGX_HAVE_DLOPEN)
++#include <dlfcn.h>
++#endif
+
+
+ #if (NGX_HAVE_POSIX_SEM)
diff --git a/patches/nginx-1.24.0/0009-auto-os-linux-fix-build-with-libxcrypt.patch b/patches/nginx-1.24.0/0009-auto-os-linux-fix-build-with-libxcrypt.patch
new file mode 100644
index 000000000..a65123aeb
--- /dev/null
+++ b/patches/nginx-1.24.0/0009-auto-os-linux-fix-build-with-libxcrypt.patch
@@ -0,0 +1,34 @@
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 2 Apr 2021 09:18:26 +0200
+Subject: [PATCH] auto/os/linux: fix build with libxcrypt
+
+If crypt_r is found in libcrypt, add -lcrypt to CORE_LIBS to avoid the
+following build failure with libxcrypt:
+
+objs/ngx_modules.o \
+-lpcre -L/home/giuliobenetti/autobuild/run/instance-3/output-1/host/bin/../xtensa-buildroot-linux-uclibc/sysroot/usr/lib -lssl -lcrypto -L/home/giuliobenetti/autobuild/run/instance-3/output-1/host/bin/../xtensa-buildroot-linux-uclibc/sysroot/usr/lib -lxslt -lxml2 -lGeoIP \
+-Wl,-E
+/home/giuliobenetti/autobuild/run/instance-3/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/9.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: objs/src/os/unix/ngx_user.o:/home/giuliobenetti/autobuild/run/instance-3/output-1/build/nginx-1.18.0/src/os/unix/ngx_user.c:18: undefined reference to `crypt_r'
+
+Fixes:
+ - http://autobuild.buildroot.org/results/79a51b0d348e756517b5c9ce815a67f5c657e7e6
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ auto/os/linux | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/auto/os/linux b/auto/os/linux
+index 1d7a0af7ae19..d8afcb78ca37 100644
+--- a/auto/os/linux
++++ b/auto/os/linux
+@@ -232,6 +232,9 @@ ngx_feature_test="struct crypt_data cd;
+ crypt_r(\"key\", \"salt\", &cd);"
+ . auto/feature
+
++if [ $ngx_found = yes ]; then
++ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
++fi
+
+ ngx_include="sys/vfs.h"; . auto/include
+
diff --git a/patches/nginx-1.24.0/0010-Allow-forcing-of-endianness-for-cross-compilation.patch b/patches/nginx-1.24.0/0010-Allow-forcing-of-endianness-for-cross-compilation.patch
new file mode 100644
index 000000000..da9f27cc6
--- /dev/null
+++ b/patches/nginx-1.24.0/0010-Allow-forcing-of-endianness-for-cross-compilation.patch
@@ -0,0 +1,114 @@
+From: Nevo Hed <nhed+buildroot@starry.com>
+Date: Mon, 30 Aug 2021 13:28:13 -0400
+Subject: [PATCH] Allow forcing of endianness for cross-compilation
+
+Upstream-status: Invalid (upstream doesn't support cross-compilation)
+See https://trac.nginx.org/nginx/ticket/2240
+
+Signed-off-by: Nevo Hed <nhed+buildroot@starry.com>
+---
+ auto/endianness | 61 +++++++++++++++++++++++++++++++++++++--------------------
+ auto/options | 6 ++++++
+ 2 files changed, 46 insertions(+), 21 deletions(-)
+
+diff --git a/auto/endianness b/auto/endianness
+index 1b552b6b37b8..4b2a3cd75bcc 100644
+--- a/auto/endianness
++++ b/auto/endianness
+@@ -26,25 +26,44 @@ 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"
+-
+-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
+-
+-if [ -x $NGX_AUTOTEST ]; then
+- if $NGX_AUTOTEST >/dev/null 2>&1; then
+- echo " little endian"
++case "${NGX_FORCE_ENDIANNESS}" in
++ little)
++ echo " little endian (forced)"
+ have=NGX_HAVE_LITTLE_ENDIAN . auto/have
+- else
+- echo " big endian"
+- fi
+-
+- rm -rf $NGX_AUTOTEST*
+-
+-else
+- rm -rf $NGX_AUTOTEST*
+-
+- echo
+- echo "$0: error: cannot detect system byte ordering"
+- exit 1
+-fi
++ ;;
++
++ big)
++ echo " big endian (forced)"
++ ;;
++
++ "")
++ 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
++ 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*
++
++ else
++ rm -rf $NGX_AUTOTEST*
++
++ echo
++ echo "$0: error: cannot detect system byte ordering"
++ exit 1
++ fi
++ ;;
++
++ *)
++ echo
++ echo "$0: error: invalid \"--force-endianness=${NGX_FORCE_ENDIANNESS}\""
++ exit 1
++ ;;
++esac
+diff --git a/auto/options b/auto/options
+index 48f3a1a4251b..7f4163d3449a 100644
+--- a/auto/options
++++ b/auto/options
+@@ -17,6 +17,8 @@ NGX_USER=
+ NGX_GROUP=
+ NGX_BUILD=
+
++NGX_FORCE_ENDIANNESS=
++
+ CC=${CC:-cc}
+ CPP=
+ NGX_OBJS=objs
+@@ -197,6 +199,8 @@ do
+ --user=*) NGX_USER="$value" ;;
+ --group=*) NGX_GROUP="$value" ;;
+
++ --force-endianness=*) NGX_FORCE_ENDIANNESS="$value" ;;
++
+ --crossbuild=*) NGX_PLATFORM="$value" ;;
+
+ --build=*) NGX_BUILD="$value" ;;
+@@ -434,6 +438,8 @@ cat << END
+ --build=NAME set build name
+ --builddir=DIR set build directory
+
++ --force-endianness=<big>|<little> force endianness
++
+ --with-select_module enable select module
+ --without-select_module disable select module
+ --with-poll_module enable poll module
diff --git a/patches/nginx-1.24.0/0100-auto-unix-allow-overriding-the-IPv6-build-tests.patch b/patches/nginx-1.24.0/0100-auto-unix-allow-overriding-the-IPv6-build-tests.patch
new file mode 100644
index 000000000..81e04691b
--- /dev/null
+++ b/patches/nginx-1.24.0/0100-auto-unix-allow-overriding-the-IPv6-build-tests.patch
@@ -0,0 +1,55 @@
+From: Clemens Gruber <clemens.gruber@pqgruber.com>
+Date: Thu, 3 Aug 2017 15:47:08 +0200
+Subject: [PATCH] auto/unix: allow overriding the IPv6 build tests
+
+Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
+---
+ auto/feature | 7 ++++++-
+ auto/unix | 6 ++++--
+ 2 files changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/auto/feature b/auto/feature
+index 8016d802e7a8..a9c6b6ee5eeb 100644
+--- a/auto/feature
++++ b/auto/feature
+@@ -81,10 +81,15 @@ if [ -x $NGX_AUTOTEST ]; then
+ value)
+ if test -n "$ngx_feature_run_force_result" ; then
+ echo " not tested (maybe cross-compiling)"
++ if test "$ngx_feature_run_force_result" = "yes" ; then
++ ngx_feature_run_force_result_int=1
++ else
++ ngx_feature_run_force_result_int=0
++ fi
+ cat << END >> $NGX_AUTO_CONFIG_H
+
+ #ifndef $ngx_feature_name
+-#define $ngx_feature_name $ngx_feature_run_force_result
++#define $ngx_feature_name $ngx_feature_run_force_result_int
+ #endif
+
+ END
+diff --git a/auto/unix b/auto/unix
+index 12059a2301f2..f467fef04868 100644
+--- a/auto/unix
++++ b/auto/unix
+@@ -440,7 +440,8 @@ ngx_feature_test="struct in_pktinfo pkt;
+
+ ngx_feature="IPV6_RECVPKTINFO"
+ ngx_feature_name="NGX_HAVE_IPV6_RECVPKTINFO"
+-ngx_feature_run=no
++ngx_feature_run_force_result="$ngx_force_ipv6"
++ngx_feature_run=value
+ ngx_feature_incs="#include <sys/socket.h>
+ #include <netinet/in.h>"
+ ngx_feature_path=
+@@ -645,7 +646,8 @@ ngx_param=NGX_MAX_TIME_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
+
+ ngx_feature="AF_INET6"
+ ngx_feature_name="NGX_HAVE_INET6"
+-ngx_feature_run=no
++ngx_feature_run_force_result="$ngx_force_ipv6"
++ngx_feature_run=value
+ ngx_feature_incs="#include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>"
diff --git a/patches/nginx-1.24.0/series b/patches/nginx-1.24.0/series
new file mode 100644
index 000000000..1eeb9c431
--- /dev/null
+++ b/patches/nginx-1.24.0/series
@@ -0,0 +1,16 @@
+# generated by git-ptx-patches
+#tag:base --start-number 0
+#tag:buildroot --start-number 1
+0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch
+0002-auto-feature-add-mechanism-allowing-to-force-feature.patch
+0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch
+0004-auto-lib-libxslt-conf-use-pkg-config.patch
+0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch
+0006-auto-lib-openssl-conf-use-pkg-config.patch
+0007-auto-lib-libgd-conf-use-pkg-config.patch
+0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch
+0009-auto-os-linux-fix-build-with-libxcrypt.patch
+0010-Allow-forcing-of-endianness-for-cross-compilation.patch
+#tag:ptxdist --start-number 100
+0100-auto-unix-allow-overriding-the-IPv6-build-tests.patch
+# 8b3a0cda12fc98d0ea43c37b609327f9 - git-ptx-patches magic