changeset 905:023b577fb865

Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
author Rob Landley <rob@landley.net>
date Sat, 28 Nov 2009 18:10:43 -0600
parents 2ed667428dbd
children 5e0cbc73da55
files cross-compiler.sh root-filesystem.sh sources/sections/binutils-gcc.sh sources/sections/binutils.sh sources/sections/ccwrap.sh sources/sections/gcc.sh sources/toys/ccwrap.c
diffstat 7 files changed, 253 insertions(+), 201 deletions(-) [+]
line wrap: on
line diff
--- a/cross-compiler.sh	Thu Nov 26 14:53:29 2009 -0600
+++ b/cross-compiler.sh	Sat Nov 28 18:10:43 2009 -0600
@@ -21,7 +21,9 @@
 
 # Build binutils, gcc, and ccwrap
 
-FROM_ARCH="" PROGRAM_PREFIX="${ARCH}-" build_section binutils-gcc
+FROM_ARCH= PROGRAM_PREFIX="${ARCH}-" build_section binutils
+FROM_ARCH= PROGRAM_PREFIX="${ARCH}-" build_section gcc
+FROM_ARCH= PROGRAM_PREFIX="${ARCH}-" build_section ccwrap
 
 # Build C Library
 
@@ -33,7 +35,7 @@
 Cross compiler for $ARCH
 From http://impactlinux.com/fwl
 
-To use: Add the "bin" subdirectory to your \$PATH, and use "$ARCH-gcc" as
+To use: Add the "bin" subdirectory to your \$PATH, and use "$ARCH-cc" as
 your compiler.
 
 The syntax used to build the Linux kernel is:
--- a/root-filesystem.sh	Thu Nov 26 14:53:29 2009 -0600
+++ b/root-filesystem.sh	Sat Nov 28 18:10:43 2009 -0600
@@ -73,7 +73,9 @@
 
 # Build binutils, gcc, and ccwrap
 
-STAGE_DIR="$ROOT_TOPDIR" build_section binutils-gcc
+STAGE_DIR="$ROOT_TOPDIR" build_section binutils
+STAGE_DIR="$ROOT_TOPDIR" build_section gcc
+STAGE_DIR="$ROOT_TOPDIR" build_section ccwrap
 
 # Tell future packages to link against the libraries in the new root filesystem,
 # rather than the ones in the cross compiler directory.
--- a/sources/sections/binutils-gcc.sh	Thu Nov 26 14:53:29 2009 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-# Build binutils, c wrapper, and uClibc++
-
-# Build binutils, which provides the linker and assembler and such.
-
-# PROGRAM_PREFIX affects the name of the generated tools, ala "${ARCH}-".
-
-setupfor binutils
-
-# The binutils ./configure stage is _really_stupid_, and we need to define
-# lots of environment variables to make it behave.
-
-function configure_binutils()
-{
-  "$CURSRC/configure" --prefix="$STAGE_DIR" \
-    --build="$CROSS_HOST" --host="$FROM_HOST" --target="$CROSS_TARGET" \
-    --disable-nls --disable-shared --disable-multilib --disable-werror \
-    --with-lib-path=lib --program-prefix="$PROGRAM_PREFIX" $BINUTILS_FLAGS
-
-  [ $? -ne 0 ] && dienow
-}
-
-if [ -z "$FROM_ARCH" ]
-then
-  # Create a simple cross compiler, from this host to target $ARCH.
-  # This has no prerequisites.
-
-  # The binutils ./configure stage is _really_stupid_.  Define lots of
-  # environment variables to make it behave.
-
-  AR=ar AS=as LD=ld NM=nm OBJDUMP=objdump OBJCOPY=objcopy configure_binutils
-else
-  # Canadian cross for an arbitrary host/target.  The new compiler will run
-  # on $FROM_ARCH as its host, and build executables for $ARCH as its target.
-  # (Use host==target to produce a native compiler.)  Doing this requires
-  # existing host ($FROM_ARCH) _and_ target ($ARCH) cross compilers as
-  # prerequisites.
-
-  AR="${FROM_ARCH}-ar" CC="${FROM_ARCH}-cc" configure_binutils
-fi
-
-# Now that it's configured, build and install binutils
-
-make -j $CPUS configure-host &&
-make -j $CPUS CFLAGS="-O2 $STATIC_FLAGS" &&
-make -j $CPUS install &&
-mkdir -p "$STAGE_DIR/include" &&
-cp "$CURSRC/include/libiberty.h" "$STAGE_DIR/include"
-
-cleanup build-binutils
-
-# Force gcc to build, largely against its will.
-
-setupfor gcc-core build-gcc
-setupfor gcc-g++ build-gcc gcc-core
-
-# GCC tries to "help out in the kitchen" by screwing up the kernel include
-# files.  Surgery with sed to cut out that horrible idea throw it away.
-
-sed -i 's@^STMP_FIX.*@@' "${CURSRC}/gcc/Makefile.in" || dienow
-
-# The gcc ./configure manages to make the binutils one look sane.  Again,
-# wrap it so we can call it with different variables to beat sense out of it.
-
-function configure_gcc()
-{
-  "$CURSRC/configure" --target="$CROSS_TARGET" --prefix="$STAGE_DIR" \
-    --disable-multilib --disable-nls --enable-c99 --enable-long-long \
-    --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch \
-    --program-prefix="$PROGRAM_PREFIX" "$@" $GCC_FLAGS &&
-  mkdir -p gcc &&
-  ln -s `which ${CC_FOR_TARGET:-cc}` gcc/xgcc || dienow
-}
-
-if [ -z "$FROM_ARCH" ]
-then
-  # Produce a standard host->target cross compiler, which does not include
-  # thread support or libgcc_s.so to make it depend on the host less.
-
-  # The only prerequisite for this is binutils, above.  (It doesn't even
-  # require a C library for the target to exist yet, which is good because you
-  # have a chicken and egg problem otherwise.  What would you have compiled
-  # that C library _with_?)
-
-  AR_FOR_TARGET="${ARCH}-ar" configure_gcc \
-    --disable-threads --disable-shared --host="$CROSS_HOST"
-else
-  # Canadian cross a compiler to run on $FROM_ARCH as its host and output
-  # binaries for $ARCH as its target.
-
-  # GCC has some deep assumptions here, which are wrong.  Lots of redundant
-  # corrections are required to make it stop.
-
-  CC="${FROM_ARCH}-cc" AR="${FROM_ARCH}-ar" AS="${FROM_ARCH}-as" \
-    LD="${FROM_ARCH}-ld" NM="${FROM_ARCH}-nm" \
-    CC_FOR_TARGET="${ARCH}-cc" AR_FOR_TARGET="${ARCH}-ar" \
-    NM_FOR_TARGET="${ARCH}-nm" GCC_FOR_TARGET="${ARCH}-cc" \
-    AS_FOR_TARGET="${ARCH}-as" LD_FOR_TARGET="${ARCH}-ld" \
-    CXX_FOR_TARGET="${ARCH}-c++" \
-    ac_cv_path_AR_FOR_TARGET="${ARCH}-ar" \
-    ac_cv_path_RANLIB_FOR_TARGET="${ARCH}-ranlib" \
-    ac_cv_path_NM_FOR_TARGET="${ARCH}-nm" \
-    ac_cv_path_AS_FOR_TARGET="${ARCH}-as" \
-    ac_cv_path_LD_FOR_TARGET="${ARCH}-ld" \
-    configure_gcc --enable-threads=posix --enable-shared \
-      --build="$CROSS_HOST" --host="$CROSS_TARGET"
-fi
-
-# Now that it's configured, build and install gcc
-
-make -j $CPUS configure-host &&
-make -j $CPUS all-gcc LDFLAGS="$STATIC_FLAGS" &&
-
-# Work around gcc bug; we disabled multilib but it doesn't always notice.
-
-ln -s lib "$STAGE_DIR/lib64" &&
-make -j $CPUS install-gcc &&
-rm "$STAGE_DIR/lib64" &&
-ln -s "${PROGRAM_PREFIX}gcc" "$STAGE_DIR/bin/${PROGRAM_PREFIX}cc" || dienow
-
-# Now we need to beat libsupc++ out of gcc (which uClibc++ needs to build).
-# But don't want to build the whole of libstdc++-v3 because
-# A) we're using uClibc++ instead,  B) the build breaks.
-
-if [ ! -z "$FROM_ARCH" ]
-then
-  # The libsupc++ ./configure dies if run after the simple cross compiling
-  # ./configure, because gcc's build system is overcomplicated crap.  So
-  # skip the uClibc++ build first time around.  We still build C++ support
-  # in gcc because we need it to canadian cross build uClibc++ later.
-
-  make -j $CPUS configure-target-libstdc++-v3 &&
-  cd "$CROSS_TARGET"/libstdc++-v3/libsupc++ &&
-  make -j $CPUS &&
-  mv .libs/libsupc++.a "$STAGE_DIR"/lib || dienow
-fi
-
-# We're done with that source and could theoretically cleanup gcc-core and
-# build-gcc here, but we still need the timestamps if we do binary package
-# tarballs.
-
-function build_ccwrap()
-{
-  # build and install gcc wrapper script.
-
-  TEMP="${FROM_ARCH}-cc"
-  [ -z "$FROM_ARCH" ] && TEMP="$CC"
-
-  mv "$STAGE_DIR/bin/${PROGRAM_PREFIX}"{gcc,rawgcc} &&
-  "$TEMP" "$SOURCES/toys/ccwrap.c" -Os -s \
-    -o "$STAGE_DIR/bin/${PROGRAM_PREFIX}gcc" "$@" $STATIC_FLAGS \
-    -DGCC_UNWRAPPED_NAME='"'"${PROGRAM_PREFIX}rawgcc"'"' &&
-
-  # Move the gcc internal libraries and headers somewhere sane
-
-  mkdir -p "$STAGE_DIR"/gcc &&
-  mv "$STAGE_DIR"/lib/gcc/*/*/include "$STAGE_DIR"/gcc/include &&
-  mv "$STAGE_DIR"/lib/gcc/*/* "$STAGE_DIR"/gcc/lib &&
-
-  # Rub gcc's nose in the binutils output.  (It's RIGHT THERE!  Find it!)
-
-  cd "$STAGE_DIR"/libexec/gcc/*/*/ &&
-  cp -s "../../../../$CROSS_TARGET/bin/"* . &&
-
-  ln -s ${CROSS_TARGET} ${STAGE_DIR}/tools &&
-  ln -sf ../../../../tools/bin/ld  ${STAGE_DIR}/libexec/gcc/*/*/collect2 || dienow
-
-  # These are allowed to fail, there for static toolchains that don't make 'em.
-
-  ln -s ../../bin/${PROGRAM_PREFIX}-rawgcc gcc 2>/dev/null
-  ln -s ../../bin/${PROGRAM_PREFIX}-rawgcc cc 2>/dev/null
-  ln -s ../../bin/${PROGRAM_PREFIX}-rawg++ g++ 2>/dev/null
-  ln -s ../../bin/${PROGRAM_PREFIX}-rawg++ c++ 2>/dev/null
-
-  # Wrap C++ too.
-
-  mv "$STAGE_DIR/bin/${PROGRAM_PREFIX}"{g++,rawg++} &&
-  rm "$STAGE_DIR/bin/${PROGRAM_PREFIX}c++" &&
-  ln -s "${PROGRAM_PREFIX}rawg++" "$STAGE_DIR/bin/${PROGRAM_PREFIX}rawc++" &&
-  ln -s "${PROGRAM_PREFIX}gcc" "$STAGE_DIR/bin/${PROGRAM_PREFIX}g++" &&
-  ln -s "${PROGRAM_PREFIX}gcc" "$STAGE_DIR/bin/${PROGRAM_PREFIX}c++" || dienow
-}
-
-if [ -z "$FROM_ARCH" ]
-then
-  build_ccwrap
-else
-  build_ccwrap -DGIMME_AN_S
-fi
-
-mv "$WORK"/{gcc-core,gcc}
-PACKAGE=gcc cleanup build-gcc "${STAGE_DIR}"/{lib/gcc,{libexec/gcc,gcc/lib}/install-tools,bin/${ARCH}-unknown-*}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/sections/binutils.sh	Sat Nov 28 18:10:43 2009 -0600
@@ -0,0 +1,54 @@
+# Build binutils, c wrapper, and uClibc++
+
+# Build binutils, which provides the linker and assembler and such.
+
+# PROGRAM_PREFIX affects the name of the generated tools, ala "${ARCH}-".
+
+setupfor binutils
+
+# The binutils ./configure stage is _really_stupid_, and we need to define
+# lots of environment variables to make it behave.
+
+function configure_binutils()
+{
+  "$CURSRC/configure" --prefix="$STAGE_DIR" \
+    --build="$CROSS_HOST" --host="$FROM_HOST" --target="$CROSS_TARGET" \
+    --disable-nls --disable-shared --disable-multilib --disable-werror \
+    --with-lib-path=lib --program-prefix="$PROGRAM_PREFIX" $BINUTILS_FLAGS
+
+  [ $? -ne 0 ] && dienow
+}
+
+if [ -z "$FROM_ARCH" ]
+then
+  # Create a simple cross compiler, from this host to target $ARCH.
+  # This has no prerequisites.
+
+  # The binutils ./configure stage is _really_stupid_.  Define lots of
+  # environment variables to make it behave.
+
+  AR=ar AS=as LD=ld NM=nm OBJDUMP=objdump OBJCOPY=objcopy configure_binutils
+else
+  # Canadian cross for an arbitrary host/target.  The new compiler will run
+  # on $FROM_ARCH as its host, and build executables for $ARCH as its target.
+  # (Use host==target to produce a native compiler.)  Doing this requires
+  # existing host ($FROM_ARCH) _and_ target ($ARCH) cross compilers as
+  # prerequisites.
+
+  AR="${FROM_ARCH}-ar" CC="${FROM_ARCH}-cc" configure_binutils
+fi
+
+# Now that it's configured, build and install binutils
+
+make -j $CPUS configure-host &&
+make -j $CPUS CFLAGS="-O2 $STATIC_FLAGS" &&
+make -j $CPUS install &&
+
+# Fix up install
+
+mkdir -p "$STAGE_DIR/include" &&
+cp "$CURSRC/include/libiberty.h" "$STAGE_DIR/include" &&
+
+# ln -sf ../../../../tools/bin/ld  ${STAGE_DIR}/libexec/gcc/*/*/collect2 || dienow
+
+cleanup build-binutils
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/sections/ccwrap.sh	Sat Nov 28 18:10:43 2009 -0600
@@ -0,0 +1,56 @@
+# build and install gcc wrapper script.
+
+# Which compiler do we build the wrapper with?
+
+TEMP="${FROM_ARCH}-cc"
+[ -z "$FROM_ARCH" ] && TEMP="$CC" || LIBTYPE="-DGIMME_AN_S"
+
+# Copy compiler binaries (if not already present)
+
+if [ ! -e "$STAGE_DIR/bin/${PROGRAM_PREFIX}"rawcc ]
+then
+  # Populate the wrapper directories (unfinished)
+
+  mkdir -p "$STAGE_DIR"/{tools,include,lib,cc/{include,lib}} &&
+
+  # Setup bin directory
+
+  mkdir -p "$STAGE_DIR/bin" || dienow
+  path_search "$PATH" "${PROGRAM_PREFIX}*" \
+    'cp "$DIR/$FILE" "$STAGE_DIR/bin/$FILE"' | dot_progress
+
+  mv "$STAGE_DIR/bin/${PROGRAM_PREFIX}"{cc,rawcc} ||
+  mv "$STAGE_DIR/bin/${PROGRAM_PREFIX}"{gcc,rawcc} || dienow
+  ln -sf "${PROGRAM_PREFIX}cc" "$STAGE_DIR/bin/${PROGRAM_PREFIX}gcc" || dienow
+
+  # populate include
+
+  SYSINC_PATH="$(echo '#include <stdio.h>' | "$ARCH-cc" -E - | \
+    sed -n 's@.*"\(.*\)/stdio\.h".*@\1@p;T;q')"
+
+  # populate lib
+
+    # Need both /lib and /usr/lib.  What if libc.so linker script points to
+    # other directory?  --print-search-dirs, perhaps?
+
+  # populate cc/include
+
+  # This is the trick uClibc build uses.
+
+  CCINC_PATH="$(gcc --print-file-name=include)"
+
+  # populate cc/lib
+
+  CCLIB_PATH="$(gcc --print-file-name=crtbegin.o | sed 's@crtbegin.o$@@')"
+  # or maybe --print-search-dirs "libraries"?
+
+  # Populate tools
+fi
+
+# Build wrapper binary
+
+"$TEMP" "$SOURCES/toys/ccwrap.c" -Os -s \
+  -o "$STAGE_DIR/bin/${PROGRAM_PREFIX}cc" $LIBTYPE $STATIC_FLAGS \
+  -DGCC_UNWRAPPED_NAME='"'"${PROGRAM_PREFIX}rawcc"'"' || dienow
+
+# PACKAGE=gcc cleanup build-gcc "${STAGE_DIR}"/{lib/gcc,{libexec/gcc,gcc/lib}/install-tools,bin/${ARCH}-unknown-*}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/sections/gcc.sh	Sat Nov 28 18:10:43 2009 -0600
@@ -0,0 +1,129 @@
+# Build binutils, c wrapper, and uClibc++
+
+# PROGRAM_PREFIX affects the name of the generated tools, ala "${ARCH}-".
+
+# Force gcc to build, largely against its will.
+
+setupfor gcc-core build-gcc
+setupfor gcc-g++ build-gcc gcc-core
+
+# GCC tries to "help out in the kitchen" by screwing up the kernel include
+# files.  Surgery with sed to cut out that horrible idea throw it away.
+
+sed -i 's@^STMP_FIX.*@@' "${CURSRC}/gcc/Makefile.in" || dienow
+
+# The gcc ./configure manages to make the binutils one look sane.  Again,
+# wrap it so we can call it with different variables to beat sense out of it.
+
+function configure_gcc()
+{
+  "$CURSRC/configure" --target="$CROSS_TARGET" --prefix="$STAGE_DIR" \
+    --disable-multilib --disable-nls --enable-c99 --enable-long-long \
+    --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch \
+    --program-prefix="$PROGRAM_PREFIX" "$@" $GCC_FLAGS &&
+  mkdir -p gcc &&
+  ln -s `which ${CC_FOR_TARGET:-cc}` gcc/xgcc || dienow
+}
+
+if [ -z "$FROM_ARCH" ]
+then
+  # Produce a standard host->target cross compiler, which does not include
+  # thread support or libgcc_s.so to make it depend on the host less.
+
+  # The only prerequisite for this is binutils, above.  (It doesn't even
+  # require a C library for the target to exist yet, which is good because you
+  # have a chicken and egg problem otherwise.  What would you have compiled
+  # that C library _with_?)
+
+  AR_FOR_TARGET="${ARCH}-ar" configure_gcc \
+    --disable-threads --disable-shared --host="$CROSS_HOST"
+else
+  # Canadian cross a compiler to run on $FROM_ARCH as its host and output
+  # binaries for $ARCH as its target.
+
+  # GCC has some deep assumptions here, which are wrong.  Lots of redundant
+  # corrections are required to make it stop.
+
+  CC="${FROM_ARCH}-cc" AR="${FROM_ARCH}-ar" AS="${FROM_ARCH}-as" \
+    LD="${FROM_ARCH}-ld" NM="${FROM_ARCH}-nm" \
+    CC_FOR_TARGET="${ARCH}-cc" AR_FOR_TARGET="${ARCH}-ar" \
+    NM_FOR_TARGET="${ARCH}-nm" GCC_FOR_TARGET="${ARCH}-cc" \
+    AS_FOR_TARGET="${ARCH}-as" LD_FOR_TARGET="${ARCH}-ld" \
+    CXX_FOR_TARGET="${ARCH}-c++" \
+    ac_cv_path_AR_FOR_TARGET="${ARCH}-ar" \
+    ac_cv_path_RANLIB_FOR_TARGET="${ARCH}-ranlib" \
+    ac_cv_path_NM_FOR_TARGET="${ARCH}-nm" \
+    ac_cv_path_AS_FOR_TARGET="${ARCH}-as" \
+    ac_cv_path_LD_FOR_TARGET="${ARCH}-ld" \
+    configure_gcc --enable-threads=posix --enable-shared \
+      --build="$CROSS_HOST" --host="$CROSS_TARGET"
+fi
+
+# Now that it's configured, build and install gcc
+
+make -j $CPUS configure-host &&
+make -j $CPUS all-gcc LDFLAGS="$STATIC_FLAGS" &&
+
+# Work around gcc bug during the install: we disabled multilib but it doesn't
+# always notice.
+
+ln -s lib "$STAGE_DIR/lib64" &&
+make -j $CPUS install-gcc &&
+rm "$STAGE_DIR/lib64" &&
+
+# Move the gcc internal libraries and headers somewhere sane
+
+mkdir -p "$STAGE_DIR"/cc &&
+mv "$STAGE_DIR"/lib/gcc/*/*/include "$STAGE_DIR"/cc/include &&
+mv "$STAGE_DIR"/lib/gcc/*/* "$STAGE_DIR"/cc/lib &&
+
+# Move the compiler internal binaries into "tools"
+ln -s "$CROSS_TARGET" "$STAGE_DIR/tools" &&
+cp "$STAGE_DIR/libexec/gcc/"*/*/c* "$STAGE_DIR/tools/bin" &&
+rm -rf "$STAGE_DIR/libexec" || dienow
+
+# collect2 is evil, kill it.
+# ln -sf ../../../../tools/bin/ld  ${STAGE_DIR}/libexec/gcc/*/*/collect2 || dienow
+
+if [ ! -z "$FROM_ARCH" ]
+then
+  # We also need to beat libsupc++ out of gcc (which uClibc++ needs to build).
+  # But don't want to build the whole of libstdc++-v3 because
+  # A) we're using uClibc++ instead,  B) the build breaks.
+
+  # The libsupc++ ./configure dies if run after the simple cross compiling
+  # ./configure, because gcc's build system is overcomplicated crap, so skip
+  # the uClibc++ build first time around and only do it for the canadian cross
+  # builds.  (The simple cross compiler still needs basic C++ support to build
+  # the C++ libraries with, though.)
+
+  make -j $CPUS configure-target-libstdc++-v3 &&
+  cd "$CROSS_TARGET"/libstdc++-v3/libsupc++ &&
+  make -j $CPUS &&
+  mv .libs/libsupc++.a "$STAGE_DIR"/cc/lib || dienow
+fi
+
+# Prepare for ccwrap
+
+mv "$STAGE_DIR/bin/${PROGRAM_PREFIX}"{gcc,rawcc} &&
+ln -s "${PROGRAM_PREFIX}cc" "$STAGE_DIR/bin/${PROGRAM_PREFIX}gcc" &&
+
+# Wrap C++ too.
+
+mv "$STAGE_DIR/bin/${PROGRAM_PREFIX}"{g++,raw++} &&
+rm -f "$STAGE_DIR/bin/${PROGRAM_PREFIX}c++" &&
+ln -s "${PROGRAM_PREFIX}cc" "$STAGE_DIR/bin/${PROGRAM_PREFIX}g++" &&
+ln -s "${PROGRAM_PREFIX}cc" "$STAGE_DIR/bin/${PROGRAM_PREFIX}c++" || dienow
+
+# Make sure "tools" has everything distccd needs.
+
+cd "$STAGE_DIR/tools" || dienow
+ln -s ../../bin/${PROGRAM_PREFIX}rawcc "$STAGE_DIR/tools/bin/gcc" 2>/dev/null
+ln -s ../../bin/${PROGRAM_PREFIX}rawcc "$STAGE_DIR/tools/bin/cc" 2>/dev/null
+ln -s ../../bin/${PROGRAM_PREFIX}raw++ "$STAGE_DIR/tools/bin/g++" 2>/dev/null
+ln -s ../../bin/${PROGRAM_PREFIX}raw++ "$STAGE_DIR/tools/bin/c++" 2>/dev/null
+
+rm -rf build-gcc # "${STAGE_DIR}"/{lib/gcc,{libexec/gcc,gcc/lib}/install-tools,bin/${ARCH}-unknown-*}
+
+mv "$WORK"/{gcc-core,gcc}
+PACKAGE=gcc cleanup
--- a/sources/toys/ccwrap.c	Thu Nov 26 14:53:29 2009 -0600
+++ b/sources/toys/ccwrap.c	Sat Nov 28 18:10:43 2009 -0600
@@ -317,15 +317,15 @@
 						// Find this entry in the library path.
 						for(itemp=0;;itemp++) {
 							if (itemp == lplen)
-								xasprintf(&temp, "%s/gcc/lib/%s", devprefix,
+								xasprintf(&temp, "%s/cc/lib/%s", devprefix,
 									temp2);
 							else if (itemp == lplen+1)
 								xasprintf(&temp, "%s/lib/%s", devprefix, temp2);
 
-							// This is so "include" finds the gcc internal
+							// This is so "include" finds the cc internal
 							// include dir.  The uClibc build needs this.
 							else if (itemp == lplen+2)
-								xasprintf(&temp, "%s/gcc/%s", devprefix, temp2);
+								xasprintf(&temp, "%s/cc/%s", devprefix, temp2);
 							else if (itemp == lplen+3) {
 								temp = temp2;
 								break;
@@ -405,7 +405,7 @@
 		if (libstr) gcc_argv[argcnt++] = libstr;
 
 		xasprintf(gcc_argv+(argcnt++), "-L%s/lib", devprefix);
-		xasprintf(gcc_argv+(argcnt++), "-L%s/gcc/lib", devprefix);
+		xasprintf(gcc_argv+(argcnt++), "-L%s/cc/lib", devprefix);
 	}
 	if (use_stdinc && source_count) {
 		gcc_argv[argcnt++] = nostdinc;
@@ -419,7 +419,7 @@
 		gcc_argv[argcnt++] = "-isystem";
 		xasprintf(gcc_argv+(argcnt++), "%s/include", devprefix);
 		gcc_argv[argcnt++] = "-isystem";
-		xasprintf(gcc_argv+(argcnt++), "%s/gcc/include", devprefix);
+		xasprintf(gcc_argv+(argcnt++), "%s/cc/include", devprefix);
 		if (incstr) gcc_argv[argcnt++] = incstr;
 	}
 
@@ -432,7 +432,7 @@
 
 		if (ctor_dtor) {
 			xasprintf(gcc_argv+(argcnt++), "%s/lib/crti.o", devprefix);
-			xasprintf(gcc_argv+(argcnt++), "%s/gcc/lib/crtbegin%s", devprefix,
+			xasprintf(gcc_argv+(argcnt++), "%s/cc/lib/crtbegin%s", devprefix,
 					use_shared ? "S.o" : use_static_linking ? "T.o" : ".o");
 		}
 		if (use_start && !profile)
@@ -460,7 +460,7 @@
 			//gcc_argv[argcnt++] = "-Wl,--end-group";
 		}
 		if (ctor_dtor) {
-			xasprintf(gcc_argv+(argcnt++), "%s/gcc/lib/crtend%s", devprefix,
+			xasprintf(gcc_argv+(argcnt++), "%s/cc/lib/crtend%s", devprefix,
 					use_shared ? "S.o" : ".o");
 			xasprintf(gcc_argv+(argcnt++), "%s/lib/crtn.o", devprefix);
 		}