This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3]libstdc++/13631
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: François Dumont <francois dot cppdevs at free dot fr>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Mon, 13 Dec 2010 23:11:31 +0100
- Subject: Re: [v3]libstdc++/13631
- References: <4D069122.8040305@free.fr>
Hi,
>
> I have started working on 13631. I finally didn't use code posted
> on bugzilla, it is a patch for some rather old code.
Thanks for working on this old issue. Please always remember however,
that we can't break the ABI at the moment, thus we can't add data
members to classes, change the layout, etc, etc. I'm also a bit worried
by possible dynamic_cast tricks.
> For the moment I have attached what I have done and here under is one
> of the errors that appear as soon as I introduce the map.
>
> /home/fdt/dev/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so:
> undefined reference to `std::_Rb_tree<int, std::pair<int const,
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >
> >, std::_Select1st<std::pair<int const, std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > > >, std::less<int>,
> std::allocator<std::pair<int const, std::basic_string<char, std::char
> _traits<char>, std::allocator<char> > > >
> >::_M_insert_unique(std::pair<int const, std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > > const&)'
> collect2: ld returned 1 exit status
> compiler exited with status 1
>
> It looks for some missing symbols. What should I do ? Export the
> necessary std::map instanciation from the lib ? Avoid usage of
> std::map and use some hand written data structure ?
The issue is that the entire *.so is built with no implicit templates,
thus the error, because during the build the implicit instantiation of a
template (required elsewhere in the *.so) is suppressed. In general, we
have explicit instantiation *.cc files in /src for that reason. Anyway,
I'm indeed quite dubious that the way to go is using <map> as an
implementation detail, it would be the first time we do something
similar. But if we can find a way to have such uses in a *.cc file, and
then export from the *.so only functions using it behind the scenes, it
would still make sense...
Paolo.
Paolo.