[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#94955: Linking with libstdc++ changes behavior of a program (which does not require libstdc++)



On Mon, Apr 23, 2001 at 09:37:09AM -0700, Philippe Troin wrote:
> Ben Collins <bcollins@debian.org> writes:
> 
> > On Sun, Apr 22, 2001 at 11:31:18PM -0700, Philippe Troin wrote:
> > > phil@resume:~% gcc -o foo foo.cpp -lstdc++
> > 
> > IMO, you should use:
> > 
> > % g++ foo foo.cpp
> 
> This brings the same result as 'gcc -o foo foo.cpp -lstdc++': crash.
> 
> > ...instead. There are a lot more things going on when using g++ other
> > than adding -lstdc++. 
> 
> According to 'gcc -v' the only difference between `g++ -o foo foo.cpp'
> and `gcc -o foo foo.cpp' is the two extra libraries `-lstdc++ -lm' at
> link time...
> 
> > If this works for you, then I suggest closing the bug.
> 
> If it were that easy...
> 
> As mentionned in the initial bug report, I found this with a much
> bigger program that was crashing when throwing complex (instances of
> derived classes) exceptions... This program was initially compiled and
> linked with g++. This program does not need libstdc++. When I tried to
> link it without (with gcc), it started working.
> 
> Just adding '-lstdc++' makes exceptions handling buggy... The crash
> happens during the throw()... I'm quite puzzled...

Interesting. It works perfectly fine for me under sparc (even with your
command line). Of course, I am using a gcc-3.0 snapshot more recent than
that in the archive. I'll be uploading a new snapshot within a day or
two, so please give that a try.

-- 
 -----------=======-=-======-=========-----------=====------------=-=------
/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'



Reply to: