[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-alt
Subject:    [gentoo-alt] Not killing non-GNU lds
From:       "Diego 'Flameeyes' =?iso-8859-1?q?Petten=F2?=" <flameeyes () gentoo ! org>
Date:       2005-10-08 12:23:11
Message-ID: 200510081423.38983 () enterprise ! flameeyes ! is-a-geek ! org
[Download RAW message or body]

First word: I'm not asking ANYONE to support non-GNU linkers!
What this proposal is about is to avoid hindering them more than necessary. We 
already allow users to do a lot of things that we don't support, this one is 
just a way to allow people to do what they want, we'll just ignore them if 
they start complaining that everything breaks (we may hear at them if they 
come with useful and decent patches). We all agree of this, right?

Ok then, what is needed to be done to have this? The minimal work needed (that 
I'll do personally, and with anyone that *wants* to help).

First the --with-gnu-ld switch must be removed from ebuilds. autoconf is smart 
enough to recognize GNU linker. Simplest change ever, just remove it, and let 
autoconf take care, also for crosscompile! I asked this to be done on the 
current tree, as this is a less-redundancy no-problem change that fixes many 
packages without having to do anything else.

All that comes after this is applied or going to be applied to the gentoo-alt 
overlay. No change will happen in portage until a solution can be found, ok?

Then the append-flags -Wl,-z,now.. this is ugly, and breaks, but we can't 
always replace it with something better.. I've prepared a function 
bindnow-flags that echoes the -Wl,-z,now string when ld is GNU, to that we'll 
add in case support for other LDs like OSX's one or whatever else. This will 
be transparent to devs and users, and will *not* break crosscompile.
Ebuilds doing append-flags -Wl,-z,now should just move to do append-flags 
$(bindnow-flags), and that is.

Patches to packages that uses autotools are simple to do, I've prepared a 
simple m4 file that uses AC_PROG_LD to check the linker and if it's gnu it 
sets BINDNOW_FLAGS variable to -Wl,-z,now. This can then be used inside 
Makefiles, as usual.
There are two ways to handle this: adding the m4 to every and all packages 
that is patched, or just add it in a package gentooalt-m4 (where we can 
always add something else) so that we can update it on global level to add a 
new linker in case. This could seem to be difficult to handle with upstream 
but it's not the case. If we want to send them upstream, just tell 'em to 
include our m4 file in m4 subdir, that would be enough. Then in autotools 
eclass we can always remove it or replace it with a newer copy if it's too 
old.
This make the patches more "upstreamable".

For custom-buildsystems the problem is trickier, but I have an idea. Just set 
the -Wl,-z,now as default value for a variable called BINDNOW_FLAGS, then we 
can call emake with "emake BINDNOW_FLAGS=$(bindnow-flags)" and that will take 
care.
Also here, no problems with crosscompile.

Now, telling again I'm not asking anyone to support non-GNU lds, repeating 
that I will do all the work needed. Stating clearly that the poor "use 
binutils" reply is pointless and I'll just read them as "ok do what you think 
is right", just to make sure I get real, technical reasons for not doing 
this. Thoughts?

-- 
Diego "Flameeyes" Pettenò - http://dev.gentoo.org/~flameeyes/
Gentoo/ALT lead, Gentoo/FreeBSD, Video, AMD64, Sound, PAM, KDE

[Attachment #3 (application/pgp-signature)]
-- 
gentoo-alt@gentoo.org mailing list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic