public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/52362] gnat.dg/lto8.adb FAILs with gas/gld
Date: Mon, 14 May 2012 11:24:00 -0000	[thread overview]
Message-ID: <bug-52362-4-xZCIsmXCzI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-52362-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-14 11:22:45 UTC ---
(In reply to comment #7)
> When there are many files to link, gnatlink passes a file containing the file
> names, instead of the file names directly, on the GCC link line.  There is a
> bad interaction with LTO:
> 
> eric@atlantis:~/build/gcc-4_7-branch/native32> cat t.c
> int main (void) { return 0; }
> eric@atlantis:~/build/gcc-4_7-branch/native32> gcc/xgcc -Bgcc -c t.c -flto
> eric@atlantis:~/build/gcc-4_7-branch/native32> cat FILE
> INPUT (./t.o)
> eric@atlantis:~/build/gcc-4_7-branch/native32> gcc/xgcc -Bgcc -o t FILE
> eric@atlantis:~/build/gcc-4_7-branch/native32> ./t
> eric@atlantis:~/build/gcc-4_7-branch/native32> gcc/xgcc -Bgcc -o t FILE -flto
> /tmp/ccTBohVP.ltrans0.ltrans.o: In function `main':
> ccTBohVP.ltrans0.o:(.text+0x0): multiple definition of `main'
> ./t.o:t.c:(.text+0x0): first defined here
> ./t.o: In function `main':
> t.c:(.text+0x0): multiple definition of `main'
> ./t.o:t.c:(.text+0x0): first defined here
> collect2: error: ld returned 1 exit status
> 
> We should probably use a regular response file instead:
> eric@atlantis:~/build/gcc-4_7-branch/native32> cat FILE2
> ./t.o
> eric@atlantis:~/build/gcc-4_7-branch/native32> gcc/xgcc -Bgcc -o t -Wl,@FILE2
> -flto
> eric@atlantis:~/build/gcc-4_7-branch/native32> ./t

Yes, we don't "understand" linker scripts.  The linker plugin would need to
handle feeding additional inputs towards the link stage - and we'd need to
drop the original FILE input from the final link (which is where the multiple
references come from).


  parent reply	other threads:[~2012-05-14 11:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 18:21 [Bug ada/52362] New: " ro at gcc dot gnu.org
2012-03-13 17:16 ` [Bug ada/52362] " vries at gcc dot gnu.org
2012-03-14 21:03 ` ebotcazou at gcc dot gnu.org
2012-03-14 21:06 ` vries at gcc dot gnu.org
2012-03-14 21:29 ` ebotcazou at gcc dot gnu.org
2012-03-14 21:30 ` vries at gcc dot gnu.org
2012-05-13  7:39 ` ebotcazou at gcc dot gnu.org
2012-05-14 11:18 ` ebotcazou at gcc dot gnu.org
2012-05-14 11:24 ` rguenth at gcc dot gnu.org [this message]
2012-05-25  9:44 ` ebotcazou at gcc dot gnu.org
2012-05-25 10:17 ` ebotcazou at gcc dot gnu.org
2012-05-25 10:34 ` ebotcazou at gcc dot gnu.org

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-52362-4-xZCIsmXCzI@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).