public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "j at uriah dot heep dot sax dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/28718]  New: Call to -lgcc added prior to user libraries
Date: Mon, 14 Aug 2006 12:13:00 -0000	[thread overview]
Message-ID: <bug-28718-11199@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2006-08-14 12:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-14 12:13 j at uriah dot heep dot sax dot de [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-28718-11199@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).