From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 Description of problem: Can't rebuild GCC (full rebuild) on RH 8.0 Pro. (in order to change the default target CPU from i386 to i686 or pentium4). Along with my "custom" options, the default configure options or as-shipped RH 8.0 configure options don not work either. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Download GCC 3.2 2. su root 3. mkdir gcc3.2 4. tar --directory=/home/dfladebo/gcc-3.2 -zxf gcc-3.2.tar.gz 5. mv ~dfladebo/gcc-3.2/gcc-3.2 ~dfladebo/gcc-3.2/gcc-3.2-src 6. mkdir ~dfladebo/gcc-3.2/gcc-3.2-obj 7. chown -R root ~dfladebo/gcc-3.2 8. chgrp -R root ~dfladebo/gcc-3.2 9. cd ~dfladebo/gcc-3.2/gcc-3.2-obj 10. ../gcc-3.2-src/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit 11. make bootstrap (fails - see Results section) Actual Results: Below is the compilation step make bootstrap fails on, and the result: /home/dfladebo/gcc-3.2/gcc-3.2-obj/gcc/xgcc -shared-libgcc -B/home/dfladebo/gcc-3.2/gcc-3.2-obj/gcc/ -nostdinc++ -L/home/dfladebo/gcc-3.2/gcc-3.2-obj/i686-redhat-linux/libstdc++-v3/src -L/home/dfladebo/gcc-3.2/gcc-3.2-obj/i686-redhat-linux/libstdc++-v3/src/.libs -B/usr/i686-redhat-linux/bin/ -B/usr/i686-redhat-linux/lib/ -isystem /usr/i686-redhat-linux/include -nostdinc++ -I/home/dfladebo/gcc-3.2/gcc-3.2-obj/i686-redhat-linux/libstdc++-v3/include/i686-redhat-linux -I/home/dfladebo/gcc-3.2/gcc-3.2-obj/i686-redhat-linux/libstdc++-v3/include -I../../../../gcc-3.2-src/libstdc++-v3/libsupc++ -I../../../../gcc-3.2-src/libstdc++-v3/libmath -g -O2 -D_GNU_SOURCE -fno-implicit-templates -Wall -Wno-format -W -Wwrite-strings -Winline -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -g -c ../../../../gcc-3.2-src/libstdc++-v3/src/locale.cc -fPIC -DPIC -o .libs/locale.o In file included from ../../../../gcc-3.2-src/libstdc++-v3/src/locale.cc:406: /home/dfladebo/gcc-3.2/gcc-3.2-obj/i686-redhat-linux/libstdc++-v3/include/i686-redhat-linux/bits/ctype_noninline.h: In static member function `static const short unsigned int* std::ctype<char>::classic_table()': /home/dfladebo/gcc-3.2/gcc-3.2-obj/i686-redhat-linux/libstdc++-v3/include/i686-redhat-linux/bits/ctype_noninline.h:45: ` __ctype_b' undeclared (first use this function) /home/dfladebo/gcc-3.2/gcc-3.2-obj/i686-redhat-linux/libstdc++-v3/include/i686-redhat-linux/bits/ctype_noninline.h:45: (Each undeclared identifier is reported only once for each function it appears in.) /home/dfladebo/gcc-3.2/gcc-3.2-obj/i686-redhat-linux/libstdc++-v3/include/i686-redhat-linux/bits/ctype_noninline.h: In constructor `std::ctype<char>::ctype(int*, const short unsigned int*, bool, unsigned int)': /home/dfladebo/gcc-3.2/gcc-3.2-obj/i686-redhat-linux/libstdc++-v3/include/i686-redhat-linux/bits/ctype_noninline.h:61: ` __ctype_toupper' undeclared (first use this function) /home/dfladebo/gcc-3.2/gcc-3.2-obj/i686-redhat-linux/libstdc++-v3/include/i686-redhat-linux/bits/ctype_noninline.h:61: ` __ctype_tolower' undeclared (first use this function) Additional info: Although it is very important that we be able to rebuild GCC no matter how it is shipped with Red Hat, I also question the need to make i386 the lowest common denominator for GCC by default, since probably a VERY LOW % of systems out there still use this chip, and specifying, say, i686 instead of i386 would result in better code generation for the great majority of intel systems currently out there. This i686 spec. wouldn't result in generated op. codes that won't run on i386 - just code that is better "tuned" for i686 (ppro) and above.
You need de_DE locale installed in order to build gcc (libstdc++ configury uses this locale to find out whether libc handles some wide string functions properly). gcc-3.2-* rpms in rawhide already run localedef during the build if de_DE locale is found to be missing. You can do it yourself: localedef -f ISO-8859-1 -i de_DE /usr/lib/locale/de_DE (or have de_DE enabled in the installer). The whole distro already uses -O2 -march=i386 -mcpu=i686 in the CFLAGS, so I'm not sure if a different default is really needed.
Hello - thanks for the resolution to the build problem. The RH GCC 3.2 system itself is apparently built using -mcpu=i686, but the compiler itself generates -mcpu=i386 code by default. This is apparently the default when --host=i386-redhat-linux is specified for configure. I've verified this by looking at the gcc specs file and the coresponding docs. and also manually specifying -mcpu=i386 and -mcpu=i686 for benchmarks and comparing the binaries to the default. The compiler is definately generating code tuned for i386 CPU's by default, and this makes a big difference in performance from what I've seen, at least for "peephole" type of optimizations. Thanks, Dave Fladebo
The de_DE locale fix doesn't seem to work.. Here's the output after localedef -f ISO-8859-1 -i de_DE /usr/lib/locale/de_DE: /home/dfladebo/gcc-3.2/gcc-3.2-obj/gcc/xgcc -shared-libgcc -B/home/dfladebo/gcc-3.2/gcc-3.2-obj/gcc/ -nostdinc++ -L/home/dfladebo/gcc-3.2/gcc-3.2-obj/i386-redhat-linux/libstdc++-v3/src -L/home/dfladebo/gcc-3.2/gcc-3.2-obj/i386-redhat-linux/libstdc++-v3/src/.libs -B/usr/i386-redhat-linux/bin/ -B/usr/i386-redhat-linux/lib/ -isystem /usr/i386-redhat-linux/include -nostdinc++ -I/home/dfladebo/gcc-3.2/gcc-3.2-obj/i386-redhat-linux/libstdc++-v3/include/i386-redhat-linux -I/home/dfladebo/gcc-3.2/gcc-3.2-obj/i386-redhat-linux/libstdc++-v3/include -I../../../../gcc-3.2-src/libstdc++-v3/libsupc++ -I../../../../gcc-3.2-src/libstdc++-v3/libmath -g -O2 -D_GNU_SOURCE -fno-implicit-templates -Wall -Wno-format -W -Wwrite-strings -Winline -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -g -c c++locale.cc -fPIC -DPIC -o .libs/c++locale.o c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&, std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = long int]': c++locale.cc:51: `__strtol_l' undeclared (first use this function) c++locale.cc:51: (Each undeclared identifier is reported only once for each function it appears in.) c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&, std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = long unsigned int]': c++locale.cc:69: `__strtoul_l' undeclared (first use this function) c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&, std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = long long int]': c++locale.cc:87: `__strtoll_l' undeclared (first use this function) c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&, std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = long long unsigned int]': c++locale.cc:106: `__strtoull_l' undeclared (first use this function) c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&, std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = float]': c++locale.cc:124: `__strtof_l' undeclared (first use this function) c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&, std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = double]': c++locale.cc:141: `__strtod_l' undeclared (first use this function) c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&, std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = long double]': c++locale.cc:158: `__strtold_l' undeclared (first use this function) c++locale.cc: In static member function `static void std::locale::facet::_S_create_c_locale(__locale_struct*&, const char*, __locale_struct*)': c++locale.cc:170: `__newlocale' undeclared (first use this function) c++locale.cc: In static member function `static void std::locale::facet::_S_destroy_c_locale(__locale_struct*&)': c++locale.cc:180: `__freelocale' undeclared (first use this function) c++locale.cc: In static member function `static __locale_struct* std::locale::facet::_S_clone_c_locale(__locale_struct*&)': c++locale.cc:184: `__duplocale' undeclared (first use this function) make[4]: *** [c++locale.lo] Error 1 make[4]: Leaving directory `/home/dfladebo/gcc-3.2/gcc-3.2-obj/i386-redhat-linux/libstdc++-v3/src' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/dfladebo/gcc-3.2/gcc-3.2-obj/i386-redhat-linux/libstdc++-v3' make[2]: *** [all-recursive-am] Error 2 make[2]: Leaving directory `/home/dfladebo/gcc-3.2/gcc-3.2-obj/i386-redhat-linux/libstdc++-v3' make[1]: *** [all-target-libstdc++-v3] Error 2 make[1]: Leaving directory `/home/dfladebo/gcc-3.2/gcc-3.2-obj' make: *** [bootstrap] Error 2