This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: New libstdc++v3 failure during bootstrap


Benjamin Kosnik wrote:

> looks like _GLIBCPP_HAVE_MBSTATE_T is not being set correctly.

Huh.  You're right.  But it's not being set for a completely non-obvious
reason.

> If you look in your build dir/include/bits/c++config look and see what it 
> says for this macro.
> 
> that gets set at this point in acinclude.m4:
> 
> AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
> 
>   dnl Test wchar.h for mbstate_t, which is needed for char_traits and
>   dnl others even if wchar_t support is not on.
>   AC_MSG_CHECKING([for mbstate_t])
>   AC_TRY_COMPILE([#include <wchar.h>],
>   [mbstate_t teststate;], 
>   have_mbstate_t=yes, have_mbstate_t=no)
>   AC_MSG_RESULT($have_mbstate_t)
>   if test x"$have_mbstate_t" = xyes; then
>     AC_DEFINE(HAVE_MBSTATE_T)
>   fi

That's indeed where it's choking.   It was a head-scratcher for a while.
Excerpt from config.log:

configure:1124: checking whether we are using GNU C
configure:1148: checking whether /play/negcs/gcc/xgcc -B/play/negcs/gcc/ -B/usr/
local/i686-pc-sco3.2v5.0.6/bin/ -B/usr/local/i686-pc-sco3.2v5.0.6/lib/ -isystem
/usr/local/i686-pc-sco3.2v5.0.6/include accepts -g
configure:1193: checking for c++
configure:1228: checking whether we are using GNU C++
configure:1252: checking whether /play/negcs/gcc/g++ -B/play/negcs/gcc/ -nostdin
c++  -L/play/negcs/i686-pc-sco3.2v5.0.6/libstdc++-v3/src -L/play/negcs/i686-pc-s
co3.2v5.0.6/libstdc++-v3/src/.libs -B/usr/local/i686-pc-sco3.2v5.0.6/bin/ -B/usr
/local/i686-pc-sco3.2v5.0.6/lib/ -isystem /usr/local/i686-pc-sco3.2v5.0.6/includ
e accepts -g
configure:1283: checking for as
configure:1315: checking for ar
configure:1347: checking for ranlib
configure:1424: checking for a BSD compatible install
configure:1478: checking whether to enable maintainer-specific portions of Makef
iles
configure:1654: checking for ld used by GCC
/play/egcs/libstdc++-v3/configure: /play/negcs/gcc/xgcc: not found
configure:1722: checking if the linker (ld) is GNU ld
configure:1739: checking for ld option to reload object files
configure:1751: checking for BSD-compatible nm
configure:1789: checking whether ln -s works
configure:1810: checking how to recognise dependant libraries
configure:1953: checking for object suffix
configure:2116: checking for ranlib
configure:2183: checking for strip
configure:2304: checking whether the C compiler needs -belf
configure:2354: checking how to run the C++ preprocessor
ltconfig:675:checking for /play/negcs/gcc/xgcc option to produce PIC
ltconfig:684:checking that /play/negcs/gcc/xgcc PIC flag  -fPIC -DPIC works.
ltconfig:746: checking if /play/negcs/gcc/xgcc static flag -static works
ltconfig:792: checking if /play/negcs/gcc/xgcc supports -c -o file.o
ltconfig:793: /play/negcs/gcc/xgcc -B/play/negcs/gcc/ -B/usr/local/i686-pc-sco3.
2v5.0.6/bin/ -B/usr/local/i686-pc-sco3.2v5.0.6/lib/ -isystem /usr/local/i686-pc-
sco3.2v5.0.6/include -c -g -belf -o out/conftest2.o  conftest.c 1>&5
/play/egcs/libstdc++-v3/../ltconfig[793]: /play/negcs/gcc/xgcc:  not found
ltconfig:846: checking if /play/negcs/gcc/xgcc supports -fno-rtti -fno-exception
s
ltconfig:847: /play/negcs/gcc/xgcc -B/play/negcs/gcc/ -B/usr/local/i686-pc-sco3.
2v5.0.6/bin/ -B/usr/local/i686-pc-sco3.2v5.0.6/lib/ -isystem /usr/local/i686-pc-
sco3.2v5.0.6/include -c -g -belf -fno-rtti -fno-exceptions -c conftest.c  confte
st.c 1>&5
/play/egcs/libstdc++-v3/../ltconfig[847]: /play/negcs/gcc/xgcc:  not found


"Now, wait", says I.  What do you mean you can't find xgcc?  You just
three staged it!  It's definitely there and it was found by the other
billion places in the configure script it's used.

The problem is that something is being too smart about passing flags.
"-belf" is a valid flag to the native (gcc-not) compiler to tell it to
emit ELF instead of COFF.  It's a valid flag *but with a completely
different meaning* to our freshly build xgcc.

I don't know where that "-belf" is coming from, but it definitely needs
to NOT be here if the compiler in use is GCC.  It could substitute -melf
if it wanted to for GCC or it could substitute nothing at all for even
remotely modern GCC's.

RJL



> 
> -benjamin
> 
> 
> > /play/egcs/libstdc++-v3/include/c_std/bits/std_cwchar.h:63: `mbstate_t' not 
> >    declared
> > In file included from /play/egcs/libstdc++-v3/include/bits/std_complex.h:42,
> >                  from /play/egcs/libstdc++-v3/src/complex_io.cc:30:
> > /play/egcs/libstdc++-v3/include/bits/std_iosfwd.h:112: `mbstate_t' was not 
> >    declared in this scope

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]