First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 15074
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Benjamin Kosnik <bkoz@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: James A. Morrison <phython@gcc.gnu.org>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
sizeof.cc A c program that shouldn't use anything from libstdc++ text/plain 2004-04-22 16:30 202 bytes Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 15074 depends on: Show dependency tree
Show dependency graph
Bug 15074 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2004-04-22 16:19 Opened: 2004-04-22 16:06
The FAQ says that using g++ and -lsupc++ together will link against libsupc++
instead of libstdc++.  This doesn't work on GNU/Linux:
                                                                                
jim@squirrel:~/test $ g++ -o sizeof sizeof.cc -lsupc++
jim@squirrel:~/test $ ldd sizeof
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x7002c000)
        libm.so.6 => /lib/libm.so.6 (0x700f0000)
        libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0x70184000)
        libc.so.6 => /lib/libc.so.6 (0x701a0000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x70000000)
jim@squirrel:~/test $ gcc -o sizeof sizeof.cc -lsupc++
jim@squirrel:~/test $ ldd sizeof
        libc.so.6 => /lib/libc.so.6 (0x7002c000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x70000000)

------- Comment #1 From Andrew Pinski 2004-04-22 16:17 -------
What FAQ, I do not see any mention of this in <http://gcc.gnu.org/faq.html> or
<http://gcc.gnu.org/
onlinedocs/libstdc++/faq/index.html>?

------- Comment #2 From Andrew Pinski 2004-04-22 16:19 -------
If the only functions from libstdc++.a which you need are language  support
functions (those listed in  
clause 18 of the standard,  e.g., new and delete), then try linking  against
libsupc++.a (usually 
specifying  -lsupc++ when calling g++ for the final link step will  do it).
This library contains only 
those support routines, one per  object file. But if you are using anything
from the rest of the  library, 
such as IOStreams or vectors, then you'll still need  pieces from libstdc++.a.

It does say to use g++ though :(  This should change.

------- Comment #3 From James A. Morrison 2004-04-22 16:30 -------
Created an attachment (id=6137) [edit]
A c program that shouldn't use anything from libstdc++

 For completeness this is the program I tried with g++ and g++ -lsupc++

------- Comment #4 From Benjamin Kosnik 2004-05-13 04:39 -------
Indeed, what FAQ? 

You need to be using gcc, not g++ to do this kind of thing. ie:

gcc -o sizeof sizeof.cc -lsupc++

-benjamin

------- Comment #5 From James A. Morrison 2004-05-13 05:32 -------
 Sorry, the libstdc++ FAQ:
http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#2_5

------- Comment #6 From CVS Commits 2004-05-13 15:14 -------
Subject: Bug 15074

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bkoz@gcc.gnu.org	2004-05-13 15:14:08

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/docs/html/faq: index.html 

Log message:
	2004-05-13  Benjamin Kosnik  <bkoz@redhat.com>
	
	PR libstdc++/15074
	* docs/html/faq/index.html: Update docs for libsupc++ usage.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2470&r2=1.2471
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/docs/html/faq/index.html.diff?cvsroot=gcc&r1=1.64&r2=1.65


------- Comment #7 From Benjamin Kosnik 2004-05-13 15:16 -------
This is a documentation error, now fixed.

------- Comment #8 From CVS Commits 2004-05-13 15:27 -------
Subject: Bug 15074

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	bkoz@gcc.gnu.org	2004-05-13 15:27:42

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/docs/html/faq: index.html 

Log message:
	2004-05-13  Benjamin Kosnik  <bkoz@redhat.com>
	
	PR libstdc++/15074
	* docs/html/faq/index.html: Update docs for libsupc++ usage.

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.98&r2=1.2224.2.99
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/docs/html/faq/index.html.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.63.4.1&r2=1.63.4.2


------- Comment #9 From Andrew Pinski 2004-05-14 12:26 -------
Fixed for 3.4.1.

First Last Prev Next    No search results available      Search page      Enter new bug