This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug libstdc++/16411] New: undefined reference to `__gnu_cxx::stdio_sync_filebuf<char, std::char_traits<char> >::file()'


The patch introduced to fix PR#14600 does not work on a Linux system when
compiling with -O0:

$ cat link.cc
#include <iostream>
#include <ext/stdio_sync_filebuf.h>
int main()
{
    int fd = -1;
    __gnu_cxx::stdio_sync_filebuf<char>* buf;
    if ( buf = dynamic_cast<__gnu_cxx::stdio_sync_filebuf<char>*>(
std::cin.rdbuf() ) ) {
        buf->file();
    }
}
$ /net/gcc/3.4.1/bin/g++ -O0 link.cc
/tmp/ccVJfRKL.o(.text+0x178): In function `main':
: undefined reference to `__gnu_cxx::stdio_sync_filebuf<char,
std::char_traits<char> >::file()'
collect2: ld returned 1 exit status

The original patch to PR#14600 at
<http://gcc.gnu.org/ml/libstdc++/2004-02/msg00379.html> had suggested two
differnet ways to deal with this kind of problem.  Unfortunately, they don't
seem to have been considered.

Indeed, adding the mangled names
    _ZN9__gnu_cxx18stdio_sync_filebufI[cw]St11char_traitsI[cw]EE4fileEv;
to ibstdc++-v3/config/linker-map.gnu solves this problem again.

This is also related to PR#14097 and PR#14098.

-- 
           Summary: undefined reference to
                    `__gnu_cxx::stdio_sync_filebuf<char,
                    std::char_traits<char> >::file()'
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Richard dot Kreckel at Framatome-ANP dot com
                CC: bkoz at gcc dot gnu dot org,gcc-bugs at gcc dot gnu dot
                    org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16411


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