public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* AVR gives weird error with LTO
@ 2009-12-30 15:58 Andrew Hutchinson
  2009-12-30 16:31 ` Dave Korn
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Hutchinson @ 2009-12-30 15:58 UTC (permalink / raw)
  To: GCC Development

When AVR target is built, without explicitly disabling LTO, it will produce 1000's of testsuite failures of -LTO -WHOPR tests with this compilation error:

"ld: -f may not be used without -shared"

Any idea what is wrong or how to make LTO work correctly here?

Andy


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: AVR gives weird error with LTO
  2009-12-30 15:58 AVR gives weird error with LTO Andrew Hutchinson
@ 2009-12-30 16:31 ` Dave Korn
  2009-12-30 20:21   ` Andrew Hutchinson
  0 siblings, 1 reply; 11+ messages in thread
From: Dave Korn @ 2009-12-30 16:31 UTC (permalink / raw)
  To: Andrew Hutchinson; +Cc: GCC Development

Andrew Hutchinson wrote:
> When AVR target is built, without explicitly disabling LTO, it will
> produce 1000's of testsuite failures of -LTO -WHOPR tests with this
> compilation error:
> 
> "ld: -f may not be used without -shared"
> 
> Any idea what is wrong or how to make LTO work correctly here?

  The standard way to be proceed would be: add -v to the command-line in the
PR; find out what is actually getting passed to ld; figure out what kind of
specs-processing accident (most likely) is causing ld to receive a -f option.

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: AVR gives weird error with LTO
  2009-12-30 16:31 ` Dave Korn
@ 2009-12-30 20:21   ` Andrew Hutchinson
  2009-12-30 21:58     ` Dave Korn
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Hutchinson @ 2009-12-30 20:21 UTC (permalink / raw)
  To: Dave Korn; +Cc: GCC Development

I used "v" and progressed a little

The problem seems to be that linker is called with -fwhopr or -flto as 
command line option.

ld -fwhopr .....

Linker find  '-f' and complains.

I assume this is not a valid option for ld?  Or is my linker wrong 
version or something?

Note this is cross compile toolchain.

Andy



Dave Korn wrote:
> Andrew Hutchinson wrote:
>   
>> When AVR target is built, without explicitly disabling LTO, it will
>> produce 1000's of testsuite failures of -LTO -WHOPR tests with this
>> compilation error:
>>
>> "ld: -f may not be used without -shared"
>>
>> Any idea what is wrong or how to make LTO work correctly here?
>>     
>
>   The standard way to be proceed would be: add -v to the command-line in the
> PR; find out what is actually getting passed to ld; figure out what kind of
> specs-processing accident (most likely) is causing ld to receive a -f option.
>
>     cheers,
>       DaveK
>
>   

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: AVR gives weird error with LTO
  2009-12-30 20:21   ` Andrew Hutchinson
@ 2009-12-30 21:58     ` Dave Korn
  2009-12-30 22:35       ` Rafael Espindola
  0 siblings, 1 reply; 11+ messages in thread
From: Dave Korn @ 2009-12-30 21:58 UTC (permalink / raw)
  To: Andrew Hutchinson; +Cc: Dave Korn, GCC Development

Andrew Hutchinson wrote:
> I used "v" and progressed a little
> 
> The problem seems to be that linker is called with -fwhopr or -flto as
> command line option.
> 
> ld -fwhopr .....
> 
> Linker find  '-f' and complains.
> 
> I assume this is not a valid option for ld?  Or is my linker wrong
> version or something?


  It's not a valid option for ld.  It *is* a valid option for the collect2
driver/wrapper executable that gcc uses to invoke ld, which suggests to me
that the AVR port must be configured not to build collect2, but that it is
going to need to do so if it wants to use LTO/WHOPR.  See use_collect2 in
gcc/config.gcc

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: AVR gives weird error with LTO
  2009-12-30 21:58     ` Dave Korn
@ 2009-12-30 22:35       ` Rafael Espindola
  2009-12-30 22:39         ` Dave Korn
  0 siblings, 1 reply; 11+ messages in thread
From: Rafael Espindola @ 2009-12-30 22:35 UTC (permalink / raw)
  To: Dave Korn; +Cc: Andrew Hutchinson, GCC Development

>  It's not a valid option for ld.  It *is* a valid option for the collect2
> driver/wrapper executable that gcc uses to invoke ld, which suggests to me
> that the AVR port must be configured not to build collect2, but that it is
> going to need to do so if it wants to use LTO/WHOPR.  See use_collect2 in
> gcc/config.gcc

Or you could port gold to AVR and use the plugin :-)

>    cheers,
>      DaveK
>

Cheers,
-- 
Rafael Ávila de Espíndola

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: AVR gives weird error with LTO
  2009-12-30 22:35       ` Rafael Espindola
@ 2009-12-30 22:39         ` Dave Korn
  2009-12-30 23:04           ` Andrew Hutchinson
  0 siblings, 1 reply; 11+ messages in thread
From: Dave Korn @ 2009-12-30 22:39 UTC (permalink / raw)
  To: Rafael Espindola; +Cc: Dave Korn, Andrew Hutchinson, GCC Development

Rafael Espindola wrote:
>>  It's not a valid option for ld.  It *is* a valid option for the collect2
>> driver/wrapper executable that gcc uses to invoke ld, which suggests to me
>> that the AVR port must be configured not to build collect2, but that it is
>> going to need to do so if it wants to use LTO/WHOPR.  See use_collect2 in
>> gcc/config.gcc
> 
> Or you could port gold to AVR and use the plugin :-)

  I hadn't checked, but yeah, since AVR is an ELF platform, that's a nice
solution too.  There might still be reason to build a collect2, for interop
with older binutils.

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: AVR gives weird error with LTO
  2009-12-30 22:39         ` Dave Korn
@ 2009-12-30 23:04           ` Andrew Hutchinson
  2009-12-30 23:23             ` Richard Guenther
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Hutchinson @ 2009-12-30 23:04 UTC (permalink / raw)
  To: Dave Korn; +Cc: Rafael Espindola, GCC Development, Weddington, Eric


Dave Korn wrote:
> Rafael Espindola wrote:
>   
>>>  It's not a valid option for ld.  It *is* a valid option for the collect2
>>> driver/wrapper executable that gcc uses to invoke ld, which suggests to me
>>> that the AVR port must be configured not to build collect2, but that it is
>>> going to need to do so if it wants to use LTO/WHOPR.  See use_collect2 in
>>> gcc/config.gcc
>>>       
>> Or you could port gold to AVR and use the plugin :-)
>>     
>
>   I hadn't checked, but yeah, since AVR is an ELF platform, that's a nice
> solution too.  There might still be reason to build a collect2, for interop
> with older binutils.
>
>     cheers,
>       DaveK
>
>
>   
Thank you David and Rafel

I will dig further into collect2.  I had noted that avr.h has the following:


/* This is undefined macro for collect2 disabling */
#define LINKER_NAME "ld"


Also, the MINGW host is the most significant for the AVR target - and 
problems with collect2 may be related to maintaining compatibility to that.

Andy

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: AVR gives weird error with LTO
  2009-12-30 23:04           ` Andrew Hutchinson
@ 2009-12-30 23:23             ` Richard Guenther
  2009-12-30 23:34               ` Andrew Hutchinson
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Guenther @ 2009-12-30 23:23 UTC (permalink / raw)
  To: Andrew Hutchinson
  Cc: Dave Korn, Rafael Espindola, GCC Development, Weddington, Eric

On Thu, Dec 31, 2009 at 12:04 AM, Andrew Hutchinson
<andrewhutchinson@cox.net> wrote:
>
> Dave Korn wrote:
>>
>> Rafael Espindola wrote:
>>
>>>>
>>>>  It's not a valid option for ld.  It *is* a valid option for the
>>>> collect2
>>>> driver/wrapper executable that gcc uses to invoke ld, which suggests to
>>>> me
>>>> that the AVR port must be configured not to build collect2, but that it
>>>> is
>>>> going to need to do so if it wants to use LTO/WHOPR.  See use_collect2
>>>> in
>>>> gcc/config.gcc
>>>>
>>>
>>> Or you could port gold to AVR and use the plugin :-)
>>>
>>
>>  I hadn't checked, but yeah, since AVR is an ELF platform, that's a nice
>> solution too.  There might still be reason to build a collect2, for
>> interop
>> with older binutils.
>>
>>    cheers,
>>      DaveK
>>
>>
>>
>
> Thank you David and Rafel
>
> I will dig further into collect2.  I had noted that avr.h has the following:
>
>
> /* This is undefined macro for collect2 disabling */
> #define LINKER_NAME "ld"

That's indeed going to break LTO.

Richard.

> Also, the MINGW host is the most significant for the AVR target - and
> problems with collect2 may be related to maintaining compatibility to that.
>
> Andy
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: AVR gives weird error with LTO
  2009-12-30 23:23             ` Richard Guenther
@ 2009-12-30 23:34               ` Andrew Hutchinson
  2009-12-31  3:37                 ` Weddington, Eric
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Hutchinson @ 2009-12-30 23:34 UTC (permalink / raw)
  To: Richard Guenther
  Cc: Dave Korn, Rafael Espindola, GCC Development, Weddington, Eric,
	Denis Chertykov


>> Thank you David and Rafel
>>
>> I will dig further into collect2.  I had noted that avr.h has the following:
>>
>>
>> /* This is undefined macro for collect2 disabling */
>> #define LINKER_NAME "ld"
>>     
>
> That's indeed going to break LTO.
>
> Richard.
>
>   
That seems to be the key issue.
Without #define LINKER_NAME, AVR is running LTO/WHOPR tests ok ! (No 
idea if it does anything useful though)

Now to figure out why it was added in 2000 (rth). Hopefully Eric 
Weddington or Denis might have some idea and perhaps know if it still 
has a purpose.

Andy




^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: AVR gives weird error with LTO
  2009-12-30 23:34               ` Andrew Hutchinson
@ 2009-12-31  3:37                 ` Weddington, Eric
  2010-01-09 10:25                   ` Denis Chertykov
  0 siblings, 1 reply; 11+ messages in thread
From: Weddington, Eric @ 2009-12-31  3:37 UTC (permalink / raw)
  To: Andrew Hutchinson, Richard Guenther
  Cc: Dave Korn, Rafael Espindola, GCC Development, Denis Chertykov,
	Marek Michalkiewicz

 

> -----Original Message-----
> From: Andrew Hutchinson [mailto:andrewhutchinson@cox.net] 
> Sent: Wednesday, December 30, 2009 4:34 PM
> To: Richard Guenther
> Cc: Dave Korn; Rafael Espindola; GCC Development; Weddington, 
> Eric; Denis Chertykov
> Subject: Re: AVR gives weird error with LTO
> 
> 
> >> Thank you David and Rafel
> >>
> >> I will dig further into collect2.  I had noted that avr.h 
> has the following:
> >>
> >>
> >> /* This is undefined macro for collect2 disabling */
> >> #define LINKER_NAME "ld"
> >>     
> >
> > That's indeed going to break LTO.
> >
> > Richard.
> >
> >   
> That seems to be the key issue.
> Without #define LINKER_NAME, AVR is running LTO/WHOPR tests ok ! (No 
> idea if it does anything useful though)
> 
> Now to figure out why it was added in 2000 (rth). Hopefully Eric 
> Weddington or Denis might have some idea and perhaps know if it still 
> has a purpose.

That was before my time. I didn't get involved (peripherally) until 2002. So it's either Denis Chertykov or Marek Michalkiewicz (CCed).

Eric Weddington

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: AVR gives weird error with LTO
  2009-12-31  3:37                 ` Weddington, Eric
@ 2010-01-09 10:25                   ` Denis Chertykov
  0 siblings, 0 replies; 11+ messages in thread
From: Denis Chertykov @ 2010-01-09 10:25 UTC (permalink / raw)
  To: Weddington, Eric
  Cc: Andrew Hutchinson, Richard Guenther, Dave Korn, Rafael Espindola,
	GCC Development, Marek Michalkiewicz

2009/12/31 Weddington, Eric <Eric.Weddington@atmel.com>:
>
>
>> -----Original Message-----
>> From: Andrew Hutchinson [mailto:andrewhutchinson@cox.net]
>> Sent: Wednesday, December 30, 2009 4:34 PM
>> To: Richard Guenther
>> Cc: Dave Korn; Rafael Espindola; GCC Development; Weddington,
>> Eric; Denis Chertykov
>> Subject: Re: AVR gives weird error with LTO
>>
>>
>> >> Thank you David and Rafel
>> >>
>> >> I will dig further into collect2.  I had noted that avr.h
>> has the following:
>> >>
>> >>
>> >> /* This is undefined macro for collect2 disabling */
>> >> #define LINKER_NAME "ld"
>> >>
>> >
>> > That's indeed going to break LTO.
>> >
>> > Richard.
>> >
>> >
>> That seems to be the key issue.
>> Without #define LINKER_NAME, AVR is running LTO/WHOPR tests ok ! (No
>> idea if it does anything useful though)
>>
>> Now to figure out why it was added in 2000 (rth). Hopefully Eric
>> Weddington or Denis might have some idea and perhaps know if it still
>> has a purpose.
>
> That was before my time. I didn't get involved (peripherally) until 2002. So it's either Denis Chertykov or Marek Michalkiewicz (CCed).

I havn't any ideas about LINKER_NAME definition.

Denis.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-01-09 10:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-30 15:58 AVR gives weird error with LTO Andrew Hutchinson
2009-12-30 16:31 ` Dave Korn
2009-12-30 20:21   ` Andrew Hutchinson
2009-12-30 21:58     ` Dave Korn
2009-12-30 22:35       ` Rafael Espindola
2009-12-30 22:39         ` Dave Korn
2009-12-30 23:04           ` Andrew Hutchinson
2009-12-30 23:23             ` Richard Guenther
2009-12-30 23:34               ` Andrew Hutchinson
2009-12-31  3:37                 ` Weddington, Eric
2010-01-09 10:25                   ` Denis Chertykov

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