Bootstrapping is failing on an arm-unknown-elf cross because of the following error: /work/rearnsha/gnu/egcs-cross/gcc/xgcc -shared-libgcc -B/work/rearnsha/gnu/egcs- cross/gcc/ -nostdinc++ -L/work/rearnsha/gnu/egcs-cross/arm-elf/libstdc++-v3/src -L/work/rearnsha/gnu/egcs-cross/arm-elf/libstdc++-v3/src/.libs -nostdinc -B/work /rearnsha/gnu/egcs-cross/arm-elf/newlib/ -isystem /work/rearnsha/gnu/egcs-cross/ arm-elf/newlib/targ-include -isystem /home/rearnsha/gnusrc/egcs-cross/newlib/lib c/include -B/work/rearnsha/gnu/testinstall/arm-elf/bin/ -B/work/rearnsha/gnu/tes tinstall/arm-elf/lib/ -isystem /work/rearnsha/gnu/testinstall/arm-elf/include -i system /work/rearnsha/gnu/testinstall/arm-elf/sys-include -L/work/rearnsha/gnu/e gcs-cross/ld -I/work/rearnsha/gnu/egcs-cross/arm-elf/libstdc++-v3/include/arm-el f -I/work/rearnsha/gnu/egcs-cross/arm-elf/libstdc++-v3/include -I/home/rearnsha/ gnusrc/egcs-cross/libstdc++-v3/libsupc++ -O2 -O2 -g -g -O2 -fno-implicit-templat es -Wall -Wextra -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -c c++locale.cc -o c++locale.o c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&, std::_Ios _Iostate&, int* const&) [with _Tv = long double]': c++locale.cc:123: error: 'strtold' was not declared in this scope gnumake[3]: *** [c++locale.lo] Error 1 This was probably introduced by the following patch 2004-10-03 Roger Sayle <roger@eyesopen.com> * config/locale/generic/c_locale.cc (__convert_to_v): Use _GLIBCXX_HAVE_STRTOF instead _GLIBCXX_USE_C99 to check for strtof. Likewise, use _GLIBCXX_HAVE_STRTOLD instead of _GLIBCXX_USE_C99 to check for presence of strtold.
Created attachment 7288 [details] preprocessed source
A 3.4 regression also if it was caused by that patch.
As far as I can see, I think the problem is in configure.ac, where we automatically assume that newlib has strtold(). This is false AFAICT, newlib has _strtold, but it doesn't have strtold. R.
Richard does the "obvious" one line fix to configure.ac restore bootstrap for you? It looks like my cygwin (a newlib target) doesn't even have _strtold. Index: configure.ac =================================================================== RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.ac,v retrieving revision 1.27 diff -c -3 -p -r1.27 configure.ac *** configure.ac 5 Oct 2004 05:02:58 -0000 1.27 --- configure.ac 5 Oct 2004 20:55:02 -0000 *************** else *** 194,200 **** # GLIBCXX_CHECK_STDLIB_SUPPORT AC_DEFINE(HAVE_STRTOF) - AC_DEFINE(HAVE_STRTOLD) # AC_FUNC_MMAP AC_DEFINE(HAVE_MMAP) --- 194,199 ----
Yes, I think that probably is the best solution. I looked at changing the entry to HAVE__STRTOLD and adding the other related glue to handle that, but that doesn't work (or I've missed something else) because there's no declartion of _strtold in any of the header files.
Richard note the remappings in c++config.h: #if defined (_GLIBCXX_HAVE__STRTOLD) && ! defined (_GLIBCXX_HAVE_STRTOLD) # define _GLIBCXX_HAVE_STRTOLD 1 # define strtold _strtold #endif I thought _strtold was defined in the newlib binary. -benjamin
... of course, if newlib doesn't have strtold or any of the _strtold or __strtold or whatever, then the cross config bits for newlib shouldn't say that it does. -benjamin
Subject: Re: [3.4/4.0 regression] bootstrap failure - libstdc++ uses strtold when undeclared On Thu, 2004-10-07 at 04:37, bkoz at gcc dot gnu dot org wrote: > ------- Additional Comments From bkoz at gcc dot gnu dot org 2004-10-07 03:37 ------- > > Richard note the remappings in c++config.h: > > #if defined (_GLIBCXX_HAVE__STRTOLD) && ! defined (_GLIBCXX_HAVE_STRTOLD) > # define _GLIBCXX_HAVE_STRTOLD 1 > # define strtold _strtold > #endif > > I thought _strtold was defined in the newlib binary. But no declaration in the headers (at least, not in my copy), so we can't use it in C++ unless there's some mechanism for making libstdc++ configury generate a declaration for us... :-( Further, Roger says that even that isn't in his copy of Cygwin... R.
There is no newlib definition for strtold. Thus, this patch should be applied: http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00603.html -benjamin
Subject: Bug 17850 CVSROOT: /cvs/gcc Module name: gcc Changes by: sayle@gcc.gnu.org 2004-10-07 15:52:43 Modified files: libstdc++-v3 : ChangeLog configure.ac configure Log message: PR libstdc++/17850 * configure.ac: Newlib does not provide strtold. * configure: Regenerate. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2688&r2=1.2689 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.ac.diff?cvsroot=gcc&r1=1.27&r2=1.28 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.diff?cvsroot=gcc&r1=1.409&r2=1.410
Confirmed.
Subject: Bug 17850 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: sayle@gcc.gnu.org 2004-10-07 21:04:14 Modified files: libstdc++-v3 : ChangeLog configure.ac configure Log message: PR libstdc++/17850 * configure.ac: Newlib does not provide strtold. * configure: Regenerate. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.186&r2=1.2224.2.187 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.ac.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.14.4.4&r2=1.14.4.5 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.373.4.19&r2=1.373.4.20
Fixed.