binutils-2.19

Greg Schafer diy-linux-dev@diy-linux.org
Mon, 6 Oct 2008 12:48:39 +1100


Hi List,

It isn't released yet, but I've been testing the latest release candidate.
There are 2 major points to note about this upcoming release:

 1. - the new linker "gold" (replacement for ld) is included, but not
      enabled by default

 2. - binutils now wants to link against zlib

AFAICT, gold is not ready from primetime ie: it's not ready to be used as a
complete ld replacement to build a full distro, kernel, etc. It's written in
C++ which will have BIG implications for us "bootstrappers" if/when it
finally is ready to become mainstream. BTW, has anyone actually played with
gold yet?

Regarding zlib, this is a bit of a pain because we'll probably have to
change the Chroot phase build order by inserting Zlib before Binutils (just
after Toolchain Readjustment). Ti's a shame to have to upset the flow of the
toolchain build order like this, but it's probably best for the long term.
Just forgetting about the issue and letting Binutils omit the Zlib link will
not cut the mustard because Binutils *will* find and link against Zlib the
next time around thus stuffing up ICA.

The reason for linking against Zlib is essentially this:

  "The gold linker can emit compressed sections. There is a gold flag to
   enable compressed debug sections."

It's a bit annoying that we have to bring Zlib into the toolchain mix
because of gold, when, we're not even ready to use it yet.

There is no documented easy way to prevent the link against zlib, but it
looks like it can be fudged wth `ac_cv_search_zlibVersion=no'. The other
thing is, the testsuite will fail 2 tests if zlib is missing. I've sent a
note upstream about this (amongst other things) but I don't expect much
sympathy:

http://sourceware.org/ml/binutils/2008-10/msg00047.html

Another major implication is that Binutils Pass 1 in the Temptools phase
will now link against the *host* zlib. It may well be prudent to use the
`ac_cv_search_zlibVersion=no' thing here in the interests of robustness, but
then again, maybe that doesn't matter much.

In summary, for binutils-2.19 we'll likely have to bring Zlib forward in the
Chroot build order which means we'll also have to configure it (twice, once
for static, once for shared) using the same tweak currently used for
Binuutils and GCC:

CC="gcc -specs=/tmp/myspecs -B/usr/lib$DIR_64/ -B/usr/bin/" \

Zlib builds fine like this and I've also confirmed no ICA regressions.

Let me know if I've missed anything.

Regards
Greg