This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH to use binutils-2.18 with crosstool-0.43 (was Re: anyone using binutils 2.18?)


Yann E. MORIN wrote:
On Wednesday 05 September 2007 20:01, Chris MacGregor wrote:
I tried dropping binutils 2.18 into a working crosstool setup (in which I'm building on x86_64 a compiler to target i686 - crosstool is overkill here but it's a shared framework that also generates cross-compilers for arm & mips), and it seems that the newer configure script that comes with 2.18 does not work well the way crosstool (0.43) configures it.

I'm using it with crosstool-NG. It builds all the toolchains I need: ... All toolchains being build and run both on x86 and on x86_64.

http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool
Thanks, good to know.

Meanwhile, for those of us still using crosstool[-OG], the following patch (for crosstool-0.43) fixed it for me. (The lines are long, so it'll probably get mangled, but all I did was insert "--build=$GCC_HOST" right after "configure".) More info follows the patch.

------------------- start of patch -------------------
--- crosstool.sh~       2007-09-04 21:45:43.000000000 -0700
+++ crosstool.sh        2007-09-05 11:23:51.000000000 -0700
@@ -372,7 +372,7 @@ echo Build binutils
mkdir -p build-binutils; cd build-binutils

if test '!' -f Makefile; then
- ${BINUTILS_DIR}/configure $CANADIAN_BUILD --target=$TARGET --host=$GCC_HOST --prefix=$PREFIX --disable-nls ${BINUTILS_EXTRA_CONFIG} $BINUTILS_SYSROOT_ARG
+ ${BINUTILS_DIR}/configure --build=$GCC_HOST $CANADIAN_BUILD --target=$TARGET --host=$GCC_HOST --prefix=$PREFIX --disable-nls ${BINUTILS_EXTRA_CONFIG} $BINUTILS_SYSROOT_ARG
fi


make $PARALLELMFLAGS all
------------------- end of patch -------------------

I rummaged around in the code in configure for quite a while. The section that determines the name of ld, for instance, is fairly complex, but without the above patch, it ultimately concludes that it should use x86_64-host_unknown-linux-gnu-ld, x86_64-host_unknown-linux-gnu-ar (this was the one that actually stopped the build first), etc. By setting GCC_BUILD (for instance, to i686-unknown-linux) I was able to persuade it to try to use i686-host_unknown-linux-ar (etc.) instead. Unfortunately, that is not installed on my system, either, nor on anyone else's, I imagine. It was not clear to me why it insisted on trying to use a program that does not exist on the system rather than the one ("ar") that gcc -print-prog-name=ar said is the right one. Regardless, it was much easier to patch crosstool.sh at that point, and it might even be the RIGHT solution. What I don't know (and don't have time to test - sorry!) is whether or not it breaks anything else for crosstool.

Chris MacGregor


-- For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]