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

--- Comment #12 from christophe.lyon at st dot com 2010-11-22 10:06:07 UTC ---
Yes, I appreciate your help very much (and I spent quite some time
investigating on my own before deciding to bother you).

Now, I am sorry to insist, but it's still unclear to me why GCC and G++ behave
differently, and why there is a link script rather than a fix in the driver.

I have compile & link the code attached as atomic.cxx in C mode, I can see some
differences wrt the case where I do the same thing with G++ (invoking with -v):
- g++ has -shared-libgcc in COLLECT_GCC_OPTIONS
- g++ links with lstdc++ -lm -lgcc_s -lc -lgcc_s
- gcc links with -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed
-lgcc_s --no-as-needed


So, the very same code, when compiled & linked in C mode, is linked against
-lgcc, but not in C++ mode; that's why I proposed a changed in the driver (to
adjust the specs for -shared-libgcc)

Reply via email to