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
  2006-08-14 13:18 ` [Bug c++/28718] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ 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] 10+ messages in thread

end of thread, other threads:[~2009-08-19 15:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-14 12:13 [Bug c++/28718] New: Call to -lgcc added prior to user libraries j at uriah dot heep dot sax dot de
2006-08-14 13:18 ` [Bug c++/28718] " pinskia at gcc dot gnu dot org
2006-08-14 14:13 ` j at uriah dot heep dot sax dot de
2006-08-14 14:15 ` pinskia at gcc dot gnu dot org
2006-08-14 14:28 ` j at uriah dot heep dot sax dot de
2006-08-15 18:24 ` pinskia at gcc dot gnu dot org
2006-09-06 16:51 ` bjoern dot m dot haase at web dot de
2006-09-12  8:06 ` pinskia at gcc dot gnu dot org
2006-09-12  8:52 ` 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).