https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128972

            Bug ID: 128972
           Summary: Cross compilation native mingw-w64 GCC fail at
                    checking gmp.h
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mateuszb at poczta dot onet.pl
  Target Milestone: ---

If on Linux I try to build GCC in 2 steps:
1) build cross compiler
2) build native mingw-w64 compiler by the cross compiler
there is an error in configure:
checking for LC_MESSAGES... yes
checking for nl_langinfo and CODESET... yes
checking whether gmp.h can be used... no
configure: error: cannot compile with gmp.h using GMPINC ().
An in-tree gmp must create gmp.h when it is configured.
make[1]: *** [Makefile:4735: configure-gcc] Error 1
make[1]: Leaving directory '/home/m/m/b/tg_gcc'
make: *** [Makefile:1118: all] Error 2

Cross compiler build OK, error is when cross compiler try to build native
compiler.

Configure GCC looks like this:
+ mkdir tg_gcc
+ cd tg_gcc
+ /home/m/m/s/gcc-g/configure --host=x86_64-w64-mingw32
--target=x86_64-w64-mingw32 --disable-nls --enable-languages=c,c++,objc,obj-c++
--with-gmp=/home/m/m/b/for_target --with-mpfr=/home/m/m/b/for_target
--with-mpc=/home/m/m/b/for_target --with-isl=/home/m/m/b/for_target
--enable-twoprocess --disable-libstdcxx-pch --disable-win32-registry
--disable-shared --enable-threads=posix --enable-libssp --prefix=/home/m/m/t
--with-sysroot=/home/m/m/t

The bug start with:
commit 8383ac6fcda32c79291a54f01fcdc688f8f832f0
Author: Kyrylo Tkachov <[email protected]>
Date:   Tue Oct 13 15:05:37 2026 +0200

    build: let configure-gcc start once gmp is configured

My workaround is:
diff --git a/gcc/configure b/gcc/configure
index e45605b7340..ec7063aa948 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -12265,15 +12265,6 @@ mpz_t x; mpz_init (x);
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-   as_fn_error $? "cannot compile with gmp.h using GMPINC ($GMPINC).
-An in-tree gmp must create gmp.h when it is configured." "$LINENO" 5
-fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

 # gcc_AC_CHECK_DECLS doesn't support overloaded functions, so use the

The check is pointless, GCC can't be build without gmp, so we only wasting time
checking this (and doing it in buggy style).

Reply via email to