From: "H.J. Lu" <hjl.tools@gmail.com>
To: Ian Lance Taylor <iant@google.com>
Cc: Cary Coutant <ccoutant@google.com>,
GCC Development <gcc@gcc.gnu.org>,
Binutils <binutils@sourceware.org>
Subject: Re: Update LTO plugin interface
Date: Thu, 02 Dec 2010 17:24:00 -0000 [thread overview]
Message-ID: <AANLkTimEGC24UnBFu0FHg8p9SGbhzKsJx0VtirALngGY@mail.gmail.com> (raw)
In-Reply-To: <mcraakoay6f.fsf@google.com>
On Thu, Dec 2, 2010 at 9:20 AM, Ian Lance Taylor <iant@google.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> On Thu, Dec 2, 2010 at 9:00 AM, Ian Lance Taylor <iant@google.com> wrote:
>>> "H.J. Lu" <hjl.tools@gmail.com> writes:
>>>
>>>> I am not saying we should go with 2 stage linking. Just for clarification.
>>>> In 2 stage linking, the first stage only does symbol resolution. The complete
>>>> linking starts at the second stage. So we don't do really complete relink
>>>> in 2 stage linking.
>>>
>>> Understood. But you still read and process all the symbols twice. It
>>> can be done if it must be done, but it would be significantly better to
>>> do something else if possible.
>>>
>>
>> Without 2 stage linking, which many compilers do for LTO, we will add hack
>> on top of hack. As Richard pointed out, we need at least
>>
>> -lc -lgcc -lm -lpthreads -lgcov and maybe libssp, libgomp, ...
>>
>> -lm is currently added by user, not GCC driver
>>
>> Pass-through is just a hack, not a solution.
>
> But I just suggested a different approach, which as far as I can see
> solves the entire problem. Why not criticize that approach, rather than
> continusing to discuss -pass-through, which we agree is a hack?
How do you deal with -lm:
[hjl@gnu-6 pr12245-6]$ cat y.c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int
main (int argc, char **argv)
{
int d = atoi (argv[1]);
printf ("%f\n", sin (d));
return 0;
}
[hjl@gnu-6 pr12245-6]$ make
/usr/gcc-4.6/bin/gcc -O2 -fwhole-program -flto=jobserver -fuse-linker-plugin
-c -o y.o y.c
/usr/gcc-4.6/bin/gcc -static -o foo -O2 -fwhole-program -flto=jobserver
-fuse-linker-plugin y.o -lm
/tmp/ccrHdm25.ltrans0.ltrans.o: In function `main':
ccrHdm25.ltrans0.o:(.text.startup+0x19): undefined reference to `sin'
collect2: ld returned 1 exit status
make: *** [foo] Error 1
[hjl@gnu-6 pr12245-6]$
--
H.J.
next prev parent reply other threads:[~2010-12-02 17:24 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-01 18:19 H.J. Lu
2010-12-01 18:29 ` Basile Starynkevitch
2010-12-01 18:31 ` H.J. Lu
2010-12-01 18:54 ` Ian Lance Taylor
2010-12-01 18:58 ` H.J. Lu
2010-12-01 19:03 ` Jan Hubicka
2010-12-01 19:08 ` H.J. Lu
2010-12-01 22:45 ` Cary Coutant
2010-12-02 0:42 ` Jan Hubicka
2010-12-02 0:57 ` Cary Coutant
2010-12-02 1:07 ` Jan Hubicka
2010-12-01 19:13 ` Ian Lance Taylor
2010-12-01 19:30 ` H.J. Lu
2010-12-01 20:37 ` Ian Lance Taylor
2010-12-01 20:43 ` H.J. Lu
2010-12-01 20:55 ` Ian Lance Taylor
2010-12-01 21:08 ` H.J. Lu
2010-12-01 21:28 ` Ian Lance Taylor
2010-12-01 21:33 ` Richard Guenther
2010-12-01 21:52 ` H.J. Lu
2010-12-01 21:52 ` H.J. Lu
2010-12-01 22:44 ` Ian Lance Taylor
2010-12-01 23:06 ` Cary Coutant
2010-12-01 23:54 ` H.J. Lu
2010-12-02 0:12 ` Cary Coutant
2010-12-02 4:52 ` Dave Korn
2010-12-02 0:49 ` Ian Lance Taylor
2010-12-02 1:41 ` H.J. Lu
2010-12-02 1:53 ` Ian Lance Taylor
2010-12-02 1:59 ` H.J. Lu
2010-12-02 14:52 ` Ian Lance Taylor
2010-12-02 14:59 ` H.J. Lu
2010-12-02 17:00 ` Ian Lance Taylor
2010-12-02 17:13 ` H.J. Lu
2010-12-02 17:21 ` Ian Lance Taylor
2010-12-02 17:24 ` H.J. Lu [this message]
2010-12-02 17:41 ` Ian Lance Taylor
2010-12-02 17:46 ` H.J. Lu
2010-12-02 18:37 ` Ian Lance Taylor
2010-12-02 18:45 ` H.J. Lu
2010-12-02 19:38 ` Ian Lance Taylor
2010-12-02 19:44 ` H.J. Lu
2010-12-02 19:53 ` Ian Lance Taylor
2010-12-02 19:59 ` H.J. Lu
2010-12-02 20:10 ` Ian Lance Taylor
2010-12-02 20:17 ` H.J. Lu
2010-12-02 20:22 ` Dave Korn
2010-12-02 20:47 ` Ian Lance Taylor
2010-12-02 21:03 ` Cary Coutant
2010-12-02 21:05 ` H.J. Lu
2010-12-02 21:10 ` Cary Coutant
2010-12-02 21:28 ` Ian Lance Taylor
2010-12-02 21:28 ` H.J. Lu
2010-12-02 21:43 ` H.J. Lu
2010-12-02 23:06 ` H.J. Lu
2010-12-02 23:29 ` Cary Coutant
2010-12-02 23:50 ` Dave Korn
2010-12-02 23:56 ` Cary Coutant
2010-12-02 23:55 ` Ian Lance Taylor
2010-12-03 0:05 ` Cary Coutant
2010-12-03 0:10 ` H.J. Lu
2010-12-03 1:39 ` Ian Lance Taylor
2010-12-03 1:51 ` H.J. Lu
2010-12-03 19:11 ` Cary Coutant
2010-12-03 19:17 ` H.J. Lu
2010-12-04 0:50 ` H.J. Lu
2010-12-04 1:24 ` H.J. Lu
2010-12-04 1:59 ` Dave Korn
2010-12-04 2:15 ` Ian Lance Taylor
2010-12-04 6:15 ` H.J. Lu
2010-12-04 2:34 ` H.J. Lu
2010-12-04 4:05 ` H.J. Lu
2010-12-03 1:58 ` Cary Coutant
2010-12-03 2:06 ` Ian Lance Taylor
2010-12-03 18:47 ` Cary Coutant
2010-12-02 4:04 ` Dave Korn
2010-12-02 4:13 ` Dave Korn
2010-12-02 9:26 ` Richard Guenther
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=AANLkTimEGC24UnBFu0FHg8p9SGbhzKsJx0VtirALngGY@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=binutils@sourceware.org \
--cc=ccoutant@google.com \
--cc=gcc@gcc.gnu.org \
--cc=iant@google.com \
/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).