$ rpm --rebuild compat-egcs-6.2-1.1.2.9.src.rpm ... /usr/src/redhat/BUILD/egcs-1.1.2/obj-i586-linux/gcc/xgcc -B/usr/src/redhat/BUILD/egcs-1.1.2/obj-i586-linux/gcc/ -c -g -O2 -fvtable-thunks -D_GNU_SOURCE -fno-implicit-templates -I. -I../../../libio -nostdinc++ -D_IO_MTSAFE_IO -fpic ../../../libio/iostream.cc -o pic/iostream.o ../../../libio/iostream.cc: In method `class ostream & ostream::operator <<(char)': ../../../libio/iostream.cc:386: `_IO_USER_LOCK' undeclared (first use this function) ../../../libio/iostream.cc:386: (Each undeclared identifier is reported only once ../../../libio/iostream.cc:386: for each function it appears in.) ../../../libio/iostream.cc: In method `class ostream & ostream::operator <<(int)': ../../../libio/iostream.cc:523: confused by earlier errors, bailing out make[2]: *** [iostream.o] Error 1 make[1]: *** [all-target-libio] Error 2 make: *** [bootstrap-lean] Error 2 error: Bad exit status from /var/tmp/rpm-tmp.74350 (%build) Bad exit status from /var/tmp/rpm-tmp.74350 (%build) make[2]: Leaving directory `/var/volatile/rpm/BUILD/egcs-1.1.2/obj-i586-linux/i586-glibc21-linux/libio' make[1]: Leaving directory `/var/volatile/rpm/BUILD/egcs-1.1.2/obj-i586-linux' RPM build errors:
You aren't supposed to do that; it's supposed to be built on a 6.2 system. In any case, applying the patch to build gcc-2.95.2 on glibc-2.2 will probably help.
compat-egcs is really meant to be built in 6.2, but I've fixed this anyway in compat-egcs-6.2-1.1.2.11.