Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Jan Mojžíš
d149d15526
d/p/FTBR-fix-detect-correct-NGX_CPU_CACHE_LINE-using-debhelper.patch add 2025-02-02 14:37:23 +01:00
3 changed files with 45 additions and 0 deletions

3
debian/changelog vendored
View file

@ -6,6 +6,9 @@ nginx (1.26.2-1) UNRELEASED; urgency=medium
* d/gbp.conf: add upstream-signatures = on
* d/{control,copyright}: update my email to "janmojzis@debian.org"
* d/copyright: bump my copyright year
* d/p/FTBR-fix-detect-correct-NGX_CPU_CACHE_LINE-using-debhelper.patch add,
set correct NGX_CPU_CACHE_LINE value on i386/armhf architecture and
fix FTBR problem
[ Jérémy Lal ]
* Add Sergey Kandaurov <s.kandaurov@f5.com> pgp public key

View file

@ -0,0 +1,41 @@
From: =?utf-8?b?SmFuIE1vasW+w63FoQ==?= <jan.mojzis@gmail.com>
Date: Tue, 28 Jan 2025 14:38:51 +0100
Subject: FTBR fix - detect correct NGX_CPU_CACHE_LINE using debhelper
---
auto/os/conf | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/auto/os/conf b/auto/os/conf
index bb0ce4e..8109ca1 100644
--- a/auto/os/conf
+++ b/auto/os/conf
@@ -137,6 +137,28 @@ case "$NGX_MACHINE" in
esac
+# Nginx detects machine (NGX_MACHINE) type from runtime `uname -m` command.
+# This causes problem when the native machine is 64bit (e.g. amd64/aarch64)
+# and the build is running on an 32bit system (e.g. in i386/armhf chroot).
+# Then incorrect NGX_MACH_CACHE_LINE value is compiled into the binary
+# and this causes the FTBR problem:
+#./debian/build-bin/src/os/unix/ngx_posix_init.c:56
+#-70781 movs r3,·#64 @·0x40
+#+70781 movs r3,·#32
+# ...
+# As a workaround, the DEB_TARGET_ARCH environment variable is used
+# to detect the correct NGX_MACH_CACHE_LINE value.
+case "$DEB_TARGET_ARCH" in
+
+ i386)
+ NGX_MACH_CACHE_LINE=32
+ ;;
+
+ armhf)
+ NGX_MACH_CACHE_LINE=32
+ ;;
+esac
+
if test -z "$NGX_CPU_CACHE_LINE"; then
NGX_CPU_CACHE_LINE=$NGX_MACH_CACHE_LINE
fi

View file

@ -1,3 +1,4 @@
0003-define_gnu_source-on-other-glibc-based-platforms.patch
nginx-fix-pidfile.patch
nginx-ssl_cert_cb_yield.patch
FTBR-fix-detect-correct-NGX_CPU_CACHE_LINE-using-debhelper.patch