GCC 2.95.2 + C++ + -pg = ?

Mumit Khan khan@nanotech.wisc.edu
Tue Nov 30 23:39:00 GMT 1999


JSONCRAIG@aol.com writes:
> I just downloaded and unpacked the GCC-2.95.2 Mingw32-crtdll release.  I 
> tried to compile a simple program:
> 
> #include <iostream>
> using namespace std;
> int main()
> {
> cout << "Test" << endl; 
> return 0;
> }
> 
>     c++ -o test.exe test.cpp
> works like a charm.  But then, I decided to try out the profiling:
>     C++ -o test.exe -pg test.cpp
> during linking:
> 
> 
> linking:C:\GCC-29~1.2\BIN\..\lib\gcc-lib\i386-mingw32\2.95.2\libstdc++.a(io
> stream.o)(.text$__
> ls__7ostreamPFR7ostream_R7ostream+0x0): multiple definition of 
> `ostream::operator<<(ostream &(*)(ostream &))'
> 
> &))'C:\WINDOWS\TEMP\ccriT9fb.o(.text$__ls__7ostreamPFR7ostream_R7ostream+0x0
> ):test.cpp: first defined here
> 
> hereC:\GCC-29~1.2\BIN\..\lib\gcc-lib\i386-mingw32\2.95.2\libstdc++.a(iostrea
> m.o)(.text$__tf11_ios_fields+0x0): multiple definition of 
> `_ios_fields type_info function'
> C:\WINDOWS\TEMP\ccriT9fb.o(.text$__tf11_ios_fields+0x0):test.cpp: first 
> defined here
> 
> and so on and so forth.
> c++ -v = 
> Reading specs from C:\GCC-29~1.2\BIN\..\lib\gcc-lib\i386-mingw32\2.95.2\specs
> gcc version 2.95.2 19991024 (release)
> on Windows 95.
> 
> Am I using the option wrong or is there something wrong with profiling and 
> the C++ libs?
> 

It's a bona fide bug; I don't know where it is yet, but will look at it
at some point. Somehow profiling is playing havoc with LINKONCE (COMDAT)
sections, and you see these multiple definitions.

Thanks for the bug report.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list