public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] RFC: Example autoconf code for enabling -Wl,--as-needed from upstream configure script
@ 2010-08-07 14:45 Samuli Suominen
  2010-08-07 14:58 ` Alexis Ballier
  2010-08-07 22:07 ` Mike Frysinger
  0 siblings, 2 replies; 7+ messages in thread
From: Samuli Suominen @ 2010-08-07 14:45 UTC (permalink / raw
  To: gentoo-dev

Could use eyepair or two to doublecheck the example code in:

[1] http://bugs.gentoo.org/attachment.cgi?id=241779
[2] http://bugs.gentoo.org/show_bug.cgi?id=331527

It would go as a reference for upstreams in our asneeded guide...

Thanks, Samuli



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

* Re: [gentoo-dev] RFC: Example autoconf code for enabling -Wl,--as-needed from upstream configure script
  2010-08-07 14:45 [gentoo-dev] RFC: Example autoconf code for enabling -Wl,--as-needed from upstream configure script Samuli Suominen
@ 2010-08-07 14:58 ` Alexis Ballier
  2010-08-07 15:19   ` Samuli Suominen
  2010-08-07 22:07 ` Mike Frysinger
  1 sibling, 1 reply; 7+ messages in thread
From: Alexis Ballier @ 2010-08-07 14:58 UTC (permalink / raw
  To: gentoo-dev

On Saturday 07 August 2010 17:45:02 Samuli Suominen wrote:
> Could use eyepair or two to doublecheck the example code in:
> 
> [1] http://bugs.gentoo.org/attachment.cgi?id=241779
> [2] http://bugs.gentoo.org/show_bug.cgi?id=331527

You should use AC_TRY_LINK or something similar to check for toolchain 
support. Hardcoding a given set of strings matching the version is generally 
not a good way of writing a check; if you check something, check it for real.

Also if you pass -Wl,--as-needed to the compiler that's what you should check 
rather than if the supposed linker supports --as-needed; I suppose AC_TRY_LINK 
will do that.

A.



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

* Re: [gentoo-dev] RFC: Example autoconf code for enabling -Wl,--as-needed from upstream configure script
  2010-08-07 14:58 ` Alexis Ballier
@ 2010-08-07 15:19   ` Samuli Suominen
  2010-08-07 15:25     ` Alexis Ballier
  0 siblings, 1 reply; 7+ messages in thread
From: Samuli Suominen @ 2010-08-07 15:19 UTC (permalink / raw
  To: gentoo-dev

On 08/07/2010 05:58 PM, Alexis Ballier wrote:
> On Saturday 07 August 2010 17:45:02 Samuli Suominen wrote:
>> Could use eyepair or two to doublecheck the example code in:
>>
>> [1] http://bugs.gentoo.org/attachment.cgi?id=241779
>> [2] http://bugs.gentoo.org/show_bug.cgi?id=331527
> 
> You should use AC_TRY_LINK or something similar to check for toolchain 
> support. Hardcoding a given set of strings matching the version is generally 
> not a good way of writing a check; if you check something, check it for real.
> 
> Also if you pass -Wl,--as-needed to the compiler that's what you should check 
> rather than if the supposed linker supports --as-needed; I suppose AC_TRY_LINK 
> will do that.

I tend to agree but have one concern:

What if some non-GNU ld's are accepting the syntax of -Wl,--as-needed
but is in fact doing something entirely different?

I just remember one of our prefix devs, not long ago, saying that
happens. I think it was on this ML on different thread but sorry, can't
find the post now...

Note that flag-o-matic.eclass's check in function no-as-needed() is
checking for GNU as well.



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

* Re: [gentoo-dev] RFC: Example autoconf code for enabling -Wl,--as-needed from upstream configure script
  2010-08-07 15:19   ` Samuli Suominen
@ 2010-08-07 15:25     ` Alexis Ballier
  0 siblings, 0 replies; 7+ messages in thread
From: Alexis Ballier @ 2010-08-07 15:25 UTC (permalink / raw
  To: gentoo-dev

On Saturday 07 August 2010 18:19:30 Samuli Suominen wrote:
> On 08/07/2010 05:58 PM, Alexis Ballier wrote:
> > On Saturday 07 August 2010 17:45:02 Samuli Suominen wrote:
> >> Could use eyepair or two to doublecheck the example code in:
> >> 
> >> [1] http://bugs.gentoo.org/attachment.cgi?id=241779
> >> [2] http://bugs.gentoo.org/show_bug.cgi?id=331527
> > 
> > You should use AC_TRY_LINK or something similar to check for toolchain
> > support. Hardcoding a given set of strings matching the version is
> > generally not a good way of writing a check; if you check something,
> > check it for real.
> > 
> > Also if you pass -Wl,--as-needed to the compiler that's what you should
> > check rather than if the supposed linker supports --as-needed; I suppose
> > AC_TRY_LINK will do that.
> 
> I tend to agree but have one concern:
> 
> What if some non-GNU ld's are accepting the syntax of -Wl,--as-needed
> but is in fact doing something entirely different?
> 
> I just remember one of our prefix devs, not long ago, saying that
> happens. I think it was on this ML on different thread but sorry, can't
> find the post now...
> 
> Note that flag-o-matic.eclass's check in function no-as-needed() is
> checking for GNU as well.

you can check for both if you prefer, the main problem I see in the original 
check is that its not checking at all if as-needed works and appends a flag to 
gcc while it checks only if ld accepts the flag

A.



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

* Re: [gentoo-dev] RFC: Example autoconf code for enabling -Wl,--as-needed from upstream configure script
  2010-08-07 14:45 [gentoo-dev] RFC: Example autoconf code for enabling -Wl,--as-needed from upstream configure script Samuli Suominen
  2010-08-07 14:58 ` Alexis Ballier
@ 2010-08-07 22:07 ` Mike Frysinger
  2010-08-09 21:47   ` Samuli Suominen
  1 sibling, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2010-08-07 22:07 UTC (permalink / raw
  To: gentoo-dev; +Cc: Samuli Suominen

[-- Attachment #1: Type: Text/Plain, Size: 248 bytes --]

On Saturday, August 07, 2010 10:45:02 Samuli Suominen wrote:
> Could use eyepair or two to doublecheck the example code in:

how about you let someone else deal with it:
http://www.gnu.org/software/autoconf-archive/ax_check_linker_flags.html
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-dev] RFC: Example autoconf code for enabling -Wl,--as-needed from upstream configure script
  2010-08-07 22:07 ` Mike Frysinger
@ 2010-08-09 21:47   ` Samuli Suominen
  2010-08-09 21:54     ` Mike Frysinger
  0 siblings, 1 reply; 7+ messages in thread
From: Samuli Suominen @ 2010-08-09 21:47 UTC (permalink / raw
  To: gentoo-dev

On 08/08/2010 01:07 AM, Mike Frysinger wrote:
> On Saturday, August 07, 2010 10:45:02 Samuli Suominen wrote:
>> Could use eyepair or two to doublecheck the example code in:
> 
> how about you let someone else deal with it:
> http://www.gnu.org/software/autoconf-archive/ax_check_linker_flags.html
> -mike

thanks, didn't know about that macro.  will make use of it in the bug.



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

* Re: [gentoo-dev] RFC: Example autoconf code for enabling  -Wl,--as-needed from upstream configure script
  2010-08-09 21:47   ` Samuli Suominen
@ 2010-08-09 21:54     ` Mike Frysinger
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2010-08-09 21:54 UTC (permalink / raw
  To: gentoo-dev

On Mon, Aug 9, 2010 at 5:47 PM, Samuli Suominen wrote:
> On 08/08/2010 01:07 AM, Mike Frysinger wrote:
>> On Saturday, August 07, 2010 10:45:02 Samuli Suominen wrote:
>>> Could use eyepair or two to doublecheck the example code in:
>>
>> how about you let someone else deal with it:
>> http://www.gnu.org/software/autoconf-archive/ax_check_linker_flags.html
>
> thanks, didn't know about that macro.  will make use of it in the bug.

there is a surprising number of useful macros in the largely unknown
autoconf-archive package.  i tend to browse that when i need something
new to see if someone hasnt already coded up what i wanted.

downside is that the quality can sometimes vary significantly across
macros.  so a review of the code you're importing should be done
(ignoring the general aspect of this statement).  upside is that the
maintainer is usually pretty responsive in merging changes.
-mike



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

end of thread, other threads:[~2010-08-09 21:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-07 14:45 [gentoo-dev] RFC: Example autoconf code for enabling -Wl,--as-needed from upstream configure script Samuli Suominen
2010-08-07 14:58 ` Alexis Ballier
2010-08-07 15:19   ` Samuli Suominen
2010-08-07 15:25     ` Alexis Ballier
2010-08-07 22:07 ` Mike Frysinger
2010-08-09 21:47   ` Samuli Suominen
2010-08-09 21:54     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox