nginx: Fix compilation with LTO
authorAndreas Gnau <andreas.gnau@iopsys.eu>
Wed, 6 Mar 2024 15:48:45 +0000 (16:48 +0100)
committerRosen Penev <rosenp@gmail.com>
Wed, 20 Mar 2024 18:36:08 +0000 (11:36 -0700)
When CONFIG_USE_LTO=y, the int-size detection script will fail because a
variable gets optimised out. Mark it as volatile to fix the issue.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
net/nginx/Makefile
net/nginx/patches/nginx/102-sizeof_test_fix.patch

index 7509d9575cb1d1e6b05c1c95a02252867a64bf39..3d199b962934caa8c5c712d253a057be1f84a82f 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nginx
 PKG_VERSION:=1.25.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://nginx.org/download/
@@ -23,7 +23,7 @@ PKG_CPE_ID:=cpe:/a:nginx:nginx
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
-PKG_BUILD_FLAGS:=gc-sections
+PKG_BUILD_FLAGS:=gc-sections lto
 
 # 3rd-party modules
 PKG_MOD_EXTRA := \
index 7d2430eab9f927063fa18b3fa32dc5618ea774ad..823e7eabb94196073c2594a4dbceb7acbfe2c40b 100644 (file)
@@ -4,7 +4,7 @@
  $NGX_INCLUDE_INTTYPES_H
  $NGX_INCLUDE_AUTO_CONFIG_H
  
-+char object_code_block[] = {
++volatile char object_code_block[] = {
 +      '\n', 'e', '4', 'V', 'A',
 +      '0', 'x', ('0' + sizeof($ngx_type)),
 +      'Y', '3', 'p', 'M', '\n'