I was recently bootstrapping GCC4 on Tru64. One thing that tripped me up a couple times was an ICE resulting from an invalid version_string (""). I traced this back to the following fragment in gcc/Makefile, where BASEVER_c is assigned: BASEVER := $(srcdir)/BASE-VER # 4.x.y [...] BASEVER_c := $(shell cat $(BASEVER)) For some reason, the value of BASEVER_c was empty. I had the source tree on NFS, and figured that some transient error caused $(BASEVER) to either disappear momentarily, or briefly appear as an empty file. (It's difficult to say, because the rest of the build proceeded with no errors of this sort whatsoever.) Whatever the cause, the makefile as currently written does not check for an empty value of BASEVER_c, and the ICE that later results from this is magnitudes of order more difficult to diagnose for most users. I would like to submit a patch to the makefile, then, that immediately throws an error if BASEVER_c is empty.
Created attachment 15151 [details] Patch against gcc/Makefile.in
BASE-VER should always exist. Also patches should be posted to gcc-patches@.
Created attachment 15157 [details] Updated patch against gcc/Makefile.in Mail sent to gcc-patches@. Today I'm building GCC again, and lo and behold, the BASEVER_c check tripped: ----begin---- rm -f libdecnumber.a ar cru libdecnumber.a decNumber.o decContext.o decUtility.o decimal32.o decimal64.o decimal128.o ranlib libdecnumber.a gmake[3]: Leaving directory `/mnt/scratch/build/35197/gcc--4.2.3.build/libdecnumber' gmake[3]: Entering directory `/mnt/scratch/build/35197/gcc--4.2.3.build/gcc' Makefile:739: *** /tg/freeport/src/gcc/gcc--4.2.3/gcc/BASE-VER : missing version file. Stop. gmake[3]: Leaving directory `/mnt/scratch/build/35197/gcc--4.2.3.build/gcc' gmake[2]: *** [all-stage1-gcc] Error 2 gmake[2]: Leaving directory `/mnt/scratch/build/35197/gcc--4.2.3.build' gmake[1]: *** [stage1-bubble] Error 2 gmake[1]: Leaving directory `/mnt/scratch/build/35197/gcc--4.2.3.build' gmake: *** [bootstrap-lean] Error 2 ----end---- Sure beats an ICE! Anyway, I don't see any error from cat(1), so it looks like BASE-VER is being read as an empty file. (If I cat the file manually, it comes up non-empty; the problem is very transient.) Patch tweaked slightly to remove spurious whitespace from the error message.
*** Bug 35197 has been marked as a duplicate of this bug. ***
(In reply to Daniel Richard G. from comment #3) > Created attachment 15157 [details] > Updated patch against gcc/Makefile.in > > Mail sent to gcc-patches@. Today I'm building GCC again, and lo and behold, > the BASEVER_c check tripped: > [...] https://inbox.sourceware.org/gcc-patches/20080214195846.GA3085@iSKUNK.ORG/