From a51859ebb93b2a4e38b63f71b6519aafc651230c Mon Sep 17 00:00:00 2001 From: iamdoubz <> Date: Tue, 3 Nov 2026 10:34:47 -0600 Subject: [PATCH] Fix _FORTIFY_SOURCE redefinition build failure on Ubuntu 24.04 GCC on Ubuntu 24.04 defaults to _FORTIFY_SOURCE=3, which conflicts with the =2 passed via -Wp and fails the build under nginx's -Werror. Undefine it first. --- freenginx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freenginx.sh b/freenginx.sh index 0c0a312..f299ed3 100755 --- a/freenginx.sh +++ b/freenginx.sh @@ -258,7 +258,7 @@ run ./auto/configure \ --with-openssl="../openssl-$V_QSSL" \ --with-openssl-opt="$ssl_opt$ktls_opt" \ "${mods[@]}" \ - --with-cc-opt="-g -O2 -ffile-prefix-map=/data/builder/debuild/nginx-$V_NGINX/debian/debuild-base/nginx-$V_NGINX=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC -I../openssl-$V_QSSL/build/include" \ + --with-cc-opt="-g -O2 -ffile-prefix-map=/data/builder/debuild/nginx-$V_NGINX/debian/debuild-base/nginx-$V_NGINX=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -I../openssl-$V_QSSL/build/include" \ --with-ld-opt="-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie -L../openssl-$V_QSSL/build/lib" step "Compiling with $JOBS jobs (this takes a while)"