StephanTLavavej / mingw-distro

MinGW distro build scripts.
503 stars 57 forks source link

GCC bootstrap fails with isl-0.26 when built in-tree #96

Open StephanTLavavej opened 10 months ago

StephanTLavavej commented 10 months ago

When re-enabling the GCC bootstrap, the following set of versions fails:

The bootstrap succeeds if I keep isl-0.24, so isl-0.26 specifically appears to be the problem.

The error is:

make[5]: Entering directory '/e/temp/gcc/build/isl'
depbase=`echo isl_test_cpp17-checked.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -std=c++11 -DHAVE_CONFIG_H   -I. -I../../src/isl -I../../src/isl/include -Iinclude/ -I/e/temp/gcc/build/gmp/../../src/gmp -I/e/temp/gcc/build/./gmp   -g -D__USE_MINGW_ACCESS -MT isl_test_cpp17-checked.o -MD -MP -MF $depbase.Tpo -c -o isl_test_cpp17-checked.o ../../src/isl/isl_test_cpp17-checked.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from ../../src/isl/isl_test_cpp17-checked.cc:23:
../../src/isl/isl_test_cpp17-generic.cc: In function 'isl::checked::id construct_id(isl::checked::ctx, bool*)':
../../src/isl/isl_test_cpp17-generic.cc:25:31: error: no matching function for call to 'isl::checked::id::id(isl::checked::ctx&, const char [2], std::shared_ptr<S>&)'
   25 |         isl::id id(ctx, "S", s);
      |                               ^
In file included from ../../src/isl/isl_test_cpp17-checked.cc:7:
../../src/isl/include/isl/cpp-checked.h:9082:1: note: candidate: 'isl::checked::id::id(isl::checked::ctx, const string&)'
 9082 | id::id(isl::checked::ctx ctx, const std::string &str)
      | ^~
../../src/isl/include/isl/cpp-checked.h:9082:1: note:   candidate expects 2 arguments, 3 provided
../../src/isl/include/isl/cpp-checked.h:9076:1: note: candidate: 'isl::checked::id::id(const isl::checked::id&)'
 9076 | id::id(const id &obj)
      | ^~
../../src/isl/include/isl/cpp-checked.h:9076:1: note:   candidate expects 1 argument, 3 provided
../../src/isl/include/isl/cpp-checked.h:9073:1: note: candidate: 'isl::checked::id::id()'
 9073 | id::id()
      | ^~
../../src/isl/include/isl/cpp-checked.h:9073:1: note:   candidate expects 0 arguments, 3 provided
../../src/isl/include/isl/cpp-checked.h:9070:1: note: candidate: 'isl::checked::id::id(isl_id*)'
 9070 | id::id(__isl_take isl_id *ptr)
      | ^~
../../src/isl/include/isl/cpp-checked.h:9070:1: note:   candidate expects 1 argument, 3 provided
In file included from ../../src/isl/isl_test_cpp17-checked.cc:23:
../../src/isl/isl_test_cpp17-generic.cc: In function 'void test_try_user(isl::checked::ctx)':
../../src/isl/isl_test_cpp17-generic.cc:39:34: error: no matching function for call to 'isl::checked::id::id(isl::checked::ctx&, const char [5], int)'
   39 |         isl::id id(ctx, "test", 5);
      |                                  ^
In file included from ../../src/isl/isl_test_cpp17-checked.cc:7:
../../src/isl/include/isl/cpp-checked.h:9082:1: note: candidate: 'isl::checked::id::id(isl::checked::ctx, const string&)'
 9082 | id::id(isl::checked::ctx ctx, const std::string &str)
      | ^~
../../src/isl/include/isl/cpp-checked.h:9082:1: note:   candidate expects 2 arguments, 3 provided
../../src/isl/include/isl/cpp-checked.h:9076:1: note: candidate: 'isl::checked::id::id(const isl::checked::id&)'
 9076 | id::id(const id &obj)
      | ^~
../../src/isl/include/isl/cpp-checked.h:9076:1: note:   candidate expects 1 argument, 3 provided
../../src/isl/include/isl/cpp-checked.h:9073:1: note: candidate: 'isl::checked::id::id()'
 9073 | id::id()
      | ^~
../../src/isl/include/isl/cpp-checked.h:9073:1: note:   candidate expects 0 arguments, 3 provided
../../src/isl/include/isl/cpp-checked.h:9070:1: note: candidate: 'isl::checked::id::id(isl_id*)'
 9070 | id::id(__isl_take isl_id *ptr)
      | ^~
../../src/isl/include/isl/cpp-checked.h:9070:1: note:   candidate expects 1 argument, 3 provided
In file included from ../../src/isl/isl_test_cpp17-checked.cc:23:
../../src/isl/isl_test_cpp17-generic.cc:42:29: error: 'class isl::checked::id' has no member named 'try_user'
   42 |         auto maybe_int = id.try_user<int>();
      |                             ^~~~~~~~
../../src/isl/isl_test_cpp17-generic.cc:42:38: error: expected primary-expression before 'int'
   42 |         auto maybe_int = id.try_user<int>();
      |                                      ^~~
../../src/isl/isl_test_cpp17-generic.cc:43:27: error: 'class isl::checked::id' has no member named 'try_user'
   43 |         auto maybe_s = id.try_user<std::shared_ptr<S>>();
      |                           ^~~~~~~~
../../src/isl/isl_test_cpp17-generic.cc:43:53: error: expected primary-expression before '>' token
   43 |         auto maybe_s = id.try_user<std::shared_ptr<S>>();
      |                                                     ^~
../../src/isl/isl_test_cpp17-generic.cc:43:56: error: expected primary-expression before ')' token
   43 |         auto maybe_s = id.try_user<std::shared_ptr<S>>();
      |                                                        ^
../../src/isl/isl_test_cpp17-generic.cc:44:31: error: 'class isl::checked::id' has no member named 'try_user'
   44 |         auto maybe_int2 = id2.try_user<int>();
      |                               ^~~~~~~~
../../src/isl/isl_test_cpp17-generic.cc:44:40: error: expected primary-expression before 'int'
   44 |         auto maybe_int2 = id2.try_user<int>();
      |                                        ^~~
../../src/isl/isl_test_cpp17-generic.cc:60:35: error: 'class isl::checked::id' has no member named 'try_user'
   60 |                 auto maybe_s = id.try_user<std::shared_ptr<S>>();
      |                                   ^~~~~~~~
../../src/isl/isl_test_cpp17-generic.cc:60:61: error: expected primary-expression before '>' token
   60 |                 auto maybe_s = id.try_user<std::shared_ptr<S>>();
      |                                                             ^~
../../src/isl/isl_test_cpp17-generic.cc:60:64: error: expected primary-expression before ')' token
   60 |                 auto maybe_s = id.try_user<std::shared_ptr<S>>();
      |                                                                ^
make[5]: *** [Makefile:2004: isl_test_cpp17-checked.o] Error 1

I looked into this, and at least part of the problem appears to be that g++ -std=c++11 is being used, despite the code needing C++17. Part of the autoconf machinery seemed to be saying that C++17 is "optional" instead of "mandatory" but I don't really know what the root cause is, or how to solve this.

I suspect that this is not specific to mingw-w64 at all.

StephanTLavavej commented 10 months ago

This was encountered as https://groups.google.com/g/isl-development/c/ShnQcW_35ZQ and discussed on the GCC mailing list in Aug 2023 (mail 1, mail 2, mail 3) but I don't know if anyone's working on it, and I don't see anything filed in GCC Bugzilla.

Et7f3 commented 10 months ago

Archlinux can use isl 0.26 with gcc 13.2.1 and without patches.

StephanTLavavej commented 10 months ago

Is it using an in-tree build with a full bootstrap? That seems to be the important factor here.

Looking at https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/blob/main/PKGBUILD?ref_type=heads , it appears to depend on a previously-built libisl, which explains why it isn't affected by this bug.