Closed azoyan closed 3 weeks ago
A patch in the Ubuntu build of gcc incorrectly checks for a duplicate definition of -D_FORTIFY_SOURCE
.
A minimal fix would be
--- a/nginx-sys/build/vendored.rs
+++ b/nginx-sys/build/vendored.rs
@@ -97,7 +97,7 @@ const NGX_BASE_MODULES: [&str; 20] = [
/// Additional configuration flags to use when building on Linux.
const NGX_LINUX_ADDITIONAL_OPTS: [&str; 3] = [
"--with-file-aio",
- "--with-cc-opt=-g -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC",
+ "--with-cc-opt=-g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC",
"--with-ld-opt=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie",
];
const ENV_VARS_TRIGGERING_RECOMPILE: [&str; 12] = [
but I'd rather drop the flags from the NGX_LINUX_ADDITIONAL_OPTS
completely. -g
is already set in the auto/cc/*
, -fPIC
causes a build error on Fedora, and warnings are sufficiently covered by the Nginx repo CI. No practical reason to have the remaining options here.
@dekobon what do you think?
A patch in the Ubuntu build of gcc incorrectly checks for a duplicate definition of
-D_FORTIFY_SOURCE
.A minimal fix would be
--- a/nginx-sys/build/vendored.rs +++ b/nginx-sys/build/vendored.rs @@ -97,7 +97,7 @@ const NGX_BASE_MODULES: [&str; 20] = [ /// Additional configuration flags to use when building on Linux. const NGX_LINUX_ADDITIONAL_OPTS: [&str; 3] = [ "--with-file-aio", - "--with-cc-opt=-g -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC", + "--with-cc-opt=-g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC", "--with-ld-opt=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie", ]; const ENV_VARS_TRIGGERING_RECOMPILE: [&str; 12] = [
but I'd rather drop the flags from the
NGX_LINUX_ADDITIONAL_OPTS
completely.-g
is already set in theauto/cc/*
,-fPIC
causes a build error on Fedora, and warnings are sufficiently covered by the Nginx repo CI. No practical reason to have the remaining options here.@dekobon what do you think?
That seems reasonable to me. Would you mind submitting a PR?
Describe the bug Can't build on Ubuntu 24.04 at
85/88: nginx-sys(build)
To Reproduce
I see:
Possibly fix I remove this:
-Wp,-D_FORTIFY_SOURCE=2
fromto
and compilation was success
My environment
rustc
version isrustc 1.78.0 (9b00956e5 2024-04-29)
Additional context Add any other context about the problem here. Any log files you want to share.