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]
Other format: [Raw text]

Re: Resolution to PR 16715 causing linker errors?


On Tue, Sep 21, 2004 at 12:32:54AM +0100, Jonathan Wakely wrote:

> I am getting linker errors from basic_iostream, which seems to be caused
> by the resolution to PR 16715. I'm seeing this on the 3.4 branch on
> x86_64 FC1 Linux. I'm building from mainline for the first time in a
> while, will report if that fails too.

I'm still seeing this, with a clean 3.4 check out (not an update),
bootstrapped and installed in empty dirs, with this config:

Reading specs from /home/redi/gcc/3.4-test/lib/gcc/x86_64-unknown-linux-gnu/3.4.3/specs
Configured with: ../gcc-3.4/configure --prefix=/home/redi/gcc/3.4-test --enable-languages=c,c++ --with-system-zlib --enable-threads=posix --enable-__cxa_atexit
Thread model: posix
gcc version 3.4.3 20040924 (prerelease)

Same result with --enable-pch --enable-concept-checks --enable-libstdcxx-debug
all turned on (which was how I had configured originally, but removing
them makes no difference).

This is on x86_64/linux (an up to date FC1 x86_64 system) on the 3.4
branch and mainline too. I have a slightly tainted mainline tree so
can't claim to have done a completely clean build of that, but nothing
related to this is changed and I bootstrapped and installed in empty dirs.
Whether that matters or not, my 3.4 build was virginal AFAICT.

On both mainline and 3.4 reverting include/bits/istream.tcone version
then going back to the v3 build dir and doing "make clean install" fixes
it.  Reverting istream.tcc to the most recent version and "make clean
install" in v3 build dir brings the problem back.

Since no-one can reproduce this, I realise the onus is on me to show if
there's something wrong, but what should I try next?

binutils 2.14.90, glibc 2.3.2

jon


The rest of my original post follows:

> 2004-09-08  Benjamin Kosnik  <bkoz@redhat.com>
>             Simon Richter  <Simon.Richter@hogyros.de>
> 
>         PR libstdc++/16715
>         * include/bits/istream.tcc: Add extern template for iostream
>         char and wchar_t instantiations.
> 
> Reverting that change makes the errors go away.
> 
> Reduced testcase:
> 
>     #include <istream>
>     #include <ostream>
> 
>     template <typename C>
>     class Test : public std::basic_iostream<C>
>     {
>     public:
>         Test() : std::basic_iostream<C>(0) {}
>     };
> 
>     #include <iostream>
> 
>     int main()
>     {
>         Test<char> t;
>         std::cout << '\n';
>     }
> 
> this gives:
> 
> [redi@morion tests]$ g++34 pr16715.cc
> /tmp/ccHlzjH4.o(.gnu.linkonce.t._ZN4TestIcED1Ev+0x64): In function `Test<char>::~Test()':
> : undefined reference to `std::basic_iostream<char, std::char_traits<char> >::~basic_iostream()'
> /tmp/ccHlzjH4.o(.gnu.linkonce.t._ZN4TestIcEC1Ev+0x2d): In function `Test<char>::Test()':
> : undefined reference to `std::basic_iostream<char, std::char_traits<char> >::basic_iostream(std::basic_streambuf<char, std::char_traits<char> >*)'
> /tmp/ccHlzjH4.o(.gnu.linkonce.r._ZTC4TestIcE0_Sd+0x18): undefined reference to `std::basic_iostream<char, std::char_traits<char> >::~basic_iostream()'
> /tmp/ccHlzjH4.o(.gnu.linkonce.r._ZTC4TestIcE0_Sd+0x20): undefined reference to `std::basic_iostream<char, std::char_traits<char> >::~basic_iostream()'
> /tmp/ccHlzjH4.o(.gnu.linkonce.t._ZN4TestIcED0Ev+0x64): In function `Test<char>::~Test()':
> : undefined reference to `std::basic_iostream<char, std::char_traits<char> >::~basic_iostream()'
> collect2: ld returned 1 exit status


-- 
"The human race will begin solving its problems
 on the day it stops taking itself so seriously."
	- Principia Discordia


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