Message ID | 20240216163319.860768-1-fontaine.fabrice@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Herbert Xu |
Headers | show |
Series | configure.ac: drop -Wl,--fatal-warnings | expand |
Hi, On 16/02/2024 16:33, Fabrice Fontaine wrote: > Drop -Wl,--fatal-warnings with --enable-static to avoid the following > static build failure: > > configure:4778: checking for strtod > configure:4778: /home/autobuild/autobuild/instance-8/output-1/host/bin/powerpc-buildroot-linux-uclibcspe-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mabi=spe -mfloat-gprs=single -Wa,-me500 -Os -g0 -static -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -Wl,--fatal-warnings conftest.c >&5 > /home/autobuild/autobuild/instance-8/output-1/host/lib/gcc/powerpc-buildroot-linux-uclibcspe/8.4.0/../../../../powerpc-buildroot-linux-uclibcspe/bin/ld: warning: conftest has a LOAD segment with RWX permissions > collect2: error: ld returned 1 exit status Where is this warning coming from? Does it show a real problem that needs to be addressed? As for the actual patch, you're right that configure should not be using -Wl,--fatal-warnings, it should be avoided there for the same reason -Werror should be, the warnings that get promoted to errors differ between toolchain versions and in general, it is not possible to ensure that all valid toolchains, all valid warning flags, result in no warnings. I suspect though that it was added for a reason, that there were things that *should* cause configure checks to fail, that did not fail except with -Wl,--fatal-warnings. Whatever that reason may have been, it will need to be handled differently if -Wl,--fatal-warnings is dropped. Unfortunately, it was added to dash back in 2007 before the current mailing list existed, so I am having trouble finding any explanation for what those errors may have been. Dropping it sounds good to me if no one can tell why it is there, but I would suggest some experimentation may be in order to try and figure that out first. Cheers, Harald van Dijk
On Fri, Feb 16, 2024 at 05:55:46PM +0000, Harald van Dijk wrote: > > On 16/02/2024 16:33, Fabrice Fontaine wrote: > > Drop -Wl,--fatal-warnings with --enable-static to avoid the following > > static build failure: > > > > configure:4778: checking for strtod > > configure:4778: /home/autobuild/autobuild/instance-8/output-1/host/bin/powerpc-buildroot-linux-uclibcspe-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mabi=spe -mfloat-gprs=single -Wa,-me500 -Os -g0 -static -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -Wl,--fatal-warnings conftest.c >&5 > > /home/autobuild/autobuild/instance-8/output-1/host/lib/gcc/powerpc-buildroot-linux-uclibcspe/8.4.0/../../../../powerpc-buildroot-linux-uclibcspe/bin/ld: warning: conftest has a LOAD segment with RWX permissions > > collect2: error: ld returned 1 exit status > > Where is this warning coming from? Does it show a real problem that needs to > be addressed? > > As for the actual patch, you're right that configure should not be using > -Wl,--fatal-warnings, it should be avoided there for the same reason -Werror > should be, the warnings that get promoted to errors differ between toolchain > versions and in general, it is not possible to ensure that all valid > toolchains, all valid warning flags, result in no warnings. > > I suspect though that it was added for a reason, that there were things that > *should* cause configure checks to fail, that did not fail except with > -Wl,--fatal-warnings. Whatever that reason may have been, it will need to be > handled differently if -Wl,--fatal-warnings is dropped. Unfortunately, it > was added to dash back in 2007 before the current mailing list existed, so I > am having trouble finding any explanation for what those errors may have > been. > > Dropping it sounds good to me if no one can tell why it is there, but I > would suggest some experimentation may be in order to try and figure that > out first. The patch was sent by Alexey Gladkov back in 2006. Let's ask him to see if he remembers what the -Wl,--fatal-warnings was for? Thanks,
On Sat, Apr 06, 2024 at 05:41:43PM +0800, Herbert Xu wrote: > On Fri, Feb 16, 2024 at 05:55:46PM +0000, Harald van Dijk wrote: > > > > On 16/02/2024 16:33, Fabrice Fontaine wrote: > > > Drop -Wl,--fatal-warnings with --enable-static to avoid the following > > > static build failure: > > > > > > configure:4778: checking for strtod > > > configure:4778: /home/autobuild/autobuild/instance-8/output-1/host/bin/powerpc-buildroot-linux-uclibcspe-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mabi=spe -mfloat-gprs=single -Wa,-me500 -Os -g0 -static -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -Wl,--fatal-warnings conftest.c >&5 > > > /home/autobuild/autobuild/instance-8/output-1/host/lib/gcc/powerpc-buildroot-linux-uclibcspe/8.4.0/../../../../powerpc-buildroot-linux-uclibcspe/bin/ld: warning: conftest has a LOAD segment with RWX permissions > > > collect2: error: ld returned 1 exit status > > > > Where is this warning coming from? Does it show a real problem that needs to > > be addressed? > > > > As for the actual patch, you're right that configure should not be using > > -Wl,--fatal-warnings, it should be avoided there for the same reason -Werror > > should be, the warnings that get promoted to errors differ between toolchain > > versions and in general, it is not possible to ensure that all valid > > toolchains, all valid warning flags, result in no warnings. > > > > I suspect though that it was added for a reason, that there were things that > > *should* cause configure checks to fail, that did not fail except with > > -Wl,--fatal-warnings. Whatever that reason may have been, it will need to be > > handled differently if -Wl,--fatal-warnings is dropped. Unfortunately, it > > was added to dash back in 2007 before the current mailing list existed, so I > > am having trouble finding any explanation for what those errors may have > > been. > > > > Dropping it sounds good to me if no one can tell why it is there, but I > > would suggest some experimentation may be in order to try and figure that > > out first. > > The patch was sent by Alexey Gladkov back in 2006. Let's ask him > to see if he remembers what the -Wl,--fatal-warnings was for? Oh. It was so long ago. If I'm not mistaken, -Wl,--fatal-warnings was added to --enable-static because of --with-libedit. But this may be a false memory. Sorry. [Thu Oct 4 14:21:44 2007 +0800] 12dc496 "[BUILD] Add --enable-static option to configure." [Tue May 23 20:52:23 2006 +1000] 13537aa "[BUILD] Added --with-libedit option to configure" > Thanks, > -- > Email: Herbert Xu <herbert@gondor.apana.org.au> > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt >
On Fri, Feb 16, 2024 at 05:33:19PM +0100, Fabrice Fontaine wrote: > Drop -Wl,--fatal-warnings with --enable-static to avoid the following > static build failure: > > configure:4778: checking for strtod > configure:4778: /home/autobuild/autobuild/instance-8/output-1/host/bin/powerpc-buildroot-linux-uclibcspe-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mabi=spe -mfloat-gprs=single -Wa,-me500 -Os -g0 -static -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -Wl,--fatal-warnings conftest.c >&5 > /home/autobuild/autobuild/instance-8/output-1/host/lib/gcc/powerpc-buildroot-linux-uclibcspe/8.4.0/../../../../powerpc-buildroot-linux-uclibcspe/bin/ld: warning: conftest has a LOAD segment with RWX permissions > collect2: error: ld returned 1 exit status > > [...] > > In file included from arith_yylex.c:44: > system.h:74:22: error: static declaration of 'strtod' follows non-static declaration > static inline double strtod(const char *nptr, char **endptr) > ^~~~~~ > > Fixes: > - http://autobuild.buildroot.org/results/a54fdc7d1b94beb47203373ae35b08d9cea8d42c > > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> > --- > configure.ac | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Patch applied. Thanks.
diff --git a/configure.ac b/configure.ac index 5524650..6993364 100644 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,7 @@ fi AC_ARG_ENABLE(static, AS_HELP_STRING(--enable-static, \ [Build statical linked program])) if test "$enable_static" = "yes"; then - export LDFLAGS="-static -Wl,--fatal-warnings" + export LDFLAGS="-static" fi AC_ARG_ENABLE(fnmatch, AS_HELP_STRING(--disable-fnmatch, \
Drop -Wl,--fatal-warnings with --enable-static to avoid the following static build failure: configure:4778: checking for strtod configure:4778: /home/autobuild/autobuild/instance-8/output-1/host/bin/powerpc-buildroot-linux-uclibcspe-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mabi=spe -mfloat-gprs=single -Wa,-me500 -Os -g0 -static -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -Wl,--fatal-warnings conftest.c >&5 /home/autobuild/autobuild/instance-8/output-1/host/lib/gcc/powerpc-buildroot-linux-uclibcspe/8.4.0/../../../../powerpc-buildroot-linux-uclibcspe/bin/ld: warning: conftest has a LOAD segment with RWX permissions collect2: error: ld returned 1 exit status [...] In file included from arith_yylex.c:44: system.h:74:22: error: static declaration of 'strtod' follows non-static declaration static inline double strtod(const char *nptr, char **endptr) ^~~~~~ Fixes: - http://autobuild.buildroot.org/results/a54fdc7d1b94beb47203373ae35b08d9cea8d42c Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)