public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/28718] Call to -lgcc added prior to user libraries
       [not found] <bug-28718-4@http.gcc.gnu.org/bugzilla/>
@ 2011-11-21 16:46 ` gjl at gcc dot gnu.org
  2011-11-28 20:39 ` j at uriah dot heep.sax.de
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-11-21 16:46 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gjl at gcc dot gnu.org

--- Comment #10 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-11-21 16:20:39 UTC ---
Jörg, could you prepare a list of functions that shall be excluded from libgcc?
You can also answer to my mail "PR28718 Infos?" from 2011-11-10.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug driver/28718] Call to -lgcc added prior to user libraries
       [not found] <bug-28718-4@http.gcc.gnu.org/bugzilla/>
  2011-11-21 16:46 ` [Bug driver/28718] Call to -lgcc added prior to user libraries gjl at gcc dot gnu.org
@ 2011-11-28 20:39 ` j at uriah dot heep.sax.de
  2012-09-05 13:02 ` gjl at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: j at uriah dot heep.sax.de @ 2011-11-28 20:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Joerg Wunsch <j at uriah dot heep.sax.de> 2011-11-28 19:45:51 UTC ---
(In reply to comment #10)
> Jörg, could you prepare a list of functions that shall be excluded from libgcc?
> You can also answer to my mail "PR28718 Infos?" from 2011-11-10.

Well, perhaps.  However, the AVR-part is not the main subject of my
complaint here.  The subject of my complaint was/is that a call to
*any* library is added *prior* to the list of user-supplied libaries
(from -l options).  The point of -l options is to give the users an
override option, which is completely defeated by the current way
libstdc++ is handled.

The fact that the AVR (currently) lacks a libstdc++, and thus libgcc
is linked instead, caused this bug to be escalated due to the side
effects, but this is not the main point here.

This becomes even more puzzling now: apparently, this reordering of
the libraries *only* applies to -lm.  When specifying any other
library, the processing works as one would expect it to be.

The code for this is in gcc/cp/g++spec.c, around line 270:

      /* Make sure -lstdc++ is before the math library, since libstdc++
         itself uses those math routines.  */
      if (!saw_math && (args[i] & MATHLIB) && library > 0)
        {
          --j;
          saw_math = &decoded_options[i];
        }

OK, now the reason is clear.  However, this doesn't handle the case
very well where no libstdc++ is available at all: inserting libgcc in
place of libstdc++ is just a simple workaround, and apparently a too
simple one in our case.  A correct implementation would not try to add
anything at all when libstdc++ is unavailable (and thus have no need
to reorder).

I don't know how many targets are affected at all by the lack of
libstdc++.  If AVR is indeed the only target where this applies to,
then the way you outlined (a configurable list of functions to omit
from libgcc) might be the best compromise.

(Sorry it took me so long to reply, Johan, but I knew it would take me
some time to research all this again, and then create the reply.)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug driver/28718] Call to -lgcc added prior to user libraries
       [not found] <bug-28718-4@http.gcc.gnu.org/bugzilla/>
  2011-11-21 16:46 ` [Bug driver/28718] Call to -lgcc added prior to user libraries gjl at gcc dot gnu.org
  2011-11-28 20:39 ` j at uriah dot heep.sax.de
@ 2012-09-05 13:02 ` gjl at gcc dot gnu.org
  2012-09-05 15:08 ` j at uriah dot heep.sax.de
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-09-05 13:02 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #12 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-09-05 13:02:24 UTC ---
Not really a doublicate of PR54461, but the new configure option --with-avrlibc
introduced in 4.7.2 solves the issue by removing the doublicate functions from
libgcc so that the optimized versions from AVR-Libc will be used no matter how
the -l order is.

*** This bug has been marked as a duplicate of bug 54461 ***


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug driver/28718] Call to -lgcc added prior to user libraries
       [not found] <bug-28718-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2012-09-05 13:02 ` gjl at gcc dot gnu.org
@ 2012-09-05 15:08 ` j at uriah dot heep.sax.de
  2012-09-05 21:35 ` gjl at gcc dot gnu.org
  2014-02-16 13:12 ` jackie.rosen at hushmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: j at uriah dot heep.sax.de @ 2012-09-05 15:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Joerg Wunsch <j at uriah dot heep.sax.de> 2012-09-05 15:08:27 UTC ---
All this is fighting the symptoms though.

My point (as outlined in comment #8:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28718#c8 )
is:

When operating as a C compiler, *all* user-supplied libraries are passed
to the linker *first*, followed by system libraries.

When operating as a C++ compiler, libstdc++ and libm.a are passed *before*
any user-supplied library.  This leaves the users in a situation where
they are no longer able to supply own overrides for some functions in
system libraries.  Again, all this is in contrast to how the C compiler
works.

In the AVR case, the situation is only worse since there's no libstdc++
(yet), and somehow, libgcc is substituted in place of libstdc++ (which I
think is a completely flawed idea from the beginning).

So despite all the artefacts which leaded to this bug report, I think at
least the last point mentioned is worth fixing: if there's no libstdc++,
there's no point in trying to pretend libgcc could be supplied as a
replacement for libstdc++.  (The AVR-related artefacts are now mostly
fixed after Johann's recent work, the original bug(s) remain(s).)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug driver/28718] Call to -lgcc added prior to user libraries
       [not found] <bug-28718-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2012-09-05 15:08 ` j at uriah dot heep.sax.de
@ 2012-09-05 21:35 ` gjl at gcc dot gnu.org
  2014-02-16 13:12 ` jackie.rosen at hushmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-09-05 21:35 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |NEW
   Last reconfirmed|                            |2012-09-05
                 CC|                            |gdr at gcc dot gnu.org
         Resolution|DUPLICATE                   |
     Ever Confirmed|0                           |1

--- Comment #14 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-09-05 21:35:00 UTC ---
CCing Gaby.  He is the only one I know of who is committed to C++ and avr.

(In reply to comment #13)
> All this is fighting the symptoms though.
> 
> My point (as outlined in comment #8) is:
> 
> When operating as a C compiler, *all* user-supplied libraries are passed
> to the linker *first*, followed by system libraries.
> 
> When operating as a C++ compiler, libstdc++ and libm.a are passed *before*
> any user-supplied library.  This leaves the users in a situation where
> they are no longer able to supply own overrides for some functions in
> system libraries.  Again, all this is in contrast to how the C compiler
> works.
> 
> In the AVR case, the situation is only worse since there's no libstdc++
> (yet), and somehow, libgcc is substituted in place of libstdc++ (which I
> think is a completely flawed idea from the beginning).
> 
> So despite all the artefacts which leaded to this bug report, I think at
> least the last point mentioned is worth fixing: if there's no libstdc++,
> there's no point in trying to pretend libgcc could be supplied as a
> replacement for libstdc++.  (The AVR-related artefacts are now mostly
> fixed after Johann's recent work, the original bug(s) remain(s).)

Ok, I untied the two PRs again and set this one to NEW.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug driver/28718] Call to -lgcc added prior to user libraries
       [not found] <bug-28718-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2012-09-05 21:35 ` gjl at gcc dot gnu.org
@ 2014-02-16 13:12 ` jackie.rosen at hushmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: jackie.rosen at hushmail dot com @ 2014-02-16 13:12 UTC (permalink / raw)
  To: gcc-bugs

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

Jackie Rosen <jackie.rosen at hushmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jackie.rosen at hushmail dot com

--- Comment #15 from Jackie Rosen <jackie.rosen at hushmail dot com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug driver/28718] Call to -lgcc added prior to user libraries
  2006-08-14 12:13 [Bug c++/28718] New: " j at uriah dot heep dot sax dot de
@ 2009-08-19 15:32 ` abnikant dot singh at atmel dot com
  0 siblings, 0 replies; 7+ messages in thread
From: abnikant dot singh at atmel dot com @ 2009-08-19 15:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from abnikant dot singh at atmel dot com  2009-08-19 15:32 -------
This is because libstdc++ is not build in case of avr(8 bit),I did check it in
avr32 there I get flags in the sequence : -lstdc++ -lm -lgcc


-- 

abnikant dot singh at atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |abnikant dot singh at atmel
                   |                            |dot com


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-02-16 13:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-28718-4@http.gcc.gnu.org/bugzilla/>
2011-11-21 16:46 ` [Bug driver/28718] Call to -lgcc added prior to user libraries gjl at gcc dot gnu.org
2011-11-28 20:39 ` j at uriah dot heep.sax.de
2012-09-05 13:02 ` gjl at gcc dot gnu.org
2012-09-05 15:08 ` j at uriah dot heep.sax.de
2012-09-05 21:35 ` gjl at gcc dot gnu.org
2014-02-16 13:12 ` jackie.rosen at hushmail dot com
2006-08-14 12:13 [Bug c++/28718] New: " j at uriah dot heep dot sax dot de
2009-08-19 15:32 ` [Bug driver/28718] " abnikant dot singh at atmel dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).