Created attachment 49318 [details] config.log from failed attempt On gcc302.fsffrance.org, with ../trunk/configure --prefix=$HOME --enable-languages=c,c++,fortran,lto and invoked with "gmake" Last output: checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... no checking whether to build static libraries... yes checking how to run the C++ preprocessor... /lib/cpp configure: error: in `/home/tkoenig/trunk-bin/gmp': configure: error: C++ preprocessor "/lib/cpp" fails sanity check See `config.log' for more details gmake[2]: *** [Makefile:5484: configure-stage1-gmp] Error 1 gmake[2]: Leaving directory '/home/tkoenig/trunk-bin' gmake[1]: *** [Makefile:27002: stage1-bubble] Error 2 gmake[1]: Leaving directory '/home/tkoenig/trunk-bin' gmake: *** [Makefile:1004: all] Error 2
You need to attach the config.log file in `/home/tkoenig/trunk-bin/gmp'.
Created attachment 49319 [details] config.log from gmp subdirectory Here it is. For what it is worth, I now tried bootstrapping with CC=cc and CXX=c++, and things seem to be working (so far).
The /lib/cpp error is a bit misleading, because that's the last thing it tries to find as a C++ compiler, after exhausting g++ -std=c++11 and various other options that fail with: configure:19863: g++ -std=c++11 -E conftest.cpp cc1plus: error: unrecognized command line option "-std=c++11" As stated in the install docs, you need a C++11 compiler, and the system GCC on OpenBSD probably doesn't recognise the -std=c++11 option. This is not a bug.
Created attachment 49320 [details] config.log from failing libgomp OK, so that one isn't a bug. I hope you don't mind if I put in the next failure after bootstrapping with the system compiler, clang 8 (setting CC to cc and CXX to c++): gmake[4]: Leaving directory '/home/tkoenig/trunk-clang/x86_64-unknown-openbsd6.7/libgcc' gmake[3]: Leaving directory '/home/tkoenig/trunk-clang/x86_64-unknown-openbsd6.7/libgcc' mkdir x86_64-unknown-openbsd6.7/libgomp Checking multilib configuration for libgomp... Configuring stage 1 in x86_64-unknown-openbsd6.7/libgomp configure: creating cache ./config.cache checking for --enable-version-specific-runtime-libs... no checking for --enable-generated-files-in-srcdir... no checking build system type... x86_64-unknown-openbsd6.7 checking host system type... x86_64-unknown-openbsd6.7 checking target system type... x86_64-unknown-openbsd6.7 checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p checking for gawk... awk checking whether gmake sets $(MAKE)... yes checking whether gmake supports nested variables... yes checking for x86_64-unknown-openbsd6.7-gcc... /home/tkoenig/trunk-clang/./gcc/xgcc -B/home/tkoenig/trunk-clang/./gcc/ -B/home/tkoenig/x86_64-unknown-openbsd6.7/bin/ -B/home/tkoenig/x86_64-unknown-openbsd6.7/lib/ -isystem /home/tkoenig/x86_64-unknown-openbsd6.7/include -system /home/tkoenig/x86_64-unknown-openbsd6.7/sys-include -fno-checking checking whether the C compiler works... no configure: error: in `/home/tkoenig/trunk-clang/x86_64-unknown-openbsd6.7/libgomp': configure: error: C compiler cannot create executables See `config.log' for more details gmake[2]: *** [Makefile:24794: configure-stage1-target-libgomp] Error 77 gmake[2]: Leaving directory '/home/tkoenig/trunk-clang' gmake[1]: *** [Makefile:27002: stage1-bubble] Error 2 gmake[1]: Leaving directory '/home/tkoenig/trunk-clang' gmake: *** [Makefile:1004: all] Error 2 obsd$
ld: error: unable to find library -lc Huh, not sure what causes that one.
The failing config.log from libgomp contains ld: error: unable to find library -lc so this might be closely related to / a duplicate of PR 97304, which has the identical error message for a different BSD version with clang.
Not really a Fortran bug, I probably clicked on that out of habit. Regarding the original issue: I still think it is a bug to unconditionally use a gcc when that is too old, when a new version of clang is available which should work in principle (modulo the -lc issue).