changeset 257:d37e39370d39

Fix cross compiler toolchain to be properly relocatable on x86-64 host. Note that the massive kludge that is collect2 needs a real fix if we add C++ support, but it's not currently enabled and the distcc trick doesn't use the host linker anyway.
author Rob Landley <rob@landley.net>
date Wed, 23 Jan 2008 02:33:45 -0600
parents e1d156c264bc
children 863e15b54e17
files cross-compiler.sh sources/toys/gcc-uClibc.c
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cross-compiler.sh	Tue Jan 01 17:53:33 2008 -0600
+++ b/cross-compiler.sh	Wed Jan 23 02:33:45 2008 -0600
@@ -51,6 +51,8 @@
 mkdir -p "${CROSS}"/gcc &&
 mv "${CROSS}"/lib/gcc/*/*/include "${CROSS}"/gcc/include &&
 mv "${CROSS}"/lib/gcc/*/* "${CROSS}"/gcc/lib &&
+ln -s ${CROSS_TARGET} ${CROSS}/tools &&
+ln -sf ../../../../tools/bin/ld  ${CROSS}/libexec/gcc/*/*/collect2 &&
 $CLEANUP "${CROSS}"/{lib/gcc,gcc/lib/install-tools} &&
 
 # Build and install gcc wrapper script.
--- a/sources/toys/gcc-uClibc.c	Tue Jan 01 17:53:33 2008 -0600
+++ b/sources/toys/gcc-uClibc.c	Wed Jan 23 02:33:45 2008 -0600
@@ -120,8 +120,8 @@
 
 		// Add that directory to the start of $PATH.  (Better safe than sorry.)
 		*rindex(topdir,'/') = 0;
-		temp = malloc(strlen(topdir)+strlen(path)+7);
-		sprintf(temp,"PATH=%s:%s",topdir,path);
+		temp = malloc(5+strlen(topdir)+1+strlen(topdir)+14+strlen(path)+1);
+		sprintf(temp,"PATH=%s:%s/../tools/bin:%s",topdir,topdir,path);
 		putenv(temp);
 
 		// The directory above the wrapper script should have include, gcc,