https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92484
Irfan Adilovic <irfanadilovic at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |irfanadilovic at gmail dot com --- Comment #6 from Irfan Adilovic <irfanadilovic at gmail dot com> --- Here's my take on this. GCC configure.ac has this: # When bootstrapping with GCC, build stage 1 in C++98 mode to ensure that a # C++98 compiler can still start the bootstrap. if test "$enable_bootstrap:$GXX" = "yes:yes"; then CXX="$CXX -std=gnu++98" fi which results in the CXX being defined as 'g++ -std=gnu++98 -std=c++11' in ISL Makefiles (CXX propagated recursively). However this is *not* the problem, as this CXX definition works just fine on C++11 source code. This leads me to conclude that GCC must be using some kind of make variable override mechanism, like invoking the ISL make with `make CXX="$CXX" all` which leads to the complete override of CXX in ISL Makefiles, leaving out the -std=c++11 flag, and leading to compilation failures of C++11 code in ISL. Moreover, to reinforce this conclusion, running a plain 'make' in ISL build subdir, right after the top-level make has failed, works just fine. It is only when invoked recursively through toplevel Makefile, that it fails as described. --- By invoking top-level make as 'make V=1 SHELL="/bin/bash -vx"' I've been able to isolate the full make command used to build ISL (warning, it's a handful): make "DESTDIR=" "RPATH_ENVVAR=LD_LIBRARY_PATH" "TARGET_SUBDIR=x86_64-redhat-linux" "bindir=/usr/local/gcc-9.2.0/bin" "datadir=/usr/local/gcc-9.2.0/share" "exec_prefix=/usr/local/gcc-9.2.0" "includedir=/usr/local/gcc-9.2.0/include" "datarootdir=/usr/local/gcc-9.2.0/share" "docdir=/usr/local/gcc-9.2.0/share/doc/" "infodir=/usr/local/gcc-9.2.0/share/info" "pdfdir=/usr/local/gcc-9.2.0/share/doc/" "htmldir=/usr/local/gcc-9.2.0/share/doc/" "libdir=/usr/local/gcc-9.2.0/lib" "libexecdir=/usr/local/gcc-9.2.0/libexec" "lispdir=" "localstatedir=/usr/local/gcc-9.2.0/var" "mandir=/usr/local/gcc-9.2.0/share/man" "oldincludedir=/usr/include" "prefix=/usr/local/gcc-9.2.0" "sbindir=/usr/local/gcc-9.2.0/sbin" "sharedstatedir=/usr/local/gcc-9.2.0/com" "sysconfdir=/usr/local/gcc-9.2.0/etc" "tooldir=/usr/local/gcc-9.2.0/x86_64-redhat-linux" "build_tooldir=/usr/local/gcc-9.2.0/x86_64-redhat-linux" "target_alias=x86_64-redhat-linux" "AWK=gawk" "BISON=bison" "CC_FOR_BUILD=gcc" "CFLAGS_FOR_BUILD=-g -O2" "CXX_FOR_BUILD=g++ -std=gnu++98" "EXPECT=expect" "FLEX=flex" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS_FOR_BUILD=" "LEX=flex" "M4=m4" "MAKE=make" "RUNTEST=runtest" "RUNTESTFLAGS=" "SED=/bin/sed" "SHELL=/bin/bash -vx" "YACC=bison -y" "`echo 'ADAFLAGS=' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "ADA_CFLAGS=" "AR_FLAGS=rc" "`echo 'BOOT_ADAFLAGS=-gnatpg' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "BOOT_CFLAGS=-g -O2" "BOOT_LDFLAGS=" "CFLAGS=-g -O2" "CXXFLAGS=-g -O2" "LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCXXFLAGS=-g -O2 -fno-implicit-templates" "STAGE1_CHECKING=--enable-checking=release,types" "STAGE1_LANGUAGES=c,c++,lto" "GNATBIND=no" "GNATMAKE=no" "GDC=@GDC@" "GDCFLAGS=-g -O2" "AR_FOR_TARGET=ar" "AS_FOR_TARGET=as" "CC_FOR_TARGET=/root/gcc/gcc/build/./gcc/xgcc -B/root/gcc/gcc/build/./gcc/" "CFLAGS_FOR_TARGET=-g -O2" "CPPFLAGS_FOR_TARGET=" "CXXFLAGS_FOR_TARGET=-g -O2 -D_GNU_SOURCE" "DLLTOOL_FOR_TARGET=dlltool" "FLAGS_FOR_TARGET=-B/usr/local/gcc-9.2.0/x86_64-redhat-linux/bin/ -B/usr/local/gcc-9.2.0/x86_64-redhat-linux/lib/ -isystem /usr/local/gcc-9.2.0/x86_64-redhat-linux/include -isystem /usr/local/gcc-9.2.0/x86_64-redhat-linux/sys-include" "GFORTRAN_FOR_TARGET=" "GOC_FOR_TARGET=" "GOCFLAGS_FOR_TARGET=-O2 -g" "GDC_FOR_TARGET=@GDC@" "GDCFLAGS_FOR_TARGET=-O2 -g" "LD_FOR_TARGET=ld" "LIPO_FOR_TARGET=lipo" "LDFLAGS_FOR_TARGET=" "LIBCFLAGS_FOR_TARGET=-g -O2" "LIBCXXFLAGS_FOR_TARGET=-g -O2 -D_GNU_SOURCE -fno-implicit-templates" "NM_FOR_TARGET=nm" "OBJDUMP_FOR_TARGET=objdump" "OBJCOPY_FOR_TARGET=" "RANLIB_FOR_TARGET=ranlib" "READELF_FOR_TARGET=readelf" "STRIP_FOR_TARGET=strip" "WINDRES_FOR_TARGET=windres" "WINDMC_FOR_TARGET=windmc" "BUILD_CONFIG=bootstrap-debug" "`echo 'LANGUAGES=' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "LEAN=false" "STAGE1_CFLAGS=-g" "STAGE1_CXXFLAGS=-g" "STAGE1_GENERATOR_CFLAGS=" "STAGE1_TFLAGS=-fno-checking" "STAGE2_CFLAGS=-g -O2 -fno-checking -gtoggle" "STAGE2_CXXFLAGS=-g -O2 -fno-checking -gtoggle" "STAGE2_GENERATOR_CFLAGS=" "STAGE2_TFLAGS=-fno-checking" "STAGE3_CFLAGS=-g -O2 -fchecking=1" "STAGE3_CXXFLAGS=-g -O2 -fchecking=1" "STAGE3_GENERATOR_CFLAGS=" "STAGE3_TFLAGS=-fchecking=1" "STAGE4_CFLAGS=-g -O2" "STAGE4_CXXFLAGS=-g -O2" "STAGE4_GENERATOR_CFLAGS=" "STAGE4_TFLAGS=" "STAGEprofile_CFLAGS=-g -O2 -fno-checking -gtoggle -fprofile-generate" "STAGEprofile_CXXFLAGS=-g -O2 -fno-checking -gtoggle -fprofile-generate" "STAGEprofile_GENERATOR_CFLAGS=" "STAGEprofile_TFLAGS=-fno-checking" "STAGEtrain_CFLAGS=-g -O2" "STAGEtrain_CXXFLAGS=-g -O2" "STAGEtrain_GENERATOR_CFLAGS=" "STAGEtrain_TFLAGS=" "STAGEfeedback_CFLAGS=-g -O2 -fprofile-use" "STAGEfeedback_CXXFLAGS=-g -O2 -fprofile-use" "STAGEfeedback_GENERATOR_CFLAGS=" "STAGEfeedback_TFLAGS=" "STAGEautoprofile_CFLAGS=-g -O2 -fno-checking -gtoggle -g" "STAGEautoprofile_CXXFLAGS=-g -O2 -fno-checking -gtoggle -g" "STAGEautoprofile_GENERATOR_CFLAGS=" "STAGEautoprofile_TFLAGS=-fno-checking" "STAGEautofeedback_CFLAGS=-g -O2 -fchecking=1" "STAGEautofeedback_CXXFLAGS=-g -O2 -fchecking=1" "STAGEautofeedback_GENERATOR_CFLAGS=" "STAGEautofeedback_TFLAGS=-fchecking=1" "TFLAGS=" "CONFIG_SHELL=/bin/bash -vx" "MAKEINFO=makeinfo --split-size=5000000 --split-size=5000000 --split-size=5000000" \ CFLAGS="-g" \ GENERATOR_CFLAGS="" \ CXXFLAGS="-g" \ LIBCFLAGS="-g -O2" \ CFLAGS_FOR_TARGET="-g -O2" \ CXXFLAGS_FOR_TARGET="-g -O2 -D_GNU_SOURCE" \ LIBCFLAGS_FOR_TARGET="-g -O2" \ 'AR=ar' 'AS=as' 'CC=gcc' 'CXX=g++ -std=gnu++98' 'DLLTOOL=dlltool' 'GFORTRAN=' 'GOC=' 'GDC=@GDC@' 'LD=ld' 'LIPO=lipo' 'NM=nm' 'OBJDUMP=objdump' 'OTOOL=otool' 'RANLIB=ranlib' 'READELF=readelf' 'STRIP=strip' 'WINDRES=windres' 'WINDMC=windmc' 'CREATE_GCOV=create_gcov' \ LDFLAGS="${LDFLAGS}" HOST_LIBS="${HOST_LIBS}" V=1 \ TFLAGS="-fno-checking" \ all The culprit being the 'CXX=g++ -std=gnu++98' in the last couple of lines. So top-level gcc Makefile forces all dependencies to build in C++98, no matter their own choice or requirements. --- The question now becomes that of original intent: does the original designer of the build system intentionally require the stage 1 of the build to be in C++98 (1) including all dependencies like MPFR, GMP, ISL and MPC, or (2) just the GCC part? Case (1) needs justification, as it disallows any dependency to use C++11 or higher standard code. Case (2) means we have a bug in the build system. -- Irfan