]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
[configure] Fix detecting -fno-lto support
authorMika T. Lindqvist <postmaster@raasu.org>
Sat, 6 Dec 2025 21:52:57 +0000 (23:52 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 8 Dec 2025 11:58:14 +0000 (12:58 +0100)
* Previously -fno-lto support was assumed to be supported on non-gcc compatible or unsupported compilers.
  Support for it was never tested on those cases. Set the default to not supported.

configure

index e7092c8ed53f359956a207116904a33caeb1d26f..1aef2c36712622a54a798db9f3302bd2b74b6d04 100755 (executable)
--- a/configure
+++ b/configure
@@ -135,7 +135,8 @@ zbcflag=
 HAVE_RVV_INTRIN=0
 HAVE_ZBC_EXT=0
 armv6flag=
-noltoflag="-fno-lto"
+# Set default for noltoflag based on compiler being gcc compatible or not
+noltoflag=
 vgfmaflag="-march=z13"
 vmxflag="-maltivec"
 symbol_prefix=""
@@ -1037,6 +1038,7 @@ int main() { return 0; }
 EOF
   if $cc $CFLAGS -fno-lto -c $test.c >> configure.log 2>&1; then
     echo "Checking for -fno-lto... Yes." | tee -a configure.log
+    noltoflag="-fno-lto"
   else
     echo "Checking for -fno-lto... No." | tee -a configure.log
     noltoflag=""