Re: Compiling only libstdc++-v3 (with debugging symbols)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 19, 2011 at 5:50 AM, Delcypher <delcypher@xxxxxxxxx> wrote:
>
> 3. Now here's where I get confused the documentation says "When
> configuring libstdc++, you'll have to configure the entire gccsrcdir
> directory."
>
> Isn't that going to build everything though? I don't want to do that.
> Surely I want to run
>
> $ ../gcc-root/libstdc++-v3/configure --enable-libstdcxx-debug
> --prefix=$HOME/local
>
> and NOT (as the documentation suggests)
>
> $ ../gcc-root/configure --enable-languages=c++
> --enable-libstdcxx-debug --prefix=$HOME/local

It's hard to know what to say when you decide that the
documentation is wrong.  I understand what you are trying
to do, but it is not supported.


> and the build fails. The output is shown here http://pastebin.com/p4iD7h4i

The failure appears to be that you are compiling libstdc++ with a different
version of g++.  In general you must build libstdc++ with the version of
g++ that it is shipped with.  libstdc++ includes non-standard code which
is dependent on the specific version of the compiler.


> The reason I'm trying to do this is so I can build programs on my
> system and debug the standard library objects. For example when in gdb
> if I try to do the following
> gdb) call cout.good()
> Couldn't find method std::ostream:;good
>
> I presume this error message is because my version of libstdc++ has no
> debugging symbols.

The ordinary build of libstdc++ always builds with debugging symbols.  If you
do not have debugging symbols on your system, it is because the library
has been stripped for some reason.

> I did try compiling with `-D_GLIBCXX_DEBUG' and for
> someone reason that I can't explain that made some standard library
> objects I declared in the stack accessible via gdb (e.g. if I had an
> ifstream object called inputFile) despite the fact my version of
> libstdc++ has no debugging symbols at all!

Many functions in libstdc++ are inlined from header files, and as such are
affected by the use of -g when you compile, rather than whether -g was
used when libstdc++ itself was built.  Note that -D_GLIBCXX_DEBUG
does not affect whether debugging symbols are generated; it produces
a debugging version of the code which adds runtime checks to make
sure that functions are being used correctly.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux