]> git.kaiwu.me - nginx.git/commitdiff
Win32: i386 now assumed when crossbuilding (ticket #2416).
authorMaxim Dounin <mdounin@mdounin.ru>
Thu, 23 Feb 2023 15:15:59 +0000 (18:15 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Thu, 23 Feb 2023 15:15:59 +0000 (18:15 +0300)
Previously, NGX_MACHINE was not set when crossbuilding, resulting in
NGX_ALIGNMENT=16 being used in 32-bit builds (if not explicitly set to a
correct value).  This in turn might result in memory corruption in
ngx_palloc() (as there are no usable aligned allocator on Windows, and
normal malloc() is used instead, which provides 8 byte alignment on
32-bit platforms).

To fix this, now i386 machine is set when crossbuilding, so nginx won't
assume strict alignment requirements.

auto/configure

index 474d69e84515af8b63c715918ca3beef989c0822..5b88ebb4cbe802489f01dada17404edc4fb503c1 100755 (executable)
@@ -44,6 +44,7 @@ if test -z "$NGX_PLATFORM"; then
 else
     echo "building for $NGX_PLATFORM"
     NGX_SYSTEM=$NGX_PLATFORM
+    NGX_MACHINE=i386
 fi
 
 . auto/cc/conf