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

When calling avr-g++, the linker driver adds a call to -lgcc before any
of the user libraries entered on the command-line.

On the AVR, this causes the wrong math function implementations taken from
libgcc.a rather than the (user-supplied) libm.a.

This is different from the C compiler driver, why?

Given (any) C++ file foo.cc, using avr-gcc:

% avr-gcc -v foo.cc
Using built-in specs.
Target: avr
Configured with: ./configure --prefix=/tools/i686 --target=avr --disable-libssp
--with-dwarf2
Thread model: single
gcc version 4.1.0
 /tools/i686/libexec/gcc/avr/4.1.0/cc1plus -quiet -v foo.cc -quiet -dumpbase
foo.cc -auxbase foo -version -fno-rtti -fno-enforce-eh-specs -fno-exceptions -o
/tmp/cc7jbBxg.s
ignoring nonexistent directory
"/tools/i686/lib/gcc/avr/4.1.0/../../../../include/c++/4.1.0"
ignoring nonexistent directory
"/tools/i686/lib/gcc/avr/4.1.0/../../../../include/c++/4.1.0/avr"
ignoring nonexistent directory
"/tools/i686/lib/gcc/avr/4.1.0/../../../../include/c++/4.1.0/backward"
ignoring nonexistent directory
"/tools/i686/lib/gcc/avr/4.1.0/../../../../avr/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 /tools/i686/lib/gcc/avr/4.1.0/include
 /tools/i686/lib/gcc/avr/4.1.0/../../../../avr/include
End of search list.
GNU C++ version 4.1.0 (avr)
        compiled by GNU C version 3.2.3 20030502 (Red Hat Linux 3.2.3-49).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: e56ae0f62a848350ccb9716b24fc3bd9
 /tools/i686/lib/gcc/avr/4.1.0/../../../../avr/bin/as -o /tmp/ccyX7jFq.o
/tmp/cc7jbBxg.s
 /tools/i686/lib/gcc/avr/4.1.0/../../../../avr/bin/ld -m avr2
/tools/i686/lib/gcc/avr/4.1.0/../../../../avr/lib/crts8515.o
-L/tools/i686/lib/gcc/avr/4.1.0
-L/tools/i686/lib/gcc/avr/4.1.0/../../../../avr/lib /tmp/ccyX7jFq.o -lgcc -lc
-lgcc

Using avr-g++ instead of avr-gcc:

% avr-g++ -v foo.cc
Using built-in specs.
Target: avr
Configured with: ./configure --prefix=/tools/i686 --target=avr --disable-libssp
--with-dwarf2
Thread model: single
gcc version 4.1.0
 /tools/i686/libexec/gcc/avr/4.1.0/cc1plus -quiet -v foo.cc -quiet -dumpbase
foo.cc -auxbase foo -version -fno-rtti -fno-enforce-eh-specs -fno-exceptions -o
/tmp/ccbXCZLa.s
ignoring nonexistent directory
"/tools/i686/lib/gcc/avr/4.1.0/../../../../include/c++/4.1.0"
ignoring nonexistent directory
"/tools/i686/lib/gcc/avr/4.1.0/../../../../include/c++/4.1.0/avr"
ignoring nonexistent directory
"/tools/i686/lib/gcc/avr/4.1.0/../../../../include/c++/4.1.0/backward"
ignoring nonexistent directory
"/tools/i686/lib/gcc/avr/4.1.0/../../../../avr/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 /tools/i686/lib/gcc/avr/4.1.0/include
 /tools/i686/lib/gcc/avr/4.1.0/../../../../avr/include
End of search list.
GNU C++ version 4.1.0 (avr)
        compiled by GNU C version 3.2.3 20030502 (Red Hat Linux 3.2.3-49).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: e56ae0f62a848350ccb9716b24fc3bd9
 /tools/i686/lib/gcc/avr/4.1.0/../../../../avr/bin/as -o /tmp/ccSHVtCa.o
/tmp/ccbXCZLa.s
 /tools/i686/lib/gcc/avr/4.1.0/../../../../avr/bin/ld -m avr2
/tools/i686/lib/gcc/avr/4.1.0/../../../../avr/lib/crts8515.o
-L/tools/i686/lib/gcc/avr/4.1.0
-L/tools/i686/lib/gcc/avr/4.1.0/../../../../avr/lib /tmp/ccSHVtCa.o -lgcc -lm
-lgcc -lc -lgcc


-- 
           Summary: Call to -lgcc added prior to user libraries
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: j at uriah dot heep dot sax dot de
  GCC host triplet: *-*-*
GCC target triplet: avr-*-*


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).