Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

[gentoo-dev] RFC: LD_AS_NEEDED="1" in profiles/targets/dev..

 
   Soft32 Home -> Linux -> Development RSS
Next:  Bug#549486: regina-rexx: regina - fail to SIGSEGV  
Author Message
Samuli Suominen

External


Since: Nov 29, 2008
Posts: 30



(Msg. 1) Posted: Sat Oct 03, 2009 3:20 pm
Post subject: [gentoo-dev] RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults?
Archived from groups: linux>gentoo>dev (more info?)

Since new binutils will support LD_AS_NEEDED="1" to force ld behave
asneeded we could use this for the developer -target in profiles?

Speak up if you think it's a terrible idea.

Thanks, Samuli
Back to top
Login to vote
Samuli Suominen

External


Since: Nov 29, 2008
Posts: 30



(Msg. 2) Posted: Sat Oct 03, 2009 3:20 pm
Post subject: Re: [gentoo-dev] RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Arfrever Frehtes Taifersar Arahesis wrote:
> 2009-10-03 21:13:59 Samuli Suominen napisał(a):
>> Since new binutils will support LD_AS_NEEDED="1" to force ld behave
>> asneeded we could use this for the developer -target in profiles?
>
> IMHO it should be set in the base profile so that everybody benefits from this.
>

Have you seen the amount of open bugs in the asneeded tracker? The
gentoo-x86 is not ready for it yet.

That's why I'm suggesting we start from the developer target first. Smile
Back to top
Login to vote
Samuli Suominen

External


Since: Nov 29, 2008
Posts: 30



(Msg. 3) Posted: Sat Oct 03, 2009 3:20 pm
Post subject: Re: [gentoo-dev] RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ciaran McCreesh wrote:
> On Sat, 03 Oct 2009 22:13:59 +0300
> Samuli Suominen <ssuominen.RemoveThis@gentoo.org> wrote:
>> Since new binutils will support LD_AS_NEEDED="1" to force ld behave
>> asneeded we could use this for the developer -target in profiles?
>>
>> Speak up if you think it's a terrible idea.
>
> Well, it does break correct code, so it's about on par with forcing
> -ffast-math or -fno-exceptions or -fvisibility-inlines-hidden on
> globally...
>

Be reasonable. We can add -Wl,--no-as-needed for those packages with
valid code. And I'm certainly not suggesting adding it to base/, _only_
for the developer target.
Back to top
Login to vote
Fabian Groffen

External


Since: Nov 23, 2006
Posts: 15



(Msg. 4) Posted: Sat Oct 03, 2009 5:20 pm
Post subject: Re: [gentoo-dev] RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 03-10-2009 22:35:58 +0300, Samuli Suominen wrote:
> Ciaran McCreesh wrote:
> > On Sat, 03 Oct 2009 22:13:59 +0300
> > Samuli Suominen <ssuominen.TakeThisOut@gentoo.org> wrote:
> >> Since new binutils will support LD_AS_NEEDED="1" to force ld behave
> >> asneeded we could use this for the developer -target in profiles?
> >>
> >> Speak up if you think it's a terrible idea.
> >
> > Well, it does break correct code, so it's about on par with forcing
> > -ffast-math or -fno-exceptions or -fvisibility-inlines-hidden on
> > globally...
> >
>
> Be reasonable. We can add -Wl,--no-as-needed for those packages with
> valid code. And I'm certainly not suggesting adding it to base/, _only_
> for the developer target.

Please recall that this is a GNU binutils flag. I prefer the
environment flag over the command-line option, because it doesn't break
other linkers, but if it implies many ebuilds getting -Wl,--no-as-needed
append-ldflagged, then I'm not getting happy as that breaks my builds.


--
Fabian Groffen
Gentoo on a different level
Back to top
Login to vote
Samuli Suominen

External


Since: Nov 29, 2008
Posts: 30



(Msg. 5) Posted: Sat Oct 03, 2009 5:20 pm
Post subject: Re: [gentoo-dev] RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Fabian Groffen wrote:
> On 03-10-2009 22:35:58 +0300, Samuli Suominen wrote:
>> Ciaran McCreesh wrote:
>>> On Sat, 03 Oct 2009 22:13:59 +0300
>>> Samuli Suominen <ssuominen.TakeThisOut@gentoo.org> wrote:
>>>> Since new binutils will support LD_AS_NEEDED="1" to force ld behave
>>>> asneeded we could use this for the developer -target in profiles?
>>>>
>>>> Speak up if you think it's a terrible idea.
>>> Well, it does break correct code, so it's about on par with forcing
>>> -ffast-math or -fno-exceptions or -fvisibility-inlines-hidden on
>>> globally...
>>>
>> Be reasonable. We can add -Wl,--no-as-needed for those packages with
>> valid code. And I'm certainly not suggesting adding it to base/, _only_
>> for the developer target.
>
> Please recall that this is a GNU binutils flag. I prefer the
> environment flag over the command-line option, because it doesn't break
> other linkers, but if it implies many ebuilds getting -Wl,--no-as-needed
> append-ldflagged, then I'm not getting happy as that breaks my builds.
>
>

The amount of pkgs in tree with valid code that fails with asneeded is
close to zero. We can use this,

if use userland_GNU; then
append-ldflags -Wl,--no-as-needed
fi

logic so it won't cause you troubles. Or the obvious shorter && version
of it.
Back to top
Login to vote
Fabian Groffen

External


Since: Nov 23, 2006
Posts: 15



(Msg. 6) Posted: Sat Oct 03, 2009 5:20 pm
Post subject: Re: [gentoo-dev] RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 03-10-2009 23:27:41 +0300, Samuli Suominen wrote:
> The amount of pkgs in tree with valid code that fails with asneeded is
> close to zero. We can use this,
>
> if use userland_GNU; then
> append-ldflags -Wl,--no-as-needed
> fi
>
> logic so it won't cause you troubles. Or the obvious shorter && version
> of it.

Not really, because the userland is GNU, the compiler too, but the
linker is not. We once played with a version of append-ldflags that
tested the flag against the linker to see if it would work, but that's
expensive as well as allowing real typos/bugs to go unnoticed.

We currently do either a CHOST check, or call ld to see if it's GNU for
all packages that hardcode -Wl,--{,no-}as-needed usage.


--
Fabian Groffen
Gentoo on a different level
Back to top
Login to vote
Samuli Suominen

External


Since: Nov 29, 2008
Posts: 30



(Msg. 7) Posted: Sat Oct 03, 2009 5:20 pm
Post subject: Re: [gentoo-dev] RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Fabian Groffen wrote:
> On 03-10-2009 23:27:41 +0300, Samuli Suominen wrote:
>> The amount of pkgs in tree with valid code that fails with asneeded is
>> close to zero. We can use this,
>>
>> if use userland_GNU; then
>> append-ldflags -Wl,--no-as-needed
>> fi
>>
>> logic so it won't cause you troubles. Or the obvious shorter && version
>> of it.
>
> Not really, because the userland is GNU, the compiler too, but the
> linker is not. We once played with a version of append-ldflags that
> tested the flag against the linker to see if it would work, but that's
> expensive as well as allowing real typos/bugs to go unnoticed.
>
> We currently do either a CHOST check, or call ld to see if it's GNU for
> all packages that hardcode -Wl,--{,no-}as-needed usage.
>

Ah. I wasn't aware of that.

Perhaps we could add a new function to the flag-o-matic that does the
CHOST check, and appends the flag, so the check code wouldn't have to be
duplicated in ebuilds? It should be rather trivial.
Back to top
Login to vote
Fabian Groffen

External


Since: Nov 23, 2006
Posts: 15



(Msg. 8) Posted: Sat Oct 03, 2009 5:20 pm
Post subject: Re: [gentoo-dev] RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 04-10-2009 00:11:06 +0300, Samuli Suominen wrote:
> Perhaps we could add a new function to the flag-o-matic that does the
> > CHOST check, and appends the flag, so the check code wouldn't have to be
> > duplicated in ebuilds? It should be rather trivial.
> >
>
> ok, chost check would be cheap. how about,
>
> no-as-needed() {
> case $($(tc-getLD) -v 2>&1 </dev/null) in
> *GNU*) # GNU ld
> echo "-Wl,--no-as-needed" ;;
> esac
> }
>
> usage: append-ldflags $(no-as-needed)

that would work fine for me, and all possible future cases I can think
of


--
Fabian Groffen
Gentoo on a different level
Back to top
Login to vote
Samuli Suominen

External


Since: Nov 29, 2008
Posts: 30



(Msg. 9) Posted: Sat Oct 03, 2009 5:20 pm
Post subject: Re: [gentoo-dev] RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Samuli Suominen wrote:
> Fabian Groffen wrote:
>> On 03-10-2009 23:27:41 +0300, Samuli Suominen wrote:
>>> The amount of pkgs in tree with valid code that fails with asneeded is
>>> close to zero. We can use this,
>>>
>>> if use userland_GNU; then
>>> append-ldflags -Wl,--no-as-needed
>>> fi
>>>
>>> logic so it won't cause you troubles. Or the obvious shorter && version
>>> of it.
>> Not really, because the userland is GNU, the compiler too, but the
>> linker is not. We once played with a version of append-ldflags that
>> tested the flag against the linker to see if it would work, but that's
>> expensive as well as allowing real typos/bugs to go unnoticed.
>>
>> We currently do either a CHOST check, or call ld to see if it's GNU for
>> all packages that hardcode -Wl,--{,no-}as-needed usage.
>>
>
> Ah. I wasn't aware of that.
>
> Perhaps we could add a new function to the flag-o-matic that does the
> CHOST check, and appends the flag, so the check code wouldn't have to be
> duplicated in ebuilds? It should be rather trivial.
>

ok, chost check would be cheap. how about,

no-as-needed() {
case $($(tc-getLD) -v 2>&1 </dev/null) in
*GNU*) # GNU ld
echo "-Wl,--no-as-needed" ;;
esac
}

usage: append-ldflags $(no-as-needed)
Back to top
Login to vote
Samuli Suominen

External


Since: Nov 29, 2008
Posts: 30



(Msg. 10) Posted: Sat Oct 03, 2009 5:20 pm
Post subject: Re: [gentoo-dev] Re: RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ryan Hill wrote:
> On Sat, 03 Oct 2009 22:13:59 +0300
> Samuli Suominen <ssuominen DeleteThis @gentoo.org> wrote:
>
>> Since new binutils will support LD_AS_NEEDED="1" to force ld behave
>> asneeded we could use this for the developer -target in profiles?
>>
>> Speak up if you think it's a terrible idea.
>>
>> Thanks, Samuli
>>
>>
>
> I think it's a not terrible idea.
>
>
> Only barely related: can we enable FEATURES=test too?
>

*nod*, I think we can enable "test" too.
Back to top
Login to vote
Samuli Suominen

External


Since: Nov 29, 2008
Posts: 30



(Msg. 11) Posted: Sun Oct 04, 2009 7:20 am
Post subject: Re: [gentoo-dev] RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Fabian Groffen wrote:
>>> Perhaps we could add a new function to the flag-o-matic that does the
>>> CHOST check, and appends the flag, so the check code wouldn't have to be
>>> duplicated in ebuilds? It should be rather trivial.
>>
>> ok, chost check would be cheap. how about,
>> usage: append-ldflags $(no-as-needed)
>
> that would work fine for me, and all possible future cases I can think
> of

+# @FUNCTION: no-as-needed
+# @RETURN: Flag to disable asneeded behavior for use with append-ldflags.
+no-as-needed() {
+ case $($(tc-getLD) -v 2>&1 </dev/null) in
+ *GNU*) # GNU ld
+ echo "-Wl,--no-as-needed" ;;
+ esac
+}

It's committed.

To avoid the already caused trouble for you (prefix), these should be
converted:

(It's a ugly grep -r from gentoo-x86. I will handle this also in a QA
bug, opening one later today.)

app-admin/apache-tools/apache-tools-2.2.11.ebuild: # Instead of
filtering --as-needed (bug #128505), append --no-as-needed
app-admin/apache-tools/apache-tools-2.2.11.ebuild: append-ldflags
-Wl,--no-as-needed
app-admin/apache-tools/apache-tools-2.2.13.ebuild: # Instead of
filtering --as-needed (bug #128505), append --no-as-needed
app-admin/apache-tools/apache-tools-2.2.13.ebuild: append-ldflags
-Wl,--no-as-needed
app-admin/apache-tools/apache-tools-2.2.12.ebuild: # Instead of
filtering --as-needed (bug #128505), append --no-as-needed
app-admin/apache-tools/apache-tools-2.2.12.ebuild: append-ldflags
-Wl,--no-as-needed
app-editors/mlview/mlview-0.8-r1.ebuild: append-ldflags
-Wl,--no-as-needed
dev-games/ogre/files/ogre-1.4.9-as-needed.patch:+ ,-Xlinker
--no-as-needed -lstdc++)
dev-lang/gdl/gdl-0.9_rc2.ebuild: use imagemagick &&
append-ldflags -Wl,--no-as-needed
dev-libs/yaz++/yaz++-1.1.0.ebuild: append-ldflags
-Wl,--no-as-needed # FIXME.
dev-libs/dvmysql/dvmysql-1.0.2.ebuild: append-ldflags -Wl,--no-as-needed
dev-libs/dvutil/dvutil-0.15.5.ebuild: append-ldflags -Wl,--no-as-needed
dev-libs/dvutil/dvutil-1.0.5.ebuild: append-ldflags -Wl,--no-as-needed
dev-lisp/sbcl/sbcl-1.0.19.ebuild: append-ldflags
-Wl,--no-as-needed # see Bug #132992
dev-lisp/sbcl/sbcl-1.0.31.ebuild: append-ldflags
-Wl,--no-as-needed # see Bug #132992
dev-lisp/sbcl/sbcl-1.0.27-r10.ebuild: append-ldflags
-Wl,--no-as-needed # see Bug #132992
dev-lisp/sbcl/sbcl-1.0.26-r10.ebuild: append-ldflags
-Wl,--no-as-needed # see Bug #132992
dev-lisp/sbcl/sbcl-1.0.28.ebuild: append-ldflags
-Wl,--no-as-needed # see Bug #132992
eclass/apache-2.eclass: # Instead of filtering --as-needed (bug
#128505), append --no-as-needed
eclass/apache-2.eclass: append-ldflags -Wl,--no-as-needed
media-libs/SoQt/SoQt-1.4.1.ebuild: append-ldflags -Wl,--no-as-needed
media-sound/pulseaudio/pulseaudio-0.9.15-r2.ebuild: append-ldflags
-Wl,--no-as-needed
media-sound/pulseaudio/pulseaudio-0.9.18-r50.ebuild: append-ldflags
-Wl,--no-as-needed
media-sound/pulseaudio/pulseaudio-0.9.19.ebuild: append-ldflags
-Wl,--no-as-needed
media-sound/pulseaudio/pulseaudio-0.9.19-r50.ebuild: append-ldflags
-Wl,--no-as-needed
media-sound/pulseaudio/pulseaudio-0.9.18.ebuild: append-ldflags
-Wl,--no-as-needed
net-firewall/ebtables/ebtables-2.0.9.1.ebuild: append-ldflags
-Wl,--no-as-needed
net-firewall/ebtables/ebtables-2.0.8.2-r2.ebuild: append-ldflags
-Wl,--no-as-needed
net-libs/rb_libtorrent/rb_libtorrent-0.13-r1.ebuild: append-ldflags
-Wl,--no-as-needed
net-mail/email/email-3.0.5.ebuild: append-ldflags -Wl,--no-as-needed
sci-libs/mkl/mkl-10.0.2.018-r2.ebuild: Libs: -Wl,--no-as-needed
-L\${libdir} ${2} ${3} -lmkl_core ${4} -lpthread
sci-libs/mkl/mkl-10.0.2.018-r2.ebuild: Libs: -Wl,--no-as-needed
-L\${libdir} ${2} ${3} -lmkl_core ${4} -lpthread
sci-libs/mkl/mkl-10.0.2.018-r2.ebuild: Libs: -Wl,--no-as-needed
-L\${libdir} ${2} ${3} -lmkl_core -lmkl_lapack ${4} -lpthread
sci-libs/mkl/mkl-10.0.5.025.ebuild: Libs: -Wl,--no-as-needed
-L\${libdir} ${2} ${3} -lmkl_core ${4} -lpthread
sci-libs/mkl/mkl-10.0.5.025.ebuild: Libs: -Wl,--no-as-needed
-L\${libdir} ${2} ${3} -lmkl_core ${4} -lpthread
sci-libs/mkl/mkl-10.0.5.025.ebuild: Libs: -Wl,--no-as-needed
-L\${libdir} ${2} ${3} -lmkl_core -lmkl_lapack ${4} -lpthread
sys-devel/libtool/libtool-2.2.6a.ebuild: append-ldflags
-Wl,--no-as-needed
sys-libs/gwenhywfar/gwenhywfar-3.7.2.ebuild:append-ldflags
-Wl,--no-as-needed
sys-libs/gwenhywfar/gwenhywfar-3.8.0.ebuild:append-ldflags
-Wl,--no-as-needed
x11-wm/matchbox/matchbox-0.7.1.ebuild: append-ldflags -Wl,--no-as-needed
Back to top
Login to vote
Fabian Groffen

External


Since: Nov 23, 2006
Posts: 15



(Msg. 12) Posted: Sun Oct 04, 2009 7:20 am
Post subject: Re: [gentoo-dev] RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 04-10-2009 13:13:30 +0300, Samuli Suominen wrote:
> +# @FUNCTION: no-as-needed
> +# @RETURN: Flag to disable asneeded behavior for use with append-ldflags.
> +no-as-needed() {
> + case $($(tc-getLD) -v 2>&1 </dev/null) in
> + *GNU*) # GNU ld
> + echo "-Wl,--no-as-needed" ;;
> + esac
> +}
>
> It's committed.
>
> To avoid the already caused trouble for you (prefix), these should be
> converted:

thanks!


--
Fabian Groffen
Gentoo on a different level
Back to top
Login to vote
Peter Hjalmarsson

External


Since: Oct 05, 2009
Posts: 1



(Msg. 13) Posted: Sun Oct 04, 2009 9:20 pm
Post subject: [gentoo-dev] Re: RFC: LD_AS_NEEDED="1" in profiles/targets/developer/make.defaults? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

lör 2009-10-03 klockan 14:21 -0600 skrev Ryan Hill:
> On Sat, 03 Oct 2009 22:13:59 +0300
> Samuli Suominen <ssuominen RemoveThis @gentoo.org> wrote:
>
> > Since new binutils will support LD_AS_NEEDED="1" to force ld behave
> > asneeded we could use this for the developer -target in profiles?
> >
> > Speak up if you think it's a terrible idea.
> >
> > Thanks, Samuli
> >
> >
>
> I think it's a not terrible idea.
>
>
> Only barely related: can we enable FEATURES=test too?
>

For FEATURES="test" a policy for how to handle stuff like:

if use test; then
elog
ewarn "You have unit tests enabled, this results in an insecure library"
ewarn "It is recommended that you reinstall *without* FEATURES=test"
fi
[1]


needs to be formed before enabling it anywhere by default. Should this test really be run by default, or should it be shielded by USE="unsafetests" or something of just restricted?

My 2 cents.

[1] http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/dbus/dbus-1.3...ebuild? and scroll to the bottom.

//Peter Hjalmarsson
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[gentoo-dev] dev-perl Targets - I took a bit of my free time this week and finally wrote a quick tool that grabs the current ls-lR from cpan and maps i...

[gentoo-dev] New Profiles - Hello, is anybody out there, who could help me developing a new profile for embedded PowerPC (PPC405EP without..

[gentoo-dev] Cascading Profiles - What is the best way to go about creating custom profiles that inherit from standard Gentoo Profiles? I know that I..

[gentoo-dev] profiles cleanup - Hi all, I've just removed a few deprecated profiles for amd64, and saw that there are still quite a lot of..

[gentoo-dev] Valid Profiles - ka0ttic reminded me about the idea of adding all of the valid profiles to profiles.desc now that portage 2.0.51.22 ha...

[gentoo-dev] useful profiles.desc - -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Continuing a subject I've brought up several times in the past... Are w...
       Soft32 Home -> Linux -> Development All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]