Bug 16411 - undefined reference to `__gnu_cxx::stdio_sync_filebuf<char, std::char_traits<char> >::file()'
Summary: undefined reference to `__gnu_cxx::stdio_sync_filebuf<char, std::char_traits<...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.4.1
: P2 normal
Target Milestone: 3.4.2
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-07 16:45 UTC by Richard B. Kreckel
Modified: 2005-07-23 22:49 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard B. Kreckel 2004-07-07 16:45:56 UTC
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.
Comment 1 Benjamin Kosnik 2004-07-08 01:55:50 UTC
Easy enough to fix.

-benjamin
Comment 2 CVS Commits 2004-07-08 05:24:40 UTC
Subject: Bug 16411

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bkoz@gcc.gnu.org	2004-07-08 05:24:33

Modified files:
	libstdc++-v3   : ChangeLog configure configure.ac 
	libstdc++-v3/config: linker-map.gnu 
	libstdc++-v3/testsuite: testsuite_abi.cc 

Log message:
	2004-07-07  Benjamin Kosnik  <bkoz@redhat.com>
	
	* configure.ac (libtool_VERSION): To 6:2:0.
	* configure: Regenerated.
	
	* testsuite/testsuite_abi.cc (check_version): Add 3.4.2.
	
	2004-07-07  Aaron W. LaFramboise  <aaronraolete36@aaronwl.com>
	
	PR libstdc++/16411
	* config/linker-map.gnu: Add stdio_sync_filebuf::file exports.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2566&r2=1.2567
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.diff?cvsroot=gcc&r1=1.396&r2=1.397
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.ac.diff?cvsroot=gcc&r1=1.21&r2=1.22
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/linker-map.gnu.diff?cvsroot=gcc&r1=1.66&r2=1.67
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/testsuite_abi.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4

Comment 3 CVS Commits 2004-07-08 05:40:18 UTC
Subject: Bug 16411

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	bkoz@gcc.gnu.org	2004-07-08 05:40:06

Modified files:
	libstdc++-v3   : ChangeLog configure configure.ac 
	libstdc++-v3/config: linker-map.gnu 
	libstdc++-v3/testsuite: testsuite_abi.cc 

Log message:
	2004-07-07  Benjamin Kosnik  <bkoz@redhat.com>
	
	* configure.ac (libtool_VERSION): To 6:2:0.
	* configure: Regenerated.
	
	* testsuite/testsuite_abi.cc (check_version): Add 3.4.2.
	
	2004-07-07  Aaron W. LaFramboise  <aaronraolete36@aaronwl.com>
	
	PR libstdc++/16411
	* config/linker-map.gnu: Add stdio_sync_filebuf::file exports.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.139&r2=1.2224.2.140
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.373.4.15&r2=1.373.4.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.ac.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.14.4.2&r2=1.14.4.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/linker-map.gnu.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.52.4.7&r2=1.52.4.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/testsuite_abi.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2.2.3&r2=1.2.2.4

Comment 4 Andrew Pinski 2004-07-08 06:28:03 UTC
Fixed.