diff -Naur crosstool-0.28-rc5-orig/all.sh crosstool-0.28-rc5/all.sh --- crosstool-0.28-rc5-orig/all.sh 2004-03-30 22:37:37.000000000 -0800 +++ crosstool-0.28-rc5/all.sh 2004-06-19 12:17:30.000000000 -0700 @@ -17,7 +17,13 @@ test -z "${BINUTILS_DIR}" && abort "Please set BINUTILS_DIR to the bare filename of the binutils tarball or directory" test -z "${GCC_DIR}" && abort "Please set GCC_DIR to the bare filename of the gcc tarball or directory" test -z "${LINUX_DIR}" && abort "Please set LINUX_DIR to the bare filename of the kernel tarball or directory" -test -z "${GLIBC_DIR}" && abort "Please set GLIBC_DIR to the bare filename of the glibc tarball or directory" +test -z "${LIBC_DIR}" && abort "Please set LIBC_DIR to the bare filename of the C library tarball or directory" +test -z "${C_LIBRARY}" && abort "Please set C_LIBRARY to 'glibc' or 'uclibc'" +case ${C_LIBRARY} in + glibc) ;; + uclibc) ;; + *) abort "Unsupported C library ${C_LIBRARY}; please set C_LIBRARY to 'glibc' or 'uclibc'" +esac # Three environment variables are optional, namely: test -z "${DEJAGNU}" && echo "DEJAGNU not set, so not running any regression tests" @@ -32,7 +38,7 @@ set -ex -TOOLCOMBO=$GCC_DIR-$GLIBC_DIR +TOOLCOMBO=$GCC_DIR-$LIBC_DIR BUILD_DIR=`pwd`/build/$TARGET/$TOOLCOMBO TOP_DIR=`pwd` @@ -43,15 +49,17 @@ fi # Sanity checks -case x$PREFIX in -x/) abort "Don't set PREFIX to /, as \$PREFIX gets deleted!" ;; -x/usr) abort "Don't set PREFIX to /usr, as \$PREFIX gets deleted!" ;; -*) ;; -esac +if test "x${PREFIX_NO_REMOVE}" = "x"; then + case x$PREFIX in + x/) abort "Don't set PREFIX to /, as \$PREFIX gets deleted!" ;; + x/usr) abort "Don't set PREFIX to /usr, as \$PREFIX gets deleted!" ;; + *) ;; + esac +fi case x$USER in -xroot) abort "Don't run all.sh or crosstool.sh as root, it's dangerous" ;; -*) ;; + xroot) abort "Don't run all.sh or crosstool.sh as root, it's dangerous" ;; + *) ;; esac # Arbitrary locations for the input and output of the build. @@ -96,15 +104,19 @@ if test "$opt_no_build" = ""; then # Build - rm -rf $PREFIX - mkdir -p $PREFIX + if test "x${PREFIX_NO_REMOVE}" = "x"; then + rm -rf $PREFIX + mkdir -p $PREFIX + else + rm -rf $PREFIX/$TARGET + fi mkdir -p $BUILD_DIR cd $BUILD_DIR sh $TOP_DIR/crosstool.sh cd $TOP_DIR # Cute little compile test - sh testhello.sh + sh testhello.sh $GCC_LANGUAGES fi if test "$opt_builduserland" = "1"; then diff -Naur crosstool-0.28-rc5-orig/crosstest.sh crosstool-0.28-rc5/crosstest.sh --- crosstool-0.28-rc5-orig/crosstest.sh 2004-03-18 10:22:32.000000000 -0800 +++ crosstool-0.28-rc5/crosstest.sh 2004-06-19 12:17:30.000000000 -0700 @@ -23,7 +23,13 @@ test -z "${BUILD_DIR}" && abort "Please set BUILD_DIR to the directory build-gcc etc. live in" test -z "${BINUTILS_DIR}" && abort "Please set BINUTILS_DIR to the bare filename of the binutils tarball or directory" test -z "${GCC_DIR}" && abort "Please set GCC_DIR to the bare filename of the gcc tarball or directory" -test -z "${GLIBC_DIR}" && abort "Please set GLIBC_DIR to the bare filename of the glibc tarball or directory" +test -z "${LIBC_DIR}" && abort "Please set LIBC_DIR to the bare filename of the C library tarball or directory" +test -z "${C_LIBRARY}" && abort "Please set C_LIBRARY to 'glibc' or 'uclibc'" +case ${C_LIBRARY} in + glibc) ;; + uclibc) ;; + *) abort "Unsupported C library ${C_LIBRARY}; please set C_LIBRARY to 'glibc' or 'uclibc'" +esac test -z "${TARGET}" && abort "Please set TARGET to the Gnu target identifier (e.g. pentium-linux)" test -z "${TARGET_CFLAGS}" && abort "Please set TARGET_CFLAGS to any compiler flags needed when building glibc (-O recommended)" test -z "${TOP_DIR}" && abort "Please set TOP_DIR to where the crosstool scripts live" @@ -108,7 +114,7 @@ find . -name '*.log' | xargs rm -f #--- glibc tests --- -if true; then +if test "${C_LIBRARY}" = glibc ; then cd build-glibc make tests @@ -184,7 +190,7 @@ echo "Some glibc test failed. Check logfiles on target in /jail/build-glibc/*/*.out." fi # it's not really a summary yet, but let's copy it up anyway -cp glibctest.out $TOP_DIR/$TARGET-$GCC_DIR-$GLIBC_DIR.glibc.sum +cp glibctest.out $TOP_DIR/$TARGET-$GCC_DIR-$LIBC_DIR.glibc.sum fi #--- gcc tests --- @@ -253,7 +259,7 @@ # Run standard test log analysis tool sh ../${GCC_DIR}/contrib/test_summary | sed '1d;/EOF/,$d' > test_summary.log -cp test_summary.log $TOP_DIR/$TARGET-$GCC_DIR-$GLIBC_DIR.gcc.sum +cp test_summary.log $TOP_DIR/$TARGET-$GCC_DIR-$LIBC_DIR.gcc.sum cd .. @@ -269,7 +275,7 @@ echo "" >> test_summary.log done -cp test_summary.log $TOP_DIR/$TARGET-$GCC_DIR-$GLIBC_DIR.binutils.sum +cp test_summary.log $TOP_DIR/$TARGET-$GCC_DIR-$LIBC_DIR.binutils.sum cd .. diff -Naur crosstool-0.28-rc5-orig/crosstool.sh crosstool-0.28-rc5/crosstool.sh --- crosstool-0.28-rc5-orig/crosstool.sh 2004-04-11 02:06:56.000000000 -0700 +++ crosstool-0.28-rc5/crosstool.sh 2004-06-19 12:17:30.000000000 -0700 @@ -24,7 +24,13 @@ test -z "${SRC_DIR}" && abort "Please set SRC_DIR to the directory where the source tarballs are to be unpacked" test -z "${BINUTILS_DIR}" && abort "Please set BINUTILS_DIR to the bare filename of the binutils tarball or directory" test -z "${GCC_DIR}" && abort "Please set GCC_DIR to the bare filename of the gcc tarball or directory" -test -z "${GLIBC_DIR}" && abort "Please set GLIBC_DIR to the bare filename of the glibc tarball or directory" +test -z "${LIBC_DIR}" && abort "Please set LIBC_DIR to the bare filename of the C library tarball or directory" +test -z "${C_LIBRARY}" && abort "Please set C_LIBRARY to 'glibc' or 'uclibc'" +case ${C_LIBRARY} in + glibc) ;; + uclibc) ;; + *) abort "Unsupported C library ${C_LIBRARY}; please set C_LIBRARY to 'glibc' or 'uclibc'" +esac test -z "${LINUX_DIR}" && abort "Please set LINUX_DIR to the bare filename of the kernel tarball or directory" test -z "${TARGET}" && abort "Please set TARGET to the Gnu target identifier (e.g. pentium-linux)" test -z "${TARGET_CFLAGS}" && abort "Please set TARGET_CFLAGS to any compiler flags needed when building glibc (-O recommended)" @@ -33,10 +39,12 @@ test -z "${GCC_EXTRA_CONFIG}" && echo "GCC_EXTRA_CONFIG not set, so not passing any extra options to gcc's configure script" test -z "${GLIBC_EXTRA_CONFIG}" && echo "GLIBC_EXTRA_CONFIG not set, so not passing any extra options to glibc's configure script" test -z "${GLIBC_EXTRA_ENV}" && echo "GLIBC_EXTRA_ENV not set, so not passing any extra environment variables to glibc's configure script" -test -z "${KERNELCONFIG}" && test -z ${LINUX_DIR}/.config && echo "KERNELCONFIG not set, and no .config file found, so not configuring linux kernel" +test -z "${KERNELCONFIG}" && test '!' -f ${LINUX_DIR}/.config && echo "KERNELCONFIG not set, and no .config file found, so not configuring linux kernel" +test "${C_LIBRARY}" = uclibc && test -z "${UCLIBCCONFIG}" && test '!' -f ${LIBC_DIR}/.config && echo "UCLIBCCONFIG not set, and no .config file found, so using a default config\n You will probably want to change this." test -z "${USE_SYSROOT}" && echo "USE_SYSROOT not set, so not configuring with --with-sysroot" test -z "${KERNELCONFIG}" || test -r "${KERNELCONFIG}" || abort "Can't read file KERNELCONFIG = $KERNELCONFIG, please fix." +test -z "${UCLIBCCONFIG}" || test -r "${UCLIBCCONFIG}" || abort "Can't read file UCLIBCCONFIG = $UCLIBCCONFIG, please fix." test -z "${LD_LIBRARY_PATH}" || abort "glibc refuses to build if LD_LIBRARY_PATH is set. Please unset it before running this script." @@ -46,7 +54,9 @@ GCC_LANGUAGES=${GCC_LANGUAGES-c,c++} # And one is derived. -GLIBCTHREADS_FILENAME=`echo $GLIBC_DIR | sed 's/glibc-/glibc-linuxthreads-/'` +if test "${C_LIBRARY}" = glibc ; then + GLIBCTHREADS_FILENAME=`echo $LIBC_DIR | sed 's/glibc-/glibc-linuxthreads-/'` +fi # Check for a few prerequisites that have tripped people up. awk '/x/' < /dev/null || abort "You need awk to build a toolchain." @@ -83,7 +93,7 @@ BINUTILS_DIR=`cd ${SRC_DIR}/${BINUTILS_DIR}; pwd` GCC_DIR=`cd ${SRC_DIR}/${GCC_DIR}; pwd` LINUX_DIR=`cd ${SRC_DIR}/${LINUX_DIR}; pwd` -GLIBC_DIR=`cd ${SRC_DIR}/${GLIBC_DIR}; pwd` +LIBC_DIR=`cd ${SRC_DIR}/${LIBC_DIR}; pwd` # make sure the build product's binaries are in the search path PATH="${PREFIX}/bin:${PATH}" @@ -183,6 +193,60 @@ test -x ${PREFIX}/bin/${TARGET}-ld || abort Build failed during binutils #--------------------------------------------------------- +# +# A few functions for configuring uClibc, since they're used twice +defaultuClibcConfig() { + make defconfig + UCARCH=${ARCH} + if test "${UCARCH}" = "ppc"; then + UCARCH=powerpc + fi + + cat > munge-defconfig.sed <<-ENDSED + s/^\\(TARGET_.*\\)=y$/\\# \\1 is not set/ + s/^\\# TARGET_${UCARCH} is not set/TARGET_${UCARCH}=y/ + s/^TARGET_ARCH=".*"/TARGET_ARCH="${UCARCH}"/ + s/^\\(TARGET_.*_ENDIAN\\)=y/\\# \\1 is not set/ +ENDSED + sed -i -f munge-defconfig.sed .config +} + +correctuClibcConfig() { + # Change paths to work with crosstool + QUOTED_LINUX_DIR=`echo ${LINUX_DIR} | sed -e 's/\//\\\\\//g'` + cat > munge-oldconfig.sed <<-ENDSED + s/^DEVEL_PREFIX=".*"/DEVEL_PREFIX="\\/"/ + s/^RUNTIME_PREFIX=".*"/RUNTIME_PREFIX="\\/"/ + s/^KERNEL_SOURCE=".*"/KERNEL_SOURCE="${QUOTED_LINUX_DIR}"/ + s/^UCLIBC_DOWNLOAD_PREGENERATED_LOCALE=y/\\# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE is not set/ +ENDSED + # Force on options needed for C++ if we'll be making a C++ compiler. + # Note that the two PREGEN_LOCALE and the XLOCALE lines may be missing + # entirely if LOCALE is not set. If LOCALE was already set, we'll + # assume the user has already made all the appropriate generation + # arrangements. Note that having the uClibc Makefile download the + # pregenerated locales is not compatible with crosstool; besides, + # crosstool downloads them as part of getandpatch.sh. + if echo "$TESTLANG" | egrep "(^|,)c++(,|\$)"; then + cat >> munge-oldconfig.sed <<-ENDSED + s/^\\# DO_C99_MATH is not set/DO_C99_MATH=y/ + s/^\\# UCLIBC_CTOR_DTOR is not set/UCLIBC_CTOR_DTOR=y/ +ENDSED + if grep -v UCLIBC_HAS_GETTEXT_AWARENESS .config; then + # This one often slips through the cracks when script-adding + # locale support + cat >> munge-oldconfig.sed <<-ENDSED + /UCLIBC_HAS_GNU_GETOPT/ i \\ + \\# UCLIBC_HAS_GETTEXT_AWARENESS is not set\\n +ENDSED + fi + fi + sed -i -f munge-oldconfig.sed .config +# s/^\\# UCLIBC_HAS_WCHAR is not set/UCLIBC_HAS_WCHAR=y/ +# s/^\\# UCLIBC_HAS_LOCALE is not set/UCLIBC_HAS_LOCALE=y\\nUCLIBC_PREGENERATED_LOCALE_DATA=y\\n\\# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set\\n\\# UCLIBC_HAS_XLOCALE is not set/ +} + +#--------------------------------------------------------- echo "Install glibc headers needed to build bootstrap compiler -- but only if gcc-3.x" # Only need to install bootstrap glibc headers for gcc-3.0 and above? Or maybe just gcc-3.3 and above? @@ -190,55 +254,102 @@ # See also http://gcc.gnu.org/PR8180, which complains about the need for this step. # Don't install them if they're already there (it's really slow) if grep -q gcc-3 ${GCC_DIR}/ChangeLog && test '!' -f $HEADERDIR/features.h; then - mkdir -p build-glibc-headers; cd build-glibc-headers + mkdir -p build-libc-headers; cd build-libc-headers - if test '!' -f Makefile; then - # The following three things have to be done to build glibc-2.3.x, but they don't hurt older versions. - # 1. override CC to keep glibc's configure from using $TARGET-gcc. - # 2. disable linuxthreads, which needs a real cross-compiler to generate tcb-offsets.h properly - # 3. build with gcc 3.2 or later - # Compare these options with the ones used when building glibc for real below - they're different. - # As of glibc-2.3.2, to get this step to work for hppa-linux, you need --enable-hacker-mode - # so when configure checks to make sure gcc has access to the assembler you just built... - # Alternately, we could put ${PREFIX}/${TARGET}/bin on the path. - # Set --build so maybe we don't have to specify "cross-compiling=yes" below (haven't tried yet) - # Note: the warning - # "*** WARNING: Are you sure you do not want to use the `linuxthreads'" - # *** add-on?" - # is ok here, since all we want are the basic headers at this point. - # build and host are a bit odd, but --host=$TARGET picks the right target, - # and --build=$HOST keeps it from thinking it's a native toolchain ever - CC=gcc \ - ${GLIBC_DIR}/configure --host=$TARGET --prefix=/usr \ - --build=$HOST \ - --without-cvs --disable-sanity-checks --with-headers=$HEADERDIR \ - --enable-hacker-mode - fi - - if grep -q GLIBC_2.3 ${GLIBC_DIR}/ChangeLog; then - # glibc-2.3.x passes cross options to $(CC) when generating errlist-compat.c, which fails without a real cross-compiler. - # Fortunately, we don't need errlist-compat.c, since we just need .h files, - # so work around this by creating a fake errlist-compat.c and satisfying its dependencies. - # Another workaround might be to tell configure to not use any cross options to $(CC). - # The real fix would be to get install-headers to not generate errlist-compat.c. - make sysdeps/gnu/errlist.c - mkdir -p stdio-common - touch stdio-common/errlist-compat.c - fi - make cross-compiling=yes install_root=${SYSROOT} $GLIBC_SYSROOT_ARG install-headers + case ${C_LIBRARY} in + glibc) - # Two headers -- stubs.h and features.h -- aren't installed by install-headers, - # so do them by hand. We can tolerate an empty stubs.h for the moment. - # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html - - mkdir -p $HEADERDIR/gnu - touch $HEADERDIR/gnu/stubs.h - cp ${GLIBC_DIR}/include/features.h $HEADERDIR/features.h - # Building the bootstrap gcc requires either setting inhibit_libc, or - # having a copy of stdio_lim.h... see - # http://sources.redhat.com/ml/libc-alpha/2003-11/msg00045.html - cp bits/stdio_lim.h $HEADERDIR/bits/stdio_lim.h + if test '!' -f Makefile; then + # The following three things have to be done to build + # glibc-2.3.x, but they don't hurt older versions. + # 1. override CC to keep glibc's configure from using + # $TARGET-gcc. + # 2. disable linuxthreads, which needs a real cross-compiler + # to generate tcb-offsets.h properly + # 3. build with gcc 3.2 or later + # Compare these options with the ones used when building + # glibc for real below - they're different. + # As of glibc-2.3.2, to get this step to work for hppa-linux, + # you need --enable-hacker-mode so when configure checks to + # make sure gcc has access to the assembler you just built... + # Alternately, we could put ${PREFIX}/${TARGET}/bin on the + # path. Set --build so maybe we don't have to specify + # "cross-compiling=yes" below (haven't tried yet) + # Note: the warning + # "*** WARNING: Are you sure you do not want to use the + # `linuxthreads' add-on? ***" + # is ok here, since all we want are the basic headers at + # this point. build and host are a bit odd, but --host=$TARGET + # picks the right target, and --build=$HOST keeps it from + # thinking it's a native toolchain ever + CC=gcc \ + ${LIBC_DIR}/configure --host=$TARGET --prefix=/usr \ + --build=$BUILD \ + --without-cvs --disable-sanity-checks \ + --with-headers=${PREFIX}/${TARGET}/include \ + --enable-hacker-mode + fi + + if grep -q GLIBC_2.3 ${LIBC_DIR}/ChangeLog; then + # glibc-2.3.x passes cross options to $(CC) when generating + # errlist-compat.c, which fails without a real cross-compiler. + # Fortunately, we don't need errlist-compat.c, since we just + # need .h files, so work around this by creating a fake + # errlist-compat.c and satisfying its dependencies. + # Another workaround might be to tell configure to not use any + # cross options to $(CC). The real fix would be to get + # install-headers to not generate errlist-compat.c. + make sysdeps/gnu/errlist.c + mkdir -p stdio-common + touch stdio-common/errlist-compat.c + fi + make cross-compiling=yes install_root=${SYSROOT} \ + ${GLIBC_SYSROOT_ARG} install-headers + + # Two headers -- stubs.h and features.h -- aren't installed by + # install-headers, so do them by hand. We can tolerate an empty + # stubs.h for the moment. + # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html + + mkdir -p $HEADERDIR/gnu + touch $HEADERDIR/gnu/stubs.h + cp ${LIBC_DIR}/include/features.h $HEADERDIR/features.h + + # Building the bootstrap gcc requires either setting inhibit_libc, + # or having a copy of stdio_lim.h... + # see http://sources.redhat.com/ml/libc-alpha/2003-11/msg00045.html + cp bits/stdio_lim.h $HEADERDIR/bits/stdio_lim.h + + ;; + + uclibc) + if test '!' -f Makefile; then + perl ${LIBC_DIR}/relocate + fi + + # Go find a .config, or make a new default one. + if test '!' -f .config; then + if test -z "${UCLIBCCONFIG}"; then + if test -f ${LIBC_DIR}/.config; then + cp ${LIBC_DIR}/.config .config + else + defaultuClibcConfig + fi + else + cp ${UCLIBCCONFIG} .config + fi + fi + + correctuClibcConfig + + # uClibc uses the CROSS environment variable as a prefix to the + # compiler tools to use. Setting it to the empty string forces + # use of the native build host tools, which we need at this + # stage, as we don't have target tools yet. + CROSS= PREFIX=${SYSROOT}/ make headers install_headers + ;; + esac cd .. fi @@ -254,14 +365,14 @@ --with-local-prefix=${SYSROOT} \ --disable-multilib \ --with-newlib \ - ${GCC_EXTRA_CONFIG} \ ${GCC_SYSROOT_ARG_CORE} \ --disable-nls \ --enable-threads=no \ --enable-symvers=gnu \ --enable-__cxa_atexit \ - --enable-languages=c \ - --disable-shared + --enable-languages=c \ + --disable-shared \ + ${GCC_EXTRA_CONFIG} fi make $PARALLELMFLAGS all-gcc install-gcc @@ -273,72 +384,119 @@ #--------------------------------------------------------- echo Build glibc and linuxthreads -mkdir -p build-glibc; cd build-glibc +mkdir -p build-libc; cd build-libc -# sh4 really needs to set configparms as of gcc-3.4/glibc-2.3.2 -# note: this is awkward, doesn't work well if you need more than one line in configparms -echo ${GLIBC_CONFIGPARMS} > configparms +case ${C_LIBRARY} in + glibc) + # sh4 really needs to set configparms as of gcc-3.4/glibc-2.3.2 + # note: this is awkward, doesn't work well if you need more than + # one line in configparms + echo ${GLIBC_CONFIGPARMS} > configparms + + if test '!' -f Makefile; then + # Configure with --prefix the way we want it on the target... + # There are a whole lot of settings here. You'll probably want + # to read up on what they all mean, and customize a bit. + # e.g. I picked --enable-kernel=2.4.3 here just because it's the + # kernel Bill used in his example gcc2.95.3 script. That means + # some backwards compatibility stuff is turned on in glibc that + # you may not need if you're using a newer kernel. Compare + # these options with the ones used when installing the glibc + # headers above - they're different. Adding "--without-gd" + # option to avoid error "memusagestat.c:36:16: gd.h: No such + # file or directory" See also: + # http://sources.redhat.com/ml/libc-alpha/2000-07/msg00024.html + # Set BUILD_CC, or you won't be able to build datafiles + # Set --build, else glibc-2.3.2 will think you're not + # cross-compiling, and try to run the test programs + + BUILD_CC=gcc CFLAGS="$TARGET_CFLAGS" CC=${TARGET}-gcc \ + AR=${TARGET}-ar RANLIB=${TARGET}-ranlib \ + ${LIBC_DIR}/configure --host=$TARGET --prefix=/usr \ + --build=$HOST ${GLIBC_EXTRA_CONFIG} \ + --without-tls --without-__thread --enable-kernel=2.4.3 \ + --without-cvs --disable-profile --disable-debug --without-gd \ + --enable-add-ons --with-headers=$HEADERDIR + fi + + # If this fails with an error like this: + # ... linux/autoconf.h: No such file or directory + # then you need to set the KERNELCONFIG variable to point to a + # .config file for this arch. The following architectures are + # known to need kernel .config: alpha, arm, ia64, s390, sh, sparc + # Note: LD and RANLIB needed by glibc-2.1.3's c_stub directory, + # at least on macosx. No need for PARALLELMFLAGS here, Makefile + # already reads this environment variable + make LD=${TARGET}-ld RANLIB=${TARGET}-ranlib + make install install_root=${SYSROOT} $GLIBC_SYSROOT_ARG + + # This doesn't seem to work when building a crosscompiler, + # as it tries to execute localedef using the just-build ld.so!? + #make localedata/install-locales install_root=${SYSROOT} + + # Fix problems in linker scripts. + # + # 1. Remove absolute paths + # Any file in a list of known suspects that isn't a symlink is + # assumed to be a linker script. + # FIXME: test -h is not portable + # FIXME: probably need to check more files than just these three... + # Need to use sed instead of just assuming we know what's in libc.so + # because otherwise alpha breaks. But won't need to do this at all + # once we use --with-sysroot (available in gcc-3.3.3 and up) + # + # 2. Remove lines containing BUG per: + # http://sources.redhat.com/ml/bug-glibc/2003-05/msg00055.html, + # needed to fix gcc-3.2.3/glibc-2.3.2 targeting arm + # + # To make "strip *.so.*" not fail (ptxdist does this), rename to + # .so_orig rather than .so.orig + for file in libc.so libpthread.so libgcc_s.so; do + for lib in lib lib64 usr/lib usr/lib64; do + if test -f ${SYSROOT}/$lib/$file && test ! -h ${SYSROOT}/$lib/$file; then + mv ${SYSROOT}/$lib/$file ${SYSROOT}/$lib/${file}_orig + if test -z "$USE_SYSROOT"; then + sed 's,/usr/lib/,,g;s,/usr/lib64/,,g;s,/lib/,,g;s,/lib64/,,g;/BUG in libc.scripts.output-format.sed/d' < ${SYSROOT}/$lib/${file}_orig > ${SYSROOT}/$lib/$file + else + sed '/BUG in libc.scripts.output-format.sed/d' < ${SYSROOT}/$lib/${file}_orig > ${SYSROOT}/$lib/$file + fi + fi + done + done + + ;; + + uclibc) + if test '!' -f Makefile; then + perl ${LIBC_DIR}/relocate + fi + + # Go find a .config, or make a new default one. + if test '!' -f .config; then + if test -f ../build-libc-headers/.config; then + cp ../build-libc-headers/.config .config + elif test -z "${UCLIBCCONFIG}"; then + if test -f ${LIBC_DIR}/.config; then + cp ${LIBC_DIR}/.config .config + else + defaultuClibcConfig + fi + else + cp ${UCLIBCCONFIG} .config + fi + fi + + correctuClibcConfig + + # uClibc uses the CROSS environment variable as a prefix to the + # compiler tools to use. The newly built tools should be in our + # path, so we need only give the correct name for them. + CROSS=${TARGET}- PREFIX=${PREFIX}/${TARGET}/ \ + make all install -if test '!' -f Makefile; then - # Configure with --prefix the way we want it on the target... - # There are a whole lot of settings here. You'll probably want - # to read up on what they all mean, and customize a bit. - # e.g. I picked --enable-kernel=2.4.3 here just because it's the kernel Bill - # used in his example gcc2.95.3 script. That means some backwards compatibility - # stuff is turned on in glibc that you may not need if you're using a newer kernel. - # Compare these options with the ones used when installing the glibc headers above - they're different. - # Adding "--without-gd" option to avoid error "memusagestat.c:36:16: gd.h: No such file or directory" - # See also http://sources.redhat.com/ml/libc-alpha/2000-07/msg00024.html. - # Set BUILD_CC, or you won't be able to build datafiles - # Set --build, else glibc-2.3.2 will think you're not cross-compiling, and try to run the test programs - - BUILD_CC=gcc CFLAGS="$TARGET_CFLAGS" CC=${TARGET}-gcc AR=${TARGET}-ar RANLIB=${TARGET}-ranlib \ - ${GLIBC_DIR}/configure --host=$TARGET --prefix=/usr \ - --build=$HOST \ - ${GLIBC_EXTRA_CONFIG} \ - --without-tls --without-__thread --enable-kernel=2.4.3 \ - --without-cvs --disable-profile --disable-debug --without-gd \ - --enable-add-ons --with-headers=$HEADERDIR -fi + ;; -# If this fails with an error like this: -# ... linux/autoconf.h: No such file or directory -# then you need to set the KERNELCONFIG variable to point to a .config file for this arch. -# The following architectures are known to need kernel .config: alpha, arm, ia64, s390, sh, sparc -# Note: LD and RANLIB needed by glibc-2.1.3's c_stub directory, at least on macosx -# No need for PARALLELMFLAGS here, Makefile already reads this environment variable -make LD=${TARGET}-ld RANLIB=${TARGET}-ranlib -make install install_root=${SYSROOT} $GLIBC_SYSROOT_ARG - -# This doesn't seem to work when building a crosscompiler, -# as it tries to execute localedef using the just-build ld.so!? -#make localedata/install-locales install_root=${SYSROOT} - -# Fix problems in linker scripts. -# -# 1. Remove absolute paths -# Any file in a list of known suspects that isn't a symlink is assumed to be a linker script. -# FIXME: test -h is not portable -# FIXME: probably need to check more files than just these three... -# Need to use sed instead of just assuming we know what's in libc.so because otherwise alpha breaks -# But won't need to do this at all once we use --with-sysroot (available in gcc-3.3.3 and up) -# -# 2. Remove lines containing BUG per http://sources.redhat.com/ml/bug-glibc/2003-05/msg00055.html, -# needed to fix gcc-3.2.3/glibc-2.3.2 targeting arm -# -# To make "strip *.so.*" not fail (ptxdist does this), rename to .so_orig rather than .so.orig -for file in libc.so libpthread.so libgcc_s.so; do - for lib in lib lib64 usr/lib usr/lib64; do - if test -f ${SYSROOT}/$lib/$file && test ! -h ${SYSROOT}/$lib/$file; then - mv ${SYSROOT}/$lib/$file ${SYSROOT}/$lib/${file}_orig - if test -z "$USE_SYSROOT"; then - sed 's,/usr/lib/,,g;s,/usr/lib64/,,g;s,/lib/,,g;s,/lib64/,,g;/BUG in libc.scripts.output-format.sed/d' < ${SYSROOT}/$lib/${file}_orig > ${SYSROOT}/$lib/$file - else - sed '/BUG in libc.scripts.output-format.sed/d' < ${SYSROOT}/$lib/${file}_orig > ${SYSROOT}/$lib/$file - fi - fi - done -done +esac cd .. test -f ${SYSROOT}/lib/libc.a || test -f ${SYSROOT}/lib64/libc.a || test -f ${SYSROOT}/usr/lib/libc.a || test -f ${SYSROOT}/usr/lib64/libc.a || abort Building libc failed @@ -349,22 +507,36 @@ mkdir -p build-gcc; cd build-gcc if test '!' -f Makefile; then - # --enable-symvers=gnu really only needed for sh4 to work around a detection problem - # only matters for gcc-3.2.x and later, I think - # --disable-nls to work around crash bug on ppc405, but also because embedded - # systems don't really need message catalogs... + # --enable-symvers=gnu really only needed for sh4 to work around a + # detection problem; only matters for gcc-3.2.x and later, I think + # --disable-nls to work around crash bug on ppc405, but also because + # embedded systems don't really need message catalogs... + GCC_DEFAULT_OPTIONS="--disable-nls \ + --enable-threads=posix \ + --enable-symvers=gnu \ + --enable-languages="$GCC_LANGUAGES" \ + --enable-shared \ + --enable-c99 \ + --enable-long-long" + case ${C_LIBRARY} in + glibc) + GCC_DEFAULT_OPTIONS="$GCC_DEFAULT_OPTIONS --enable-__cxa_atexit" + ;; + *) + GCC_DEFAULT_OPTIONS="$GCC_DEFAULT_OPTIONS --disable-__cxa_atexit" + ;; + esac + for GCC_DEFAULT_OPTION in $GCC_DEFAULT_OPTIONS ; do + GCC_SEARCH_OPTION=`echo "$GCC_DEFAULT_OPTION" | sed -e 's/^--en//' \ + -e 's/^--dis//' -e 's/=.*//'` + if echo "$GCC_EXTRA_CONFIG" | grep -v "$GCC_SEARCH_OPTION"; then + GCC_EXTRA_CONFIG="$GCC_EXTRA_CONFIG $GCC_DEFAULT_OPTION" + fi + done ${GCC_DIR}/configure --target=$TARGET --host=$HOST --prefix=$PREFIX \ - ${GCC_EXTRA_CONFIG} \ - $GCC_SYSROOT_ARG \ + ${GCC_SYSROOT_ARG} \ --with-local-prefix=${SYSROOT} \ - --disable-nls \ - --enable-threads=posix \ - --enable-symvers=gnu \ - --enable-__cxa_atexit \ - --enable-languages="$GCC_LANGUAGES" \ - --enable-shared \ - --enable-c99 \ - --enable-long-long + ${GCC_EXTRA_CONFIG} fi make $PARALLELMFLAGS all diff -Naur crosstool-0.28-rc5-orig/demoptx.sh crosstool-0.28-rc5/demoptx.sh --- crosstool-0.28-rc5-orig/demoptx.sh 2004-04-16 22:14:38.000000000 -0700 +++ crosstool-0.28-rc5/demoptx.sh 2004-06-19 12:17:30.000000000 -0700 @@ -12,9 +12,11 @@ #GCC_DIR=gcc-3.3.1 GCC_DIR=gcc-2.95.3 -#GLIBC_DIR=glibc-2.3.2 -GLIBC_DIR=glibc-2.2.2 -#GLIBC_DIR=glibc-2.2.5 +#LIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.2.2 +#LIBC_DIR=glibc-2.2.5 -export TARGET GCC_DIR GLIBC_DIR +C_LIBRARY=glibc + +export TARGET GCC_DIR GLIBC_DIR C_LIBRARY sh ptx.sh diff -Naur crosstool-0.28-rc5-orig/gcc-2.95.3-glibc-2.1.3.dat crosstool-0.28-rc5/gcc-2.95.3-glibc-2.1.3.dat --- crosstool-0.28-rc5-orig/gcc-2.95.3-glibc-2.1.3.dat 2004-03-25 10:29:04.000000000 -0800 +++ crosstool-0.28-rc5/gcc-2.95.3-glibc-2.1.3.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,7 +1,8 @@ BINUTILS_DIR=binutils-2.13.90.0.2 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-2.95.3 -GLIBC_DIR=glibc-2.1.3 +LIBC_DIR=glibc-2.1.3 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.1.3 GLIBCCRYPT_FILENAME=glibc-crypt-2.1 diff -Naur crosstool-0.28-rc5-orig/gcc-2.95.3-glibc-2.2.2.dat crosstool-0.28-rc5/gcc-2.95.3-glibc-2.2.2.dat --- crosstool-0.28-rc5-orig/gcc-2.95.3-glibc-2.2.2.dat 2004-01-16 10:54:39.000000000 -0800 +++ crosstool-0.28-rc5/gcc-2.95.3-glibc-2.2.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.11.2 BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-2.95.3 -GLIBC_DIR=glibc-2.2.2 +LIBC_DIR=glibc-2.2.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.3 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.2.2 diff -Naur crosstool-0.28-rc5-orig/gcc-2.95.3-glibc-2.2.5.dat crosstool-0.28-rc5/gcc-2.95.3-glibc-2.2.5.dat --- crosstool-0.28-rc5-orig/gcc-2.95.3-glibc-2.2.5.dat 2004-01-16 10:54:40.000000000 -0800 +++ crosstool-0.28-rc5/gcc-2.95.3-glibc-2.2.5.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.11.2 BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-2.95.3 -GLIBC_DIR=glibc-2.2.5 +LIBC_DIR=glibc-2.2.5 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.3 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.2.5 diff -Naur crosstool-0.28-rc5-orig/gcc-3.2.3-glibc-2.2.3.dat crosstool-0.28-rc5/gcc-3.2.3-glibc-2.2.3.dat --- crosstool-0.28-rc5-orig/gcc-3.2.3-glibc-2.2.3.dat 2004-01-31 11:42:19.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.2.3-glibc-2.2.3.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.13 BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-3.2.3 -GLIBC_DIR=glibc-2.2.3 +LIBC_DIR=glibc-2.2.3 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.2.3 diff -Naur crosstool-0.28-rc5-orig/gcc-3.2.3-glibc-2.2.5.dat crosstool-0.28-rc5/gcc-3.2.3-glibc-2.2.5.dat --- crosstool-0.28-rc5-orig/gcc-3.2.3-glibc-2.2.5.dat 2004-01-31 11:42:24.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.2.3-glibc-2.2.5.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.13 BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-3.2.3 -GLIBC_DIR=glibc-2.2.5 +LIBC_DIR=glibc-2.2.5 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.2.5 diff -Naur crosstool-0.28-rc5-orig/gcc-3.2.3-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.2.3-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.2.3-glibc-2.3.2.dat 2004-01-31 11:42:27.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.2.3-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -2,5 +2,6 @@ BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-3.2.3 LINUX_DIR=linux-2.4.21 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3.1-glibc-2.2.5.dat crosstool-0.28-rc5/gcc-3.3.1-glibc-2.2.5.dat --- crosstool-0.28-rc5-orig/gcc-3.3.1-glibc-2.2.5.dat 2004-02-01 07:38:58.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3.1-glibc-2.2.5.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14 BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-3.3.1 -GLIBC_DIR=glibc-2.2.5 +LIBC_DIR=glibc-2.2.5 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.2.5 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3.1-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.3.1-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.3.1-glibc-2.3.2.dat 2004-02-01 07:39:06.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3.1-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14 BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-3.3.1 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.24 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3-20040105-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.3-20040105-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.3-20040105-glibc-2.3.2.dat 2004-02-01 07:39:14.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3-20040105-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14 BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-3.3-20040105 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3-20040112-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.3-20040112-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.3-20040112-glibc-2.3.2.dat 2004-02-01 07:39:25.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3-20040112-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14 BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-3.3-20040112 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.24 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3-20040119-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.3-20040119-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.3-20040119-glibc-2.3.2.dat 2004-01-25 17:53:29.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3-20040119-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14.90.0.5 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.3-20040119 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.24 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3-20040126-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.3-20040126-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.3-20040126-glibc-2.3.2.dat 2004-01-27 10:16:54.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3-20040126-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14.90.0.5 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.3-20040126 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.24 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3.2-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.3.2-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.3.2-glibc-2.3.2.dat 2004-02-27 18:20:53.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3.2-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14.90.0.5 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.3.2 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.24 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3.3-20040131-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.3.3-20040131-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.3.3-20040131-glibc-2.3.2.dat 2004-02-27 18:20:53.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3.3-20040131-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14 BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-3.3.3-20040131 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.24 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3.3-20040210-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.3.3-20040210-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.3.3-20040210-glibc-2.3.2.dat 2004-02-13 15:50:26.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3.3-20040210-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14 BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-3.3.3-20040210 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.24 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3.3-glibc-2.1.3.dat crosstool-0.28-rc5/gcc-3.3.3-glibc-2.1.3.dat --- crosstool-0.28-rc5-orig/gcc-3.3.3-glibc-2.1.3.dat 2004-03-04 11:27:33.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3.3-glibc-2.1.3.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,7 +1,8 @@ BINUTILS_DIR=binutils-2.14.90.0.5 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.3.3 -GLIBC_DIR=glibc-2.1.3 +LIBC_DIR=glibc-2.1.3 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.24 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.1.3 GLIBCCRYPT_FILENAME=glibc-crypt-2.1 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3.3-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.3.3-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.3.3-glibc-2.3.2.dat 2004-02-27 18:20:53.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3.3-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14.90.0.5 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.3.3 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.24 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3.3-uclibc-0.9.23.dat crosstool-0.28-rc5/gcc-3.3.3-uclibc-0.9.23.dat --- crosstool-0.28-rc5-orig/gcc-3.3.3-uclibc-0.9.23.dat 1969-12-31 16:00:00.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3.3-uclibc-0.9.23.dat 2004-06-19 12:17:30.000000000 -0700 @@ -0,0 +1,6 @@ +BINUTILS_DIR=binutils-2.14.90.0.5 +BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils +GCC_DIR=gcc-3.3.3 +LIBC_DIR=uClibc-0.9.23 +C_LIBRARY=uclibc +LINUX_DIR=linux-2.4.21 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3-glibc-2.2.5.dat crosstool-0.28-rc5/gcc-3.3-glibc-2.2.5.dat --- crosstool-0.28-rc5-orig/gcc-3.3-glibc-2.2.5.dat 2004-02-01 07:40:32.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3-glibc-2.2.5.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14 BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-3.3 -GLIBC_DIR=glibc-2.2.5 +LIBC_DIR=glibc-2.2.5 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.2.5 diff -Naur crosstool-0.28-rc5-orig/gcc-3.3-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.3-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.3-glibc-2.3.2.dat 2004-02-01 06:40:26.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.3-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -2,5 +2,6 @@ BINUTILS_URL=ftp://ftp.gnu.org/pub/gnu/binutils GCC_DIR=gcc-3.3 LINUX_DIR=linux-2.4.21 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.4.0-20040416-glibc-2.1.3.dat crosstool-0.28-rc5/gcc-3.4.0-20040416-glibc-2.1.3.dat --- crosstool-0.28-rc5-orig/gcc-3.4.0-20040416-glibc-2.1.3.dat 2004-04-16 22:18:36.000000000 -0700 +++ crosstool-0.28-rc5/gcc-3.4.0-20040416-glibc-2.1.3.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,7 +1,8 @@ BINUTILS_DIR=binutils-2.15.90.0.3 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.4.0-20040416 -GLIBC_DIR=glibc-2.1.3 +LIBC_DIR=glibc-2.1.3 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.1.3 GLIBCCRYPT_FILENAME=glibc-crypt-2.1 diff -Naur crosstool-0.28-rc5-orig/gcc-3.4.0-20040416-glibc-2.2.5.dat crosstool-0.28-rc5/gcc-3.4.0-20040416-glibc-2.2.5.dat --- crosstool-0.28-rc5-orig/gcc-3.4.0-20040416-glibc-2.2.5.dat 2004-04-16 22:18:43.000000000 -0700 +++ crosstool-0.28-rc5/gcc-3.4.0-20040416-glibc-2.2.5.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.15.90.0.3 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.4.0-20040416 -GLIBC_DIR=glibc-2.2.5 +LIBC_DIR=glibc-2.2.5 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.2.5 diff -Naur crosstool-0.28-rc5-orig/gcc-3.4.0-20040416-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.4.0-20040416-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.4.0-20040416-glibc-2.3.2.dat 2004-04-16 22:18:50.000000000 -0700 +++ crosstool-0.28-rc5/gcc-3.4.0-20040416-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.15.90.0.3 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.4.0-20040416 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.4-20030813-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.4-20030813-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.4-20030813-glibc-2.3.2.dat 2004-01-16 10:54:40.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.4-20030813-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14.90.0.5 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.4-20030813 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.4-20030827-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.4-20030827-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.4-20030827-glibc-2.3.2.dat 2004-01-16 10:54:39.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.4-20030827-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14.90.0.5 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.4-20030813 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.4-20030903-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.4-20030903-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.4-20030903-glibc-2.3.2.dat 2004-01-16 10:54:39.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.4-20030903-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14.90.0.5 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.4-20030903 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.4-20030910-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.4-20030910-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.4-20030910-glibc-2.3.2.dat 2004-01-16 10:54:39.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.4-20030910-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14.90.0.5 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.4-20030910 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.4-20031112-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.4-20031112-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.4-20031112-glibc-2.3.2.dat 2004-01-16 10:54:40.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.4-20031112-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14.90.0.5 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.4-20031112 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.4-20040225-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.4-20040225-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.4-20040225-glibc-2.3.2.dat 2004-02-27 18:20:53.000000000 -0800 +++ crosstool-0.28-rc5/gcc-3.4-20040225-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.14.90.0.5 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.4-20040225 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/gcc-3.4-20040414-glibc-2.3.2.dat crosstool-0.28-rc5/gcc-3.4-20040414-glibc-2.3.2.dat --- crosstool-0.28-rc5-orig/gcc-3.4-20040414-glibc-2.3.2.dat 2004-04-14 22:14:22.000000000 -0700 +++ crosstool-0.28-rc5/gcc-3.4-20040414-glibc-2.3.2.dat 2004-06-19 12:17:30.000000000 -0700 @@ -1,6 +1,7 @@ BINUTILS_DIR=binutils-2.15.90.0.2 BINUTILS_URL=http://www.kernel.org/pub/linux/devel/binutils GCC_DIR=gcc-3.4-20040414 -GLIBC_DIR=glibc-2.3.2 +LIBC_DIR=glibc-2.3.2 +C_LIBRARY=glibc LINUX_DIR=linux-2.4.21 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 diff -Naur crosstool-0.28-rc5-orig/getandpatch.sh crosstool-0.28-rc5/getandpatch.sh --- crosstool-0.28-rc5-orig/getandpatch.sh 2004-04-16 22:22:23.000000000 -0700 +++ crosstool-0.28-rc5/getandpatch.sh 2004-06-19 12:17:30.000000000 -0700 @@ -15,7 +15,13 @@ test -z "${BINUTILS_DIR}" && abort "Please set BINUTILS_DIR to the bare filename of the binutils tarball or directory" test -z "${SRC_DIR}" && abort "Please set SRC_DIR to the directory where the source tarballs are to be unpacked" test -z "${GCC_DIR}" && abort "Please set GCC_DIR to the bare filename of the gcc tarball or directory" -test -z "${GLIBC_DIR}" && abort "Please set GLIBC_DIR to the bare filename of the glibc tarball or directory" +test -z "${LIBC_DIR}" && abort "Please set LIBC_DIR to the bare filename of the C library tarball or directory" +test -z "${C_LIBRARY}" && abort "Please set C_LIBRARY to 'glibc' or 'uclibc'" +case ${C_LIBRARY} in + glibc) ;; + uclibc) ;; + *) abort "Unsupported C library ${C_LIBRARY}; please set C_LIBRARY to 'glibc' or 'uclibc'" +esac test -z "${LINUX_DIR}" && abort "Please set LINUX_DIR to the bare filename of the kernel tarball or directory" test -z "${TARBALLS_DIR}" && abort "Please set TARBALLS_DIR to the directory to download tarballs to." test -z "${PTXDIST_DIR}" && abort "Please set PTXDIST_DIR to the bare filename of the ptxdist tarball or directory." @@ -28,7 +34,9 @@ if test -z "$QUIET_EXTRACTIONS"; then VERBOSE=-v;else VERBOSE=; fi # And one is derived. -GLIBCTHREADS_FILENAME=`echo $GLIBC_DIR | sed 's/glibc-/glibc-linuxthreads-/'` +if test "${C_LIBRARY}" = glibc ; then + GLIBCTHREADS_FILENAME=`echo $LIBC_DIR | sed 's/glibc-/glibc-linuxthreads-/'` +fi # Pattern in a patch log to indicate failure PATCHFAILMSGS="^No file to patch. Skipping patch.|^Hunk .* FAILED at" @@ -86,7 +94,7 @@ cd $SRC_DIR case $ARCHIVE_NAME in - glibc-*-2.*) echo "It's a glibc addon, so cd into glibc"; cd $GLIBC_DIR ;; + glibc-*-2.*) echo "It's a glibc addon, so cd into glibc"; cd $LIBC_DIR ;; *) ;; esac @@ -133,6 +141,14 @@ fi } +# Special version for uClibc pregenerated locale data +getuClibcLocale() { + ARCHIVE_NAME=`echo $1 | sed 's,.*/,,;'` + cd ${SRC_DIR}/${LIBC_DIR}/extra/locale + test -f ${ARCHIVE_NAME} || wget $1 + cd ${TOP_DIR} +} + # Remember where source is. TOP_DIR=${TOP_DIR-`pwd`} @@ -158,15 +174,26 @@ *) getUnpackAndPatch ftp://ftp.gnu.org/pub/gnu/gcc/$GCC_DIR.tar.gz ;; esac -getUnpackAndPatch ftp://ftp.gnu.org/pub/gnu/glibc/$GLIBC_DIR.tar.bz2 ftp://ftp.gnu.org/pub/gnu/glibc/$GLIBC_DIR.tar.gz +case $C_LIBRARY in + glibc) + getUnpackAndPatch ftp://ftp.gnu.org/pub/gnu/glibc/$LIBC_DIR.tar.bz2 ftp://ftp.gnu.org/pub/gnu/glibc/$LIBC_DIR.tar.gz + # Glibc addons must come after glibc + test x$GLIBCTREADS_FILENAME = x || getUnpackAndPatch ftp://ftp.gnu.org/pub/gnu/glibc/$GLIBCTHREADS_FILENAME.tar.bz2 ftp://ftp.gnu.org/pub/gnu/glibc/$GLIBCTHREADS_FILENAME.tar.gz + test x$GLIBCCRYPT_FILENAME = x || getUnpackAndPatch ftp://ftp.gnu.org/pub/gnu/glibc/$GLIBCCRYPT_FILENAME.tar.gz ftp://ftp.gnu.org/pub/gnu/glibc/$GLIBCCRYPT_FILENAME.tar.bz2 + ;; + uclibc) + getUnpackAndPatch http://www.uclibc.org/downloads/old-releases/$LIBC_DIR.tar.bz2 || \ + getUnpackAndPatch http://www.uclibc.org/downloads/old-releases/$LIBC_DIR.tar.gz || \ + getUnpackAndPatch http://www.uclibc.org/downloads/$LIBC_DIR.tar.bz2 || \ + getUnpackAndPatch http://www.uclibc.org/downloads/$LIBC_DIR.tar.gz + getuClibcLocale http://www.uclibc.org/downloads/uClibc-locale-030818.tgz + ;; +esac case $LINUX_DIR in *2.4*) getUnpackAndPatch http://www.kernel.org/pub/linux/kernel/v2.4/$LINUX_DIR.tar.bz2 http://www.kernel.org/pub/linux/kernel/v2.4/$LINUX_DIR.tar.gz ;; *2.6*) getUnpackAndPatch http://www.kernel.org/pub/linux/kernel/v2.6/$LINUX_DIR.tar.bz2 http://www.kernel.org/pub/linux/kernel/v2.6/$LINUX_DIR.tar.gz ;; *) abort "unknown version $LINUX_DIR of linux, expected 2.4 or 2.6 in name?" ;; esac -# Glibc addons must come after glibc -getUnpackAndPatch ftp://ftp.gnu.org/pub/gnu/glibc/$GLIBCTHREADS_FILENAME.tar.bz2 ftp://ftp.gnu.org/pub/gnu/glibc/$GLIBCTHREADS_FILENAME.tar.gz -test x$GLIBCCRYPT_FILENAME = x || getUnpackAndPatch ftp://ftp.gnu.org/pub/gnu/glibc/$GLIBCCRYPT_FILENAME.tar.gz ftp://ftp.gnu.org/pub/gnu/glibc/$GLIBCCRYPT_FILENAME.tar.bz2 # gcc's contrib/test_summary expects version stamp, normally created by contrib/update_gcc test -f $SRC_DIR/$GCC_DIR/LAST_UPDATED || echo $GCC_DIR > $SRC_DIR/$GCC_DIR/LAST_UPDATED diff -Naur crosstool-0.28-rc5-orig/patches/binutils-2.14/bfddoc-cflags-for-build.patch crosstool-0.28-rc5/patches/binutils-2.14/bfddoc-cflags-for-build.patch --- crosstool-0.28-rc5-orig/patches/binutils-2.14/bfddoc-cflags-for-build.patch 1969-12-31 16:00:00.000000000 -0800 +++ crosstool-0.28-rc5/patches/binutils-2.14/bfddoc-cflags-for-build.patch 2004-06-19 12:17:30.000000000 -0700 @@ -0,0 +1,37 @@ +From the uClibc project. + +When building for the build host (rather than the target), use the CFLAGS +definition for the build host, not the target. + +diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.am binutils-2.14.90.0.6.new/bfd/doc/Makefile.am +--- binutils-2.14.90.0.6/bfd/doc/Makefile.am 2003-07-23 10:08:09.000000000 -0500 ++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.am 2004-03-01 16:05:16.000000000 -0600 +@@ -55,10 +55,10 @@ + MKDOC = chew$(EXEEXT_FOR_BUILD) + + $(MKDOC): chew.o +- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS) ++ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS) + + chew.o: chew.c +- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c ++ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c + + protos: libbfd.h libcoff.h bfd.h + +diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.in binutils-2.14.90.0.6.new/bfd/doc/Makefile.in +--- binutils-2.14.90.0.6/bfd/doc/Makefile.in 2003-07-23 10:08:09.000000000 -0500 ++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.in 2004-03-01 16:05:03.000000000 -0600 +@@ -469,10 +469,10 @@ + + + $(MKDOC): chew.o +- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS) ++ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS) + + chew.o: chew.c +- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c ++ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c + + protos: libbfd.h libcoff.h bfd.h + diff -Naur crosstool-0.28-rc5-orig/patches/binutils-2.14/uclibc-target.patch crosstool-0.28-rc5/patches/binutils-2.14/uclibc-target.patch --- crosstool-0.28-rc5-orig/patches/binutils-2.14/uclibc-target.patch 1969-12-31 16:00:00.000000000 -0800 +++ crosstool-0.28-rc5/patches/binutils-2.14/uclibc-target.patch 2004-06-19 12:17:30.000000000 -0700 @@ -0,0 +1,652 @@ +Provided by the uClibc project. + +Patch to recognize and properly handle target tuples of the form +*-*-linux-uclibc*, required for building a proper uClibc toolchain. + + +diff -urN binutils-2.14.90.0.6/bfd/config.bfd binutils-2.14.90.0.6-uClibc/bfd/config.bfd +--- binutils-2.14.90.0.6/bfd/config.bfd 2003-08-21 10:28:47.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/bfd/config.bfd 2004-01-06 23:20:32.000000000 -0600 +@@ -121,7 +121,7 @@ + targ_defvec=ecoffalpha_little_vec + targ_selvecs=bfd_elf64_alpha_vec + ;; +- alpha*-*-linux-gnu* | alpha*-*-elf*) ++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*) + targ_defvec=bfd_elf64_alpha_vec + targ_selvecs=ecoffalpha_little_vec + ;; +@@ -131,7 +131,8 @@ + alpha*-*-*) + targ_defvec=ecoffalpha_little_vec + ;; +- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*) ++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | \ ++ ia64*-*-linux-uclibc* | ia64*-*-elf*) + targ_defvec=bfd_elf64_ia64_little_vec + targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" + ;; +@@ -214,7 +215,7 @@ + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; +- armeb-*-elf | arm*b-*-linux-gnu*) ++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*) + targ_defvec=bfd_elf32_bigarm_vec + targ_selvecs=bfd_elf32_littlearm_vec + ;; +@@ -222,7 +223,8 @@ + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; +- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*) ++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \ ++ arm*-*-conix* | arm*-*-uclinux*) + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; +@@ -355,7 +357,7 @@ + ;; + + #ifdef BFD64 +- hppa*64*-*-linux-gnu*) ++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) + targ_defvec=bfd_elf64_hppa_linux_vec + targ_selvecs=bfd_elf64_hppa_vec + ;; +@@ -366,7 +368,7 @@ + ;; + #endif + +- hppa*-*-linux-gnu*) ++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) + targ_defvec=bfd_elf32_hppa_linux_vec + targ_selvecs=bfd_elf32_hppa_vec + ;; +@@ -488,7 +490,7 @@ + targ_selvecs=bfd_elf32_i386_vec + targ_underscore=yes + ;; +- i[3-7]86-*-linux-gnu*) ++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) + targ_defvec=bfd_elf32_i386_vec + targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" + targ64_selvecs=bfd_elf64_x86_64_vec +@@ -502,7 +504,7 @@ + targ_defvec=bfd_elf64_x86_64_vec + targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec" + ;; +- x86_64-*-linux-gnu*) ++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) + targ_defvec=bfd_elf64_x86_64_vec + targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" + ;; +@@ -662,7 +664,7 @@ + targ_selvecs=bfd_elf32_m68k_vec + targ_underscore=yes + ;; +- m68*-*-linux-gnu*) ++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*) + targ_defvec=bfd_elf32_m68k_vec + targ_selvecs=m68klinux_vec + ;; +@@ -929,7 +931,8 @@ + ;; + #endif + powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ +- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \ ++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \ ++ powerpc-*-rtems* | \ + powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*) + targ_defvec=bfd_elf32_powerpc_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" +@@ -961,8 +964,8 @@ + targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" + ;; + powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \ +- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\ +- powerpcle-*-rtems*) ++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\ ++ powerpcle-*-vxworks* | powerpcle-*-rtems*) + targ_defvec=bfd_elf32_powerpcle_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" + targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" +@@ -1110,7 +1113,7 @@ + targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" + targ_underscore=yes + ;; +- sparc-*-linux-gnu*) ++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*) + targ_defvec=bfd_elf32_sparc_vec + targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec" + ;; +@@ -1157,7 +1160,7 @@ + targ_defvec=sunos_big_vec + targ_underscore=yes + ;; +- sparc64-*-linux-gnu*) ++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) + targ_defvec=bfd_elf64_sparc_vec + targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec" + ;; +diff -urN binutils-2.14.90.0.6/bfd/configure binutils-2.14.90.0.6-uClibc/bfd/configure +--- binutils-2.14.90.0.6/bfd/configure 2003-08-21 10:28:47.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/bfd/configure 2004-01-06 20:26:51.000000000 -0600 +@@ -1698,6 +1698,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' +@@ -5102,7 +5107,7 @@ + alpha*-*-freebsd*) + COREFILE='' + ;; +- alpha*-*-linux-gnu*) ++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/alphalinux.h"' + ;; +@@ -5161,7 +5166,7 @@ + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386mach3.h"' + ;; +- i[3-7]86-*-linux-gnu*) ++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386linux.h"' + ;; +@@ -5211,7 +5216,7 @@ + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/hp300bsd.h"' + ;; +- m68*-*-linux-gnu*) ++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/m68klinux.h"' + ;; +diff -urN binutils-2.14.90.0.6/bfd/configure.in binutils-2.14.90.0.6-uClibc/bfd/configure.in +--- binutils-2.14.90.0.6/bfd/configure.in 2003-08-21 10:28:47.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/bfd/configure.in 2004-01-06 20:33:02.000000000 -0600 +@@ -153,7 +153,7 @@ + alpha*-*-freebsd*) + COREFILE='' + ;; +- alpha*-*-linux-gnu*) ++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/alphalinux.h"' + ;; +@@ -233,7 +233,7 @@ + TRAD_HEADER='"hosts/i386mach3.h"' + ;; + changequote(,)dnl +- i[3-7]86-*-linux-gnu*) ++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) + changequote([,])dnl + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386linux.h"' +@@ -286,7 +286,7 @@ + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/hp300bsd.h"' + ;; +- m68*-*-linux-gnu*) ++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/m68klinux.h"' + ;; +diff -urN binutils-2.14.90.0.6/config.sub binutils-2.14.90.0.6-uClibc/config.sub +--- binutils-2.14.90.0.6/config.sub 2003-08-21 10:28:47.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/config.sub 2004-01-06 22:56:56.000000000 -0600 +@@ -118,7 +118,7 @@ + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in +- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) ++ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; +@@ -1131,7 +1131,8 @@ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ +- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ ++ | -mingw32* | -linux-gnu* | -linux-uclibc* \ ++ | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ +diff -urN binutils-2.14.90.0.6/configure binutils-2.14.90.0.6-uClibc/configure +--- binutils-2.14.90.0.6/configure 2003-08-21 10:29:32.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/configure 2004-01-07 05:43:40.000000000 -0600 +@@ -1257,6 +1262,18 @@ + i[3456789]86-*-freebsd*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; ++ i[3456789]86-*-linux-uclibc) ++ # This section makes it possible to build newlib natively on linux. ++ # If we are using a cross compiler then don't configure newlib. ++ if test x${is_cross_compiler} != xno ; then ++ noconfigdirs="$noconfigdirs target-newlib" ++ fi ++ noconfigdirs="$noconfigdirs target-libgloss" ++ # If we are not using a cross compiler, do configure newlib. ++ # Note however, that newlib will only be configured in this situation ++ # if the --with-newlib option has been given, because otherwise ++ # 'target-newlib' will appear in skipdirs. ++ ;; + i[3456789]86-*-linux*) + # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's + # not build java stuff by default. +diff -urN binutils-2.14.90.0.6/configure.in binutils-2.14.90.0.6-uClibc/configure.in +--- binutils-2.14.90.0.6/configure.in 2003-08-21 10:29:30.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/configure.in 2004-01-07 05:44:02.000000000 -0600 +@@ -508,6 +513,19 @@ + i[[3456789]]86-*-freebsd*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; ++ i[3456789]86-*-linux-uclibc) ++ # This section makes it possible to build newlib natively on linux. ++ # If we are using a cross compiler then don't configure newlib. ++ if test x${is_cross_compiler} != xno ; then ++ noconfigdirs="$noconfigdirs target-newlib" ++ fi ++ noconfigdirs="$noconfigdirs target-libgloss" ++ build_modules= ++ # If we are not using a cross compiler, do configure newlib. ++ # Note however, that newlib will only be configured in this situation ++ # if the --with-newlib option has been given, because otherwise ++ # 'target-newlib' will appear in skipdirs. ++ ;; + i[[3456789]]86-*-linux*) + # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's + # not build java stuff by default. +diff -urN binutils-2.14.90.0.6/demangler/configure binutils-2.14.90.0.6-uClibc/demangler/configure +--- binutils-2.14.90.0.6/demangler/configure 2003-08-21 10:29:31.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/demangler/configure 2004-01-06 21:45:51.000000000 -0600 +@@ -1363,6 +1363,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' +diff -urN binutils-2.14.90.0.6/gas/configure binutils-2.14.90.0.6-uClibc/gas/configure +--- binutils-2.14.90.0.6/gas/configure 2003-07-23 10:08:10.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/gas/configure 2004-01-06 21:57:25.000000000 -0600 +@@ -1576,6 +1576,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' +@@ -2370,6 +2375,7 @@ + alpha*-*-osf*) fmt=ecoff ;; + alpha*-*-linuxecoff*) fmt=ecoff ;; + alpha*-*-linux-gnu*) fmt=elf em=linux ;; ++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;; + alpha*-*-netbsd*) fmt=elf em=nbsd ;; + alpha*-*-openbsd*) fmt=elf em=obsd ;; + +@@ -2386,6 +2392,7 @@ + arm*-*-conix*) fmt=elf ;; + arm-*-linux*aout*) fmt=aout em=linux ;; + arm*-*-linux-gnu*) fmt=elf em=linux ;; ++ arm*-*-linux-uclibc*) fmt=elf em=linux ;; + arm*-*-uclinux*) fmt=elf em=linux ;; + arm-*-netbsdelf*) fmt=elf em=nbsd ;; + arm-*-*n*bsd*) fmt=aout em=nbsd ;; +@@ -2400,6 +2407,7 @@ + avr-*-*) fmt=elf ;; + + cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;; ++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;; + cris-*-*) fmt=multi bfd_gas=yes ;; + + d10v-*-*) fmt=elf ;; +@@ -2455,7 +2463,9 @@ + i386-*-linux*oldld) fmt=aout em=linux ;; + i386-*-linux*coff*) fmt=coff em=linux ;; + i386-*-linux-gnu*) fmt=elf em=linux ;; ++ i386-*-linux-uclibc*) fmt=elf em=linux ;; + x86_64-*-linux-gnu*) fmt=elf em=linux ;; ++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;; + i386-*-lynxos*) fmt=coff em=lynx ;; + i386-*-sysv[45]*) fmt=elf ;; + i386-*-solaris*) fmt=elf ;; +@@ -2512,6 +2522,7 @@ + ia64-*-elf*) fmt=elf ;; + ia64-*-aix*) fmt=elf em=ia64aix ;; + ia64-*-linux-gnu*) fmt=elf em=linux ;; ++ ia64-*-linux-uclibc*) fmt=elf em=linux ;; + ia64-*-hpux*) fmt=elf em=hpux ;; + ia64-*-netbsd*) fmt=elf em=nbsd ;; + +@@ -2538,6 +2549,7 @@ + m68k-*-hpux*) fmt=hp300 em=hp300 ;; + m68k-*-linux*aout*) fmt=aout em=linux ;; + m68k-*-linux-gnu*) fmt=elf em=linux ;; ++ m68k-*-linux-uclibc*) fmt=elf em=linux ;; + m68k-*-gnu*) fmt=elf ;; + m68k-*-lynxos*) fmt=coff em=lynx ;; + m68k-*-netbsdelf*) fmt=elf em=nbsd ;; +@@ -2592,6 +2604,7 @@ + ppc-*-beos*) fmt=coff ;; + ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;; + ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;; ++ ppc-*-linux-uclibc* | \ + ppc-*-linux-gnu*) fmt=elf + case "$endian" in + big) ;; +@@ -2616,7 +2629,9 @@ + ppc-*-kaos*) fmt=elf ;; + + s390x-*-linux-gnu*) fmt=elf em=linux ;; ++ s390x-*-linux-uclibc*) fmt=elf em=linux ;; + s390-*-linux-gnu*) fmt=elf em=linux ;; ++ s390-*-linux-uclibc*) fmt=elf em=linux ;; + + sh*-*-linux*) fmt=elf em=linux + case ${cpu} in +@@ -2649,6 +2664,7 @@ + sparc-*-coff) fmt=coff ;; + sparc-*-linux*aout*) fmt=aout em=linux ;; + sparc-*-linux-gnu*) fmt=elf em=linux ;; ++ sparc-*-linux-uclibc*) fmt=elf em=linux ;; + sparc-*-lynxos*) fmt=coff em=lynx ;; + sparc-fujitsu-none) fmt=aout ;; + sparc-*-elf) fmt=elf ;; +diff -urN binutils-2.14.90.0.6/gas/configure.in binutils-2.14.90.0.6-uClibc/gas/configure.in +--- binutils-2.14.90.0.6/gas/configure.in 2003-07-23 10:08:10.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/gas/configure.in 2004-01-06 21:57:26.000000000 -0600 +@@ -184,6 +184,7 @@ + alpha*-*-osf*) fmt=ecoff ;; + alpha*-*-linuxecoff*) fmt=ecoff ;; + alpha*-*-linux-gnu*) fmt=elf em=linux ;; ++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;; + alpha*-*-netbsd*) fmt=elf em=nbsd ;; + alpha*-*-openbsd*) fmt=elf em=obsd ;; + +@@ -200,6 +201,7 @@ + arm*-*-conix*) fmt=elf ;; + arm-*-linux*aout*) fmt=aout em=linux ;; + arm*-*-linux-gnu*) fmt=elf em=linux ;; ++ arm*-*-linux-uclibc*) fmt=elf em=linux ;; + arm*-*-uclinux*) fmt=elf em=linux ;; + arm-*-netbsdelf*) fmt=elf em=nbsd ;; + arm-*-*n*bsd*) fmt=aout em=nbsd ;; +@@ -214,6 +216,7 @@ + avr-*-*) fmt=elf ;; + + cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;; ++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;; + cris-*-*) fmt=multi bfd_gas=yes ;; + + d10v-*-*) fmt=elf ;; +@@ -269,7 +272,9 @@ + i386-*-linux*oldld) fmt=aout em=linux ;; + i386-*-linux*coff*) fmt=coff em=linux ;; + i386-*-linux-gnu*) fmt=elf em=linux ;; ++ i386-*-linux-uclibc*) fmt=elf em=linux ;; + x86_64-*-linux-gnu*) fmt=elf em=linux ;; ++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;; + i386-*-lynxos*) fmt=coff em=lynx ;; + changequote(,)dnl + i386-*-sysv[45]*) fmt=elf ;; +@@ -322,6 +327,7 @@ + ia64-*-elf*) fmt=elf ;; + ia64-*-aix*) fmt=elf em=ia64aix ;; + ia64-*-linux-gnu*) fmt=elf em=linux ;; ++ ia64-*-linux-uclibc*) fmt=elf em=linux ;; + ia64-*-hpux*) fmt=elf em=hpux ;; + ia64-*-netbsd*) fmt=elf em=nbsd ;; + +@@ -348,6 +354,7 @@ + m68k-*-hpux*) fmt=hp300 em=hp300 ;; + m68k-*-linux*aout*) fmt=aout em=linux ;; + m68k-*-linux-gnu*) fmt=elf em=linux ;; ++ m68k-*-linux-uclibc*) fmt=elf em=linux ;; + m68k-*-gnu*) fmt=elf ;; + m68k-*-lynxos*) fmt=coff em=lynx ;; + m68k-*-netbsdelf*) fmt=elf em=nbsd ;; +@@ -402,6 +409,7 @@ + ppc-*-beos*) fmt=coff ;; + ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;; + ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;; ++ ppc-*-linux-uclibc* | \ + ppc-*-linux-gnu*) fmt=elf + case "$endian" in + big) ;; +@@ -424,7 +432,9 @@ + ppc-*-kaos*) fmt=elf ;; + + s390x-*-linux-gnu*) fmt=elf em=linux ;; ++ s390x-*-linux-uclibc*) fmt=elf em=linux ;; + s390-*-linux-gnu*) fmt=elf em=linux ;; ++ s390-*-linux-uclibc*) fmt=elf em=linux ;; + + sh*-*-linux*) fmt=elf em=linux + case ${cpu} in +@@ -457,6 +467,7 @@ + sparc-*-coff) fmt=coff ;; + sparc-*-linux*aout*) fmt=aout em=linux ;; + sparc-*-linux-gnu*) fmt=elf em=linux ;; ++ sparc-*-linux-uclibc*) fmt=elf em=linux ;; + sparc-*-lynxos*) fmt=coff em=lynx ;; + sparc-fujitsu-none) fmt=aout ;; + sparc-*-elf) fmt=elf ;; +diff -urN binutils-2.14.90.0.6/ld/configure binutils-2.14.90.0.6-uClibc/ld/configure +--- binutils-2.14.90.0.6/ld/configure 2003-05-05 16:46:49.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/ld/configure 2004-01-06 21:59:31.000000000 -0600 +@@ -1578,6 +1578,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' +diff -urN binutils-2.14.90.0.6/ld/configure.tgt binutils-2.14.90.0.6-uClibc/ld/configure.tgt +--- binutils-2.14.90.0.6/ld/configure.tgt 2003-08-21 10:28:48.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/ld/configure.tgt 2004-01-06 22:09:40.000000000 -0600 +@@ -30,6 +30,7 @@ + targ_extra_emuls="criself crislinux" + targ_extra_libpath=$targ_extra_emuls ;; + cris-*-linux-gnu*) targ_emul=crislinux ;; ++cris-*-linux-uclibc*) targ_emul=crislinux ;; + cris-*-*) targ_emul=criself + targ_extra_emuls="crisaout crislinux" + targ_extra_libpath=$targ_extra_emuls ;; +@@ -59,14 +60,16 @@ + tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'` + tdir_sun4=sparc-sun-sunos4 + ;; +-sparc64-*-linux-gnu*) targ_emul=elf64_sparc ++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \ ++ targ_emul=elf64_sparc + targ_extra_emuls="elf32_sparc sparclinux sun4" + targ_extra_libpath=elf32_sparc + tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'` + tdir_sparclinux=${tdir_elf32_sparc}aout + tdir_sun4=sparc-sun-sunos4 + ;; +-sparc*-*-linux-gnu*) targ_emul=elf32_sparc ++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \ ++ targ_emul=elf32_sparc + targ_extra_emuls="sparclinux elf64_sparc sun4" + targ_extra_libpath=elf64_sparc + tdir_sparclinux=${targ_alias}aout +@@ -124,7 +127,7 @@ + m68*-ericsson-ose) targ_emul=sun3 ;; + m68*-apple-aux*) targ_emul=m68kaux ;; + *-tandem-none) targ_emul=st2000 ;; +-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;; ++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;; + i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;; + i[3-7]86-*-vsta) targ_emul=vsta ;; + i[3-7]86-go32-rtems*) targ_emul=i386go32 ;; +@@ -148,14 +151,16 @@ + tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` + ;; + i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;; +-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386 ++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \ ++ targ_emul=elf_i386 + targ_extra_emuls=i386linux + if test x${want64} = xtrue; then + targ_extra_emuls="$targ_extra_emuls elf_x86_64" + fi + tdir_i386linux=${targ_alias}aout + ;; +-x86_64-*-linux-gnu*) targ_emul=elf_x86_64 ++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \ ++ targ_emul=elf_x86_64 + targ_extra_emuls="elf_i386 i386linux" + targ_extra_libpath=elf_i386 + tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'` +@@ -250,10 +255,13 @@ + arm9e-*-elf) targ_emul=armelf ;; + arm-*-oabi) targ_emul=armelf_oabi ;; + arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;; ++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;; + arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; ++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; + arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; + arm*-*-conix*) targ_emul=armelf ;; +-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; ++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \ ++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;; + strongarm-*-coff) targ_emul=armcoff ;; + strongarm-*-elf) targ_emul=armelf ;; + strongarm-*-kaos*) targ_emul=armelf ;; +@@ -354,7 +362,8 @@ + targ_extra_emuls=m68kelf + tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'` + ;; +-m68k-*-linux-gnu*) targ_emul=m68kelf ++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \ ++ targ_emul=m68kelf + targ_extra_emuls=m68klinux + tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'` + ;; +@@ -370,9 +379,9 @@ + m68*-*-psos*) targ_emul=m68kpsos ;; + m68*-*-rtemscoff*) targ_emul=m68kcoff ;; + m68*-*-rtems*) targ_emul=m68kelf ;; +-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;; ++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;; + hppa*64*-*) targ_emul=elf64hppa ;; +-hppa*-*-linux-gnu*) targ_emul=hppalinux ;; ++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;; + hppa*-*-*elf*) targ_emul=hppaelf ;; + hppa*-*-lites*) targ_emul=hppaelf ;; + hppa*-*-netbsd*) targ_emul=hppanbsd ;; +@@ -416,16 +425,20 @@ + mips*-*-rtems*) targ_emul=elf32ebmip ;; + mips*el-*-vxworks*) targ_emul=elf32elmip ;; + mips*-*-vxworks*) targ_emul=elf32ebmip ;; +-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32 ++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) \ ++ targ_emul=elf32ltsmipn32 + targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" + ;; +-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32 ++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) \ ++ targ_emul=elf32btsmipn32 + targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" + ;; +-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip ++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) \ ++ targ_emul=elf32ltsmip + targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" + ;; +-mips*-*-linux-gnu*) targ_emul=elf32btsmip ++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) \ ++ targ_emul=elf32btsmip + targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip" + ;; + mips*-*-lnews*) targ_emul=mipslnews ;; +@@ -447,6 +460,10 @@ + alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha + tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'` + ;; ++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha ++ # The following needs to be checked... ++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'` ++ ;; + alpha*-*-osf*) targ_emul=alpha ;; + alpha*-*-gnu*) targ_emul=elf64alpha ;; + alpha*-*-netware*) targ_emul=alpha ;; +diff -urN binutils-2.14.90.0.6/libtool.m4 binutils-2.14.90.0.6-uClibc/libtool.m4 +--- binutils-2.14.90.0.6/libtool.m4 2003-05-05 16:46:46.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/libtool.m4 2004-01-06 20:30:39.000000000 -0600 +@@ -645,6 +645,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'] +diff -urN binutils-2.14.90.0.6/ltconfig binutils-2.14.90.0.6-uClibc/ltconfig +--- binutils-2.14.90.0.6/ltconfig 2003-07-23 10:08:08.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/ltconfig 2004-01-06 21:05:11.000000000 -0600 +@@ -603,6 +603,7 @@ + # Transform linux* to *-*-linux-gnu*, to support old configure scripts. + case $host_os in + linux-gnu*) ;; ++linux-uclibc*) ;; + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` + esac + +@@ -1259,6 +1260,24 @@ + dynamic_linker='GNU/Linux ld.so' + ;; + ++linux-uclibc*) ++ version_type=linux ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' ++ soname_spec='${libname}${release}.so$major' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ # This implies no fast_install, which is unacceptable. ++ # Some rework will be needed to allow for fast_install ++ # before this can be enabled. ++ # Note: copied from linux-gnu, and may not be appropriate. ++ hardcode_into_libs=yes ++ # Assume using the uClibc dynamic linker. ++ dynamic_linker="uClibc ld.so" ++ ;; ++ + netbsd*) + need_lib_prefix=no + need_version=no diff -Naur crosstool-0.28-rc5-orig/patches/binutils-2.14.90.0.5/bfddoc-cflags-for-build.patch crosstool-0.28-rc5/patches/binutils-2.14.90.0.5/bfddoc-cflags-for-build.patch --- crosstool-0.28-rc5-orig/patches/binutils-2.14.90.0.5/bfddoc-cflags-for-build.patch 1969-12-31 16:00:00.000000000 -0800 +++ crosstool-0.28-rc5/patches/binutils-2.14.90.0.5/bfddoc-cflags-for-build.patch 2004-06-19 12:17:30.000000000 -0700 @@ -0,0 +1,37 @@ +From the uClibc project. + +When building for the build host (rather than the target), use the CFLAGS +definition for the build host, not the target. + +diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.am binutils-2.14.90.0.6.new/bfd/doc/Makefile.am +--- binutils-2.14.90.0.6/bfd/doc/Makefile.am 2003-07-23 10:08:09.000000000 -0500 ++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.am 2004-03-01 16:05:16.000000000 -0600 +@@ -55,10 +55,10 @@ + MKDOC = chew$(EXEEXT_FOR_BUILD) + + $(MKDOC): chew.o +- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS) ++ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS) + + chew.o: chew.c +- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c ++ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c + + protos: libbfd.h libcoff.h bfd.h + +diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.in binutils-2.14.90.0.6.new/bfd/doc/Makefile.in +--- binutils-2.14.90.0.6/bfd/doc/Makefile.in 2003-07-23 10:08:09.000000000 -0500 ++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.in 2004-03-01 16:05:03.000000000 -0600 +@@ -469,10 +469,10 @@ + + + $(MKDOC): chew.o +- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS) ++ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS) + + chew.o: chew.c +- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c ++ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c + + protos: libbfd.h libcoff.h bfd.h + diff -Naur crosstool-0.28-rc5-orig/patches/binutils-2.14.90.0.5/uclibc-target.patch crosstool-0.28-rc5/patches/binutils-2.14.90.0.5/uclibc-target.patch --- crosstool-0.28-rc5-orig/patches/binutils-2.14.90.0.5/uclibc-target.patch 1969-12-31 16:00:00.000000000 -0800 +++ crosstool-0.28-rc5/patches/binutils-2.14.90.0.5/uclibc-target.patch 2004-06-19 12:17:30.000000000 -0700 @@ -0,0 +1,652 @@ +Provided by the uClibc project. + +Patch to recognize and properly handle target tuples of the form +*-*-linux-uclibc*, required for building a proper uClibc toolchain. + + +diff -urN binutils-2.14.90.0.6/bfd/config.bfd binutils-2.14.90.0.6-uClibc/bfd/config.bfd +--- binutils-2.14.90.0.6/bfd/config.bfd 2003-08-21 10:28:47.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/bfd/config.bfd 2004-01-06 23:20:32.000000000 -0600 +@@ -121,7 +121,7 @@ + targ_defvec=ecoffalpha_little_vec + targ_selvecs=bfd_elf64_alpha_vec + ;; +- alpha*-*-linux-gnu* | alpha*-*-elf*) ++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*) + targ_defvec=bfd_elf64_alpha_vec + targ_selvecs=ecoffalpha_little_vec + ;; +@@ -131,7 +131,8 @@ + alpha*-*-*) + targ_defvec=ecoffalpha_little_vec + ;; +- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*) ++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | \ ++ ia64*-*-linux-uclibc* | ia64*-*-elf*) + targ_defvec=bfd_elf64_ia64_little_vec + targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" + ;; +@@ -214,7 +215,7 @@ + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; +- armeb-*-elf | arm*b-*-linux-gnu*) ++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*) + targ_defvec=bfd_elf32_bigarm_vec + targ_selvecs=bfd_elf32_littlearm_vec + ;; +@@ -222,7 +223,8 @@ + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; +- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*) ++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \ ++ arm*-*-conix* | arm*-*-uclinux*) + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; +@@ -355,7 +357,7 @@ + ;; + + #ifdef BFD64 +- hppa*64*-*-linux-gnu*) ++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) + targ_defvec=bfd_elf64_hppa_linux_vec + targ_selvecs=bfd_elf64_hppa_vec + ;; +@@ -366,7 +368,7 @@ + ;; + #endif + +- hppa*-*-linux-gnu*) ++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) + targ_defvec=bfd_elf32_hppa_linux_vec + targ_selvecs=bfd_elf32_hppa_vec + ;; +@@ -488,7 +490,7 @@ + targ_selvecs=bfd_elf32_i386_vec + targ_underscore=yes + ;; +- i[3-7]86-*-linux-gnu*) ++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) + targ_defvec=bfd_elf32_i386_vec + targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" + targ64_selvecs=bfd_elf64_x86_64_vec +@@ -502,7 +504,7 @@ + targ_defvec=bfd_elf64_x86_64_vec + targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec" + ;; +- x86_64-*-linux-gnu*) ++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) + targ_defvec=bfd_elf64_x86_64_vec + targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" + ;; +@@ -662,7 +664,7 @@ + targ_selvecs=bfd_elf32_m68k_vec + targ_underscore=yes + ;; +- m68*-*-linux-gnu*) ++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*) + targ_defvec=bfd_elf32_m68k_vec + targ_selvecs=m68klinux_vec + ;; +@@ -929,7 +931,8 @@ + ;; + #endif + powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ +- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \ ++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \ ++ powerpc-*-rtems* | \ + powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*) + targ_defvec=bfd_elf32_powerpc_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" +@@ -961,8 +964,8 @@ + targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" + ;; + powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \ +- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\ +- powerpcle-*-rtems*) ++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\ ++ powerpcle-*-vxworks* | powerpcle-*-rtems*) + targ_defvec=bfd_elf32_powerpcle_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" + targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" +@@ -1110,7 +1113,7 @@ + targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" + targ_underscore=yes + ;; +- sparc-*-linux-gnu*) ++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*) + targ_defvec=bfd_elf32_sparc_vec + targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec" + ;; +@@ -1157,7 +1160,7 @@ + targ_defvec=sunos_big_vec + targ_underscore=yes + ;; +- sparc64-*-linux-gnu*) ++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) + targ_defvec=bfd_elf64_sparc_vec + targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec" + ;; +diff -urN binutils-2.14.90.0.6/bfd/configure binutils-2.14.90.0.6-uClibc/bfd/configure +--- binutils-2.14.90.0.6/bfd/configure 2003-08-21 10:28:47.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/bfd/configure 2004-01-06 20:26:51.000000000 -0600 +@@ -1698,6 +1698,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' +@@ -5102,7 +5107,7 @@ + alpha*-*-freebsd*) + COREFILE='' + ;; +- alpha*-*-linux-gnu*) ++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/alphalinux.h"' + ;; +@@ -5161,7 +5166,7 @@ + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386mach3.h"' + ;; +- i[3-7]86-*-linux-gnu*) ++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386linux.h"' + ;; +@@ -5211,7 +5216,7 @@ + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/hp300bsd.h"' + ;; +- m68*-*-linux-gnu*) ++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/m68klinux.h"' + ;; +diff -urN binutils-2.14.90.0.6/bfd/configure.in binutils-2.14.90.0.6-uClibc/bfd/configure.in +--- binutils-2.14.90.0.6/bfd/configure.in 2003-08-21 10:28:47.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/bfd/configure.in 2004-01-06 20:33:02.000000000 -0600 +@@ -153,7 +153,7 @@ + alpha*-*-freebsd*) + COREFILE='' + ;; +- alpha*-*-linux-gnu*) ++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/alphalinux.h"' + ;; +@@ -233,7 +233,7 @@ + TRAD_HEADER='"hosts/i386mach3.h"' + ;; + changequote(,)dnl +- i[3-7]86-*-linux-gnu*) ++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) + changequote([,])dnl + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386linux.h"' +@@ -286,7 +286,7 @@ + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/hp300bsd.h"' + ;; +- m68*-*-linux-gnu*) ++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/m68klinux.h"' + ;; +diff -urN binutils-2.14.90.0.6/config.sub binutils-2.14.90.0.6-uClibc/config.sub +--- binutils-2.14.90.0.6/config.sub 2003-08-21 10:28:47.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/config.sub 2004-01-06 22:56:56.000000000 -0600 +@@ -118,7 +118,7 @@ + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in +- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) ++ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; +@@ -1131,7 +1131,8 @@ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ +- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ ++ | -mingw32* | -linux-gnu* | -linux-uclibc* \ ++ | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ +diff -urN binutils-2.14.90.0.6/configure binutils-2.14.90.0.6-uClibc/configure +--- binutils-2.14.90.0.6/configure 2003-08-21 10:29:32.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/configure 2004-01-07 05:43:40.000000000 -0600 +@@ -1257,6 +1262,18 @@ + i[3456789]86-*-freebsd*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; ++ i[3456789]86-*-linux-uclibc) ++ # This section makes it possible to build newlib natively on linux. ++ # If we are using a cross compiler then don't configure newlib. ++ if test x${is_cross_compiler} != xno ; then ++ noconfigdirs="$noconfigdirs target-newlib" ++ fi ++ noconfigdirs="$noconfigdirs target-libgloss" ++ # If we are not using a cross compiler, do configure newlib. ++ # Note however, that newlib will only be configured in this situation ++ # if the --with-newlib option has been given, because otherwise ++ # 'target-newlib' will appear in skipdirs. ++ ;; + i[3456789]86-*-linux*) + # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's + # not build java stuff by default. +diff -urN binutils-2.14.90.0.6/configure.in binutils-2.14.90.0.6-uClibc/configure.in +--- binutils-2.14.90.0.6/configure.in 2003-08-21 10:29:30.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/configure.in 2004-01-07 05:44:02.000000000 -0600 +@@ -508,6 +513,19 @@ + i[[3456789]]86-*-freebsd*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; ++ i[3456789]86-*-linux-uclibc) ++ # This section makes it possible to build newlib natively on linux. ++ # If we are using a cross compiler then don't configure newlib. ++ if test x${is_cross_compiler} != xno ; then ++ noconfigdirs="$noconfigdirs target-newlib" ++ fi ++ noconfigdirs="$noconfigdirs target-libgloss" ++ build_modules= ++ # If we are not using a cross compiler, do configure newlib. ++ # Note however, that newlib will only be configured in this situation ++ # if the --with-newlib option has been given, because otherwise ++ # 'target-newlib' will appear in skipdirs. ++ ;; + i[[3456789]]86-*-linux*) + # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's + # not build java stuff by default. +diff -urN binutils-2.14.90.0.6/demangler/configure binutils-2.14.90.0.6-uClibc/demangler/configure +--- binutils-2.14.90.0.6/demangler/configure 2003-08-21 10:29:31.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/demangler/configure 2004-01-06 21:45:51.000000000 -0600 +@@ -1363,6 +1363,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' +diff -urN binutils-2.14.90.0.6/gas/configure binutils-2.14.90.0.6-uClibc/gas/configure +--- binutils-2.14.90.0.6/gas/configure 2003-07-23 10:08:10.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/gas/configure 2004-01-06 21:57:25.000000000 -0600 +@@ -1576,6 +1576,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' +@@ -2370,6 +2375,7 @@ + alpha*-*-osf*) fmt=ecoff ;; + alpha*-*-linuxecoff*) fmt=ecoff ;; + alpha*-*-linux-gnu*) fmt=elf em=linux ;; ++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;; + alpha*-*-netbsd*) fmt=elf em=nbsd ;; + alpha*-*-openbsd*) fmt=elf em=obsd ;; + +@@ -2386,6 +2392,7 @@ + arm*-*-conix*) fmt=elf ;; + arm-*-linux*aout*) fmt=aout em=linux ;; + arm*-*-linux-gnu*) fmt=elf em=linux ;; ++ arm*-*-linux-uclibc*) fmt=elf em=linux ;; + arm*-*-uclinux*) fmt=elf em=linux ;; + arm-*-netbsdelf*) fmt=elf em=nbsd ;; + arm-*-*n*bsd*) fmt=aout em=nbsd ;; +@@ -2400,6 +2407,7 @@ + avr-*-*) fmt=elf ;; + + cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;; ++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;; + cris-*-*) fmt=multi bfd_gas=yes ;; + + d10v-*-*) fmt=elf ;; +@@ -2455,7 +2463,9 @@ + i386-*-linux*oldld) fmt=aout em=linux ;; + i386-*-linux*coff*) fmt=coff em=linux ;; + i386-*-linux-gnu*) fmt=elf em=linux ;; ++ i386-*-linux-uclibc*) fmt=elf em=linux ;; + x86_64-*-linux-gnu*) fmt=elf em=linux ;; ++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;; + i386-*-lynxos*) fmt=coff em=lynx ;; + i386-*-sysv[45]*) fmt=elf ;; + i386-*-solaris*) fmt=elf ;; +@@ -2512,6 +2522,7 @@ + ia64-*-elf*) fmt=elf ;; + ia64-*-aix*) fmt=elf em=ia64aix ;; + ia64-*-linux-gnu*) fmt=elf em=linux ;; ++ ia64-*-linux-uclibc*) fmt=elf em=linux ;; + ia64-*-hpux*) fmt=elf em=hpux ;; + ia64-*-netbsd*) fmt=elf em=nbsd ;; + +@@ -2538,6 +2549,7 @@ + m68k-*-hpux*) fmt=hp300 em=hp300 ;; + m68k-*-linux*aout*) fmt=aout em=linux ;; + m68k-*-linux-gnu*) fmt=elf em=linux ;; ++ m68k-*-linux-uclibc*) fmt=elf em=linux ;; + m68k-*-gnu*) fmt=elf ;; + m68k-*-lynxos*) fmt=coff em=lynx ;; + m68k-*-netbsdelf*) fmt=elf em=nbsd ;; +@@ -2592,6 +2604,7 @@ + ppc-*-beos*) fmt=coff ;; + ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;; + ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;; ++ ppc-*-linux-uclibc* | \ + ppc-*-linux-gnu*) fmt=elf + case "$endian" in + big) ;; +@@ -2616,7 +2629,9 @@ + ppc-*-kaos*) fmt=elf ;; + + s390x-*-linux-gnu*) fmt=elf em=linux ;; ++ s390x-*-linux-uclibc*) fmt=elf em=linux ;; + s390-*-linux-gnu*) fmt=elf em=linux ;; ++ s390-*-linux-uclibc*) fmt=elf em=linux ;; + + sh*-*-linux*) fmt=elf em=linux + case ${cpu} in +@@ -2649,6 +2664,7 @@ + sparc-*-coff) fmt=coff ;; + sparc-*-linux*aout*) fmt=aout em=linux ;; + sparc-*-linux-gnu*) fmt=elf em=linux ;; ++ sparc-*-linux-uclibc*) fmt=elf em=linux ;; + sparc-*-lynxos*) fmt=coff em=lynx ;; + sparc-fujitsu-none) fmt=aout ;; + sparc-*-elf) fmt=elf ;; +diff -urN binutils-2.14.90.0.6/gas/configure.in binutils-2.14.90.0.6-uClibc/gas/configure.in +--- binutils-2.14.90.0.6/gas/configure.in 2003-07-23 10:08:10.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/gas/configure.in 2004-01-06 21:57:26.000000000 -0600 +@@ -184,6 +184,7 @@ + alpha*-*-osf*) fmt=ecoff ;; + alpha*-*-linuxecoff*) fmt=ecoff ;; + alpha*-*-linux-gnu*) fmt=elf em=linux ;; ++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;; + alpha*-*-netbsd*) fmt=elf em=nbsd ;; + alpha*-*-openbsd*) fmt=elf em=obsd ;; + +@@ -200,6 +201,7 @@ + arm*-*-conix*) fmt=elf ;; + arm-*-linux*aout*) fmt=aout em=linux ;; + arm*-*-linux-gnu*) fmt=elf em=linux ;; ++ arm*-*-linux-uclibc*) fmt=elf em=linux ;; + arm*-*-uclinux*) fmt=elf em=linux ;; + arm-*-netbsdelf*) fmt=elf em=nbsd ;; + arm-*-*n*bsd*) fmt=aout em=nbsd ;; +@@ -214,6 +216,7 @@ + avr-*-*) fmt=elf ;; + + cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;; ++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;; + cris-*-*) fmt=multi bfd_gas=yes ;; + + d10v-*-*) fmt=elf ;; +@@ -269,7 +272,9 @@ + i386-*-linux*oldld) fmt=aout em=linux ;; + i386-*-linux*coff*) fmt=coff em=linux ;; + i386-*-linux-gnu*) fmt=elf em=linux ;; ++ i386-*-linux-uclibc*) fmt=elf em=linux ;; + x86_64-*-linux-gnu*) fmt=elf em=linux ;; ++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;; + i386-*-lynxos*) fmt=coff em=lynx ;; + changequote(,)dnl + i386-*-sysv[45]*) fmt=elf ;; +@@ -322,6 +327,7 @@ + ia64-*-elf*) fmt=elf ;; + ia64-*-aix*) fmt=elf em=ia64aix ;; + ia64-*-linux-gnu*) fmt=elf em=linux ;; ++ ia64-*-linux-uclibc*) fmt=elf em=linux ;; + ia64-*-hpux*) fmt=elf em=hpux ;; + ia64-*-netbsd*) fmt=elf em=nbsd ;; + +@@ -348,6 +354,7 @@ + m68k-*-hpux*) fmt=hp300 em=hp300 ;; + m68k-*-linux*aout*) fmt=aout em=linux ;; + m68k-*-linux-gnu*) fmt=elf em=linux ;; ++ m68k-*-linux-uclibc*) fmt=elf em=linux ;; + m68k-*-gnu*) fmt=elf ;; + m68k-*-lynxos*) fmt=coff em=lynx ;; + m68k-*-netbsdelf*) fmt=elf em=nbsd ;; +@@ -402,6 +409,7 @@ + ppc-*-beos*) fmt=coff ;; + ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;; + ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;; ++ ppc-*-linux-uclibc* | \ + ppc-*-linux-gnu*) fmt=elf + case "$endian" in + big) ;; +@@ -424,7 +432,9 @@ + ppc-*-kaos*) fmt=elf ;; + + s390x-*-linux-gnu*) fmt=elf em=linux ;; ++ s390x-*-linux-uclibc*) fmt=elf em=linux ;; + s390-*-linux-gnu*) fmt=elf em=linux ;; ++ s390-*-linux-uclibc*) fmt=elf em=linux ;; + + sh*-*-linux*) fmt=elf em=linux + case ${cpu} in +@@ -457,6 +467,7 @@ + sparc-*-coff) fmt=coff ;; + sparc-*-linux*aout*) fmt=aout em=linux ;; + sparc-*-linux-gnu*) fmt=elf em=linux ;; ++ sparc-*-linux-uclibc*) fmt=elf em=linux ;; + sparc-*-lynxos*) fmt=coff em=lynx ;; + sparc-fujitsu-none) fmt=aout ;; + sparc-*-elf) fmt=elf ;; +diff -urN binutils-2.14.90.0.6/ld/configure binutils-2.14.90.0.6-uClibc/ld/configure +--- binutils-2.14.90.0.6/ld/configure 2003-05-05 16:46:49.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/ld/configure 2004-01-06 21:59:31.000000000 -0600 +@@ -1578,6 +1578,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' +diff -urN binutils-2.14.90.0.6/ld/configure.tgt binutils-2.14.90.0.6-uClibc/ld/configure.tgt +--- binutils-2.14.90.0.6/ld/configure.tgt 2003-08-21 10:28:48.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/ld/configure.tgt 2004-01-06 22:09:40.000000000 -0600 +@@ -30,6 +30,7 @@ + targ_extra_emuls="criself crislinux" + targ_extra_libpath=$targ_extra_emuls ;; + cris-*-linux-gnu*) targ_emul=crislinux ;; ++cris-*-linux-uclibc*) targ_emul=crislinux ;; + cris-*-*) targ_emul=criself + targ_extra_emuls="crisaout crislinux" + targ_extra_libpath=$targ_extra_emuls ;; +@@ -59,14 +60,16 @@ + tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'` + tdir_sun4=sparc-sun-sunos4 + ;; +-sparc64-*-linux-gnu*) targ_emul=elf64_sparc ++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \ ++ targ_emul=elf64_sparc + targ_extra_emuls="elf32_sparc sparclinux sun4" + targ_extra_libpath=elf32_sparc + tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'` + tdir_sparclinux=${tdir_elf32_sparc}aout + tdir_sun4=sparc-sun-sunos4 + ;; +-sparc*-*-linux-gnu*) targ_emul=elf32_sparc ++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \ ++ targ_emul=elf32_sparc + targ_extra_emuls="sparclinux elf64_sparc sun4" + targ_extra_libpath=elf64_sparc + tdir_sparclinux=${targ_alias}aout +@@ -124,7 +127,7 @@ + m68*-ericsson-ose) targ_emul=sun3 ;; + m68*-apple-aux*) targ_emul=m68kaux ;; + *-tandem-none) targ_emul=st2000 ;; +-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;; ++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;; + i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;; + i[3-7]86-*-vsta) targ_emul=vsta ;; + i[3-7]86-go32-rtems*) targ_emul=i386go32 ;; +@@ -148,14 +151,16 @@ + tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` + ;; + i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;; +-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386 ++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \ ++ targ_emul=elf_i386 + targ_extra_emuls=i386linux + if test x${want64} = xtrue; then + targ_extra_emuls="$targ_extra_emuls elf_x86_64" + fi + tdir_i386linux=${targ_alias}aout + ;; +-x86_64-*-linux-gnu*) targ_emul=elf_x86_64 ++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \ ++ targ_emul=elf_x86_64 + targ_extra_emuls="elf_i386 i386linux" + targ_extra_libpath=elf_i386 + tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'` +@@ -250,10 +255,13 @@ + arm9e-*-elf) targ_emul=armelf ;; + arm-*-oabi) targ_emul=armelf_oabi ;; + arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;; ++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;; + arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; ++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; + arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; + arm*-*-conix*) targ_emul=armelf ;; +-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; ++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \ ++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;; + strongarm-*-coff) targ_emul=armcoff ;; + strongarm-*-elf) targ_emul=armelf ;; + strongarm-*-kaos*) targ_emul=armelf ;; +@@ -354,7 +362,8 @@ + targ_extra_emuls=m68kelf + tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'` + ;; +-m68k-*-linux-gnu*) targ_emul=m68kelf ++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \ ++ targ_emul=m68kelf + targ_extra_emuls=m68klinux + tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'` + ;; +@@ -370,9 +379,9 @@ + m68*-*-psos*) targ_emul=m68kpsos ;; + m68*-*-rtemscoff*) targ_emul=m68kcoff ;; + m68*-*-rtems*) targ_emul=m68kelf ;; +-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;; ++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;; + hppa*64*-*) targ_emul=elf64hppa ;; +-hppa*-*-linux-gnu*) targ_emul=hppalinux ;; ++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;; + hppa*-*-*elf*) targ_emul=hppaelf ;; + hppa*-*-lites*) targ_emul=hppaelf ;; + hppa*-*-netbsd*) targ_emul=hppanbsd ;; +@@ -416,16 +425,20 @@ + mips*-*-rtems*) targ_emul=elf32ebmip ;; + mips*el-*-vxworks*) targ_emul=elf32elmip ;; + mips*-*-vxworks*) targ_emul=elf32ebmip ;; +-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32 ++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) \ ++ targ_emul=elf32ltsmipn32 + targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" + ;; +-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32 ++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) \ ++ targ_emul=elf32btsmipn32 + targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" + ;; +-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip ++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) \ ++ targ_emul=elf32ltsmip + targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" + ;; +-mips*-*-linux-gnu*) targ_emul=elf32btsmip ++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) \ ++ targ_emul=elf32btsmip + targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip" + ;; + mips*-*-lnews*) targ_emul=mipslnews ;; +@@ -447,6 +460,10 @@ + alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha + tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'` + ;; ++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha ++ # The following needs to be checked... ++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'` ++ ;; + alpha*-*-osf*) targ_emul=alpha ;; + alpha*-*-gnu*) targ_emul=elf64alpha ;; + alpha*-*-netware*) targ_emul=alpha ;; +diff -urN binutils-2.14.90.0.6/libtool.m4 binutils-2.14.90.0.6-uClibc/libtool.m4 +--- binutils-2.14.90.0.6/libtool.m4 2003-05-05 16:46:46.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/libtool.m4 2004-01-06 20:30:39.000000000 -0600 +@@ -645,6 +645,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'] +diff -urN binutils-2.14.90.0.6/ltconfig binutils-2.14.90.0.6-uClibc/ltconfig +--- binutils-2.14.90.0.6/ltconfig 2003-07-23 10:08:08.000000000 -0500 ++++ binutils-2.14.90.0.6-uClibc/ltconfig 2004-01-06 21:05:11.000000000 -0600 +@@ -603,6 +603,7 @@ + # Transform linux* to *-*-linux-gnu*, to support old configure scripts. + case $host_os in + linux-gnu*) ;; ++linux-uclibc*) ;; + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` + esac + +@@ -1259,6 +1260,24 @@ + dynamic_linker='GNU/Linux ld.so' + ;; + ++linux-uclibc*) ++ version_type=linux ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' ++ soname_spec='${libname}${release}.so$major' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ # This implies no fast_install, which is unacceptable. ++ # Some rework will be needed to allow for fast_install ++ # before this can be enabled. ++ # Note: copied from linux-gnu, and may not be appropriate. ++ hardcode_into_libs=yes ++ # Assume using the uClibc dynamic linker. ++ dynamic_linker="uClibc ld.so" ++ ;; ++ + netbsd*) + need_lib_prefix=no + need_version=no diff -Naur crosstool-0.28-rc5-orig/patches/gcc-3.3.3/uclibc-target-01.patch crosstool-0.28-rc5/patches/gcc-3.3.3/uclibc-target-01.patch --- crosstool-0.28-rc5-orig/patches/gcc-3.3.3/uclibc-target-01.patch 1969-12-31 16:00:00.000000000 -0800 +++ crosstool-0.28-rc5/patches/gcc-3.3.3/uclibc-target-01.patch 2004-06-19 12:17:30.000000000 -0700 @@ -0,0 +1,1605 @@ +Provided by the uClibc project. + +This is the base patch for uClibc target support, enabling gcc to compile +directly for *-*-linux-uclibc targets, using the ARM, CRIS, MIPS, x86, sh, +and sh64 CPU architectures. Also included is everything necessary to get +libstdc++-v3 to compile against uClibc, except the config/locale/uclibc +and os/uclibc directrories. Further patches add support for other CPU +architectures, and add the missing directories for C++ support. The +patches are separated out to keep authorship straight, and respect how they +are distributed by the uClibc project. This one was written by +Manuel Novoa III, of the uClibc project. + +diff -urN gcc-3.3.3/boehm-gc/config.sub gcc-3.3.3-new/boehm-gc/config.sub +--- gcc-3.3.3/boehm-gc/config.sub 2002-02-11 22:37:53.000000000 -0600 ++++ gcc-3.3.3-new/boehm-gc/config.sub 2004-02-16 21:12:16.000000000 -0600 +@@ -118,7 +118,7 @@ + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in +- nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) ++ nto-qnx* | linux-gnu* | linux-uclibc* | storm-chaos* | os2-emx* | windows32-*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; +@@ -1089,7 +1089,8 @@ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ +- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ ++ | -mingw32* | -linux-gnu* | -linux-uclibc* \ ++ | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ +diff -urN gcc-3.3.3/config.sub gcc-3.3.3-new/config.sub +--- gcc-3.3.3/config.sub 2003-01-30 17:25:36.000000000 -0600 ++++ gcc-3.3.3-new/config.sub 2004-02-16 21:12:16.000000000 -0600 +@@ -118,7 +118,7 @@ + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in +- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) ++ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; +@@ -1112,7 +1112,8 @@ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ +- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ ++ | -mingw32* | -linux-gnu* | -linux-uclibc* \ ++ | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ +diff -urN gcc-3.3.3/gcc/config/arm/linux-elf.h gcc-3.3.3-new/gcc/config/arm/linux-elf.h +--- gcc-3.3.3/gcc/config/arm/linux-elf.h 2003-09-16 10:39:23.000000000 -0500 ++++ gcc-3.3.3-new/gcc/config/arm/linux-elf.h 2004-02-16 21:12:16.000000000 -0600 +@@ -78,6 +78,18 @@ + "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" + + #undef LINK_SPEC ++#ifdef USE_UCLIBC ++#define LINK_SPEC "%{h*} %{version:-v} \ ++ %{b} %{Wl,*:%*} \ ++ %{static:-Bstatic} \ ++ %{shared:-shared} \ ++ %{symbolic:-Bsymbolic} \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \ ++ -X \ ++ %{mbig-endian:-EB}" \ ++ SUBTARGET_EXTRA_LINK_SPEC ++#else + #define LINK_SPEC "%{h*} %{version:-v} \ + %{b} %{Wl,*:%*} \ + %{static:-Bstatic} \ +@@ -88,6 +100,7 @@ + -X \ + %{mbig-endian:-EB}" \ + SUBTARGET_EXTRA_LINK_SPEC ++#endif + + #define TARGET_OS_CPP_BUILTINS() \ + do { \ +diff -urN gcc-3.3.3/gcc/config/cris/linux.h gcc-3.3.3-new/gcc/config/cris/linux.h +--- gcc-3.3.3/gcc/config/cris/linux.h 2003-03-10 21:01:35.000000000 -0600 ++++ gcc-3.3.3-new/gcc/config/cris/linux.h 2004-02-16 21:12:16.000000000 -0600 +@@ -81,6 +81,25 @@ + #undef CRIS_DEFAULT_CPU_VERSION + #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG + ++#ifdef USE_UCLIBC ++ ++#undef CRIS_SUBTARGET_VERSION ++#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc" ++ ++#undef CRIS_LINK_SUBTARGET_SPEC ++#define CRIS_LINK_SUBTARGET_SPEC \ ++ "-mcrislinux\ ++ -rpath-link include/asm/../..%s\ ++ %{shared} %{static}\ ++ %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\ ++ %{!shared: \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \ ++ %{!r:%{O2|O3: --gc-sections}}" ++ ++#else /* USE_UCLIBC */ ++ + #undef CRIS_SUBTARGET_VERSION + #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu" + +@@ -95,6 +114,8 @@ + %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\ + %{!r:%{O2|O3: --gc-sections}}" + ++#endif /* USE_UCLIBC */ ++ + + /* Node: Run-time Target */ + +diff -urN gcc-3.3.3/gcc/config/cris/t-linux-uclibc gcc-3.3.3-new/gcc/config/cris/t-linux-uclibc +--- gcc-3.3.3/gcc/config/cris/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600 ++++ gcc-3.3.3-new/gcc/config/cris/t-linux-uclibc 2004-02-16 21:12:16.000000000 -0600 +@@ -0,0 +1,3 @@ ++T_CFLAGS = -DUSE_UCLIBC ++TARGET_LIBGCC2_CFLAGS += -fPIC ++CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS) +diff -urN gcc-3.3.3/gcc/config/i386/linux.h gcc-3.3.3-new/gcc/config/i386/linux.h +--- gcc-3.3.3/gcc/config/i386/linux.h 2003-11-14 00:46:12.000000000 -0600 ++++ gcc-3.3.3-new/gcc/config/i386/linux.h 2004-02-16 21:12:16.000000000 -0600 +@@ -136,6 +136,15 @@ + %{static:-static}}}" + #endif + #else ++#if defined USE_UCLIBC ++#define LINK_SPEC "-m elf_i386 %{shared:-shared} \ ++ %{!shared: \ ++ %{!ibcs: \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \ ++ %{static:-static}}}" ++#else + #define LINK_SPEC "-m elf_i386 %{shared:-shared} \ + %{!shared: \ + %{!ibcs: \ +@@ -144,6 +153,7 @@ + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ + %{static:-static}}}" + #endif ++#endif + + /* A C statement (sans semicolon) to output to the stdio stream + FILE the assembler definition of uninitialized global DECL named +diff -urN gcc-3.3.3/gcc/config/mips/linux.h gcc-3.3.3-new/gcc/config/mips/linux.h +--- gcc-3.3.3/gcc/config/mips/linux.h 2003-12-23 02:58:00.000000000 -0600 ++++ gcc-3.3.3-new/gcc/config/mips/linux.h 2004-02-16 21:12:16.000000000 -0600 +@@ -175,6 +175,17 @@ + + /* Borrowed from sparc/linux.h */ + #undef LINK_SPEC ++#ifdef USE_UCLIBC ++#define LINK_SPEC \ ++ "%(endian_spec) \ ++ %{shared:-shared} \ ++ %{!shared: \ ++ %{!ibcs: \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \ ++ %{static:-static}}}" ++#else + #define LINK_SPEC \ + "%(endian_spec) \ + %{shared:-shared} \ +@@ -184,6 +195,7 @@ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ + %{static:-static}}}" ++#endif + + #undef SUBTARGET_ASM_SPEC + #define SUBTARGET_ASM_SPEC "\ +diff -urN gcc-3.3.3/gcc/config/sh/linux.h gcc-3.3.3-new/gcc/config/sh/linux.h +--- gcc-3.3.3/gcc/config/sh/linux.h 2003-11-06 17:13:33.000000000 -0600 ++++ gcc-3.3.3-new/gcc/config/sh/linux.h 2004-02-16 21:12:16.000000000 -0600 +@@ -44,12 +44,21 @@ + #undef SUBTARGET_LINK_EMUL_SUFFIX + #define SUBTARGET_LINK_EMUL_SUFFIX "_linux" + #undef SUBTARGET_LINK_SPEC ++#ifdef USE_UCLIBC ++#define SUBTARGET_LINK_SPEC \ ++ "%{shared:-shared} \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \ ++ %{static:-static}" ++#else + #define SUBTARGET_LINK_SPEC \ + "%{shared:-shared} \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ + %{static:-static}" ++#endif + + /* The GNU C++ standard library requires that these macros be defined. */ + #undef CPLUSPLUS_CPP_SPEC +diff -urN gcc-3.3.3/gcc/config/sh/t-linux-uclibc gcc-3.3.3-new/gcc/config/sh/t-linux-uclibc +--- gcc-3.3.3/gcc/config/sh/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600 ++++ gcc-3.3.3-new/gcc/config/sh/t-linux-uclibc 2004-02-16 21:12:16.000000000 -0600 +@@ -0,0 +1,16 @@ ++T_CFLAGS = -DUSE_UCLIBC ++ ++# Don't run fixproto ++STMP_FIXPROTO = ++ ++TARGET_LIBGCC2_CFLAGS = -fpic ++LIB1ASMFUNCS_CACHE = _ic_invalidate ++ ++LIB2FUNCS_EXTRA= ++ ++MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) m3e/m4 ++MULTILIB_DIRNAMES= ++MULTILIB_MATCHES = ++MULTILIB_EXCEPTIONS= ++ ++EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o +diff -urN gcc-3.3.3/gcc/config/sh/t-sh64-uclibc gcc-3.3.3-new/gcc/config/sh/t-sh64-uclibc +--- gcc-3.3.3/gcc/config/sh/t-sh64-uclibc 1969-12-31 18:00:00.000000000 -0600 ++++ gcc-3.3.3-new/gcc/config/sh/t-sh64-uclibc 2004-02-16 21:12:16.000000000 -0600 +@@ -0,0 +1,13 @@ ++EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o ++ ++LIB1ASMFUNCS = \ ++ _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \ ++ _shcompact_call_trampoline _shcompact_return_trampoline \ ++ _shcompact_incoming_args _ic_invalidate _nested_trampoline \ ++ _push_pop_shmedia_regs \ ++ _udivdi3 _divdi3 _umoddi3 _moddi3 ++ ++MULTILIB_OPTIONS = $(MULTILIB_ENDIAN) m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu ++MULTILIB_DIRNAMES= $(MULTILIB_ENDIAN) nofpu compact nofpu/compact media64 nofpu/media64 ++MULTILIB_MATCHES= ++MULTILIB_EXCEPTIONS= +diff -urN gcc-3.3.3/gcc/config/t-linux-uclibc gcc-3.3.3-new/gcc/config/t-linux-uclibc +--- gcc-3.3.3/gcc/config/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600 ++++ gcc-3.3.3-new/gcc/config/t-linux-uclibc 2004-02-16 21:12:16.000000000 -0600 +@@ -0,0 +1,23 @@ ++T_CFLAGS = -DUSE_UCLIBC ++ ++# Don't run fixproto ++STMP_FIXPROTO = ++ ++# Compile crtbeginS.o and crtendS.o with pic. ++CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC ++# Compile libgcc2.a with pic. ++TARGET_LIBGCC2_CFLAGS = -fPIC ++ ++# Override t-slibgcc-elf-ver to export some libgcc symbols with ++# the symbol versions that glibc used. ++SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver ++ ++# Use unwind-dw2-fde-glibc ++#LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \ ++# $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c ++#LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c ++ ++# Use unwind-dw2-fde ++LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ ++ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c ++LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h +diff -urN gcc-3.3.3/gcc/config.gcc gcc-3.3.3-new/gcc/config.gcc +--- gcc-3.3.3/gcc/config.gcc 2004-01-21 00:06:00.000000000 -0600 ++++ gcc-3.3.3-new/gcc/config.gcc 2004-02-16 21:12:16.000000000 -0600 +@@ -697,6 +697,17 @@ + extra_parts="" + use_collect2=yes + ;; ++arm*-*-linux-uclibc*) # ARM GNU/Linux with ELF - uClibc ++ tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h" ++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc arm/t-linux" ++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" ++ gnu_ld=yes ++ case x${enable_threads} in ++ x | xyes | xpthreads | xposix) ++ thread_file='posix' ++ ;; ++ esac ++ ;; + arm*-*-linux*) # ARM GNU/Linux with ELF + tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h" + tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux" +@@ -772,6 +783,10 @@ + tmake_file="cris/t-cris cris/t-elfmulti" + gas=yes + ;; ++cris-*-linux-uclibc*) ++ tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h" ++ tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux-uclibc" ++ ;; + cris-*-linux*) + tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h" + tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux" +@@ -1173,6 +1188,11 @@ + thread_file='single' + fi + ;; ++i[34567]86-*-linux*uclibc*) # Intel 80386's running GNU/Linux ++ # with ELF format using uClibc ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h" ++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc i386/t-crtstuff" ++ ;; + i[34567]86-*-linux*) # Intel 80386's running GNU/Linux + # with ELF format using glibc 2 + # aka GNU/Linux C library 6 +@@ -1883,6 +1903,16 @@ + tm_file="elfos.h ${tm_file} mips/netbsd.h" + tmake_file="${tmake_file} mips/t-netbsd" + ;; ++mips*-*-linux-uclibc*) # Linux MIPS, either endian. uClibc ++ tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h" ++ case $machine in ++ mipsisa32*-*) ++ target_cpu_default="MASK_SOFT_FLOAT" ++ tm_defines="MIPS_ISA_DEFAULT=32" ++ ;; ++ esac ++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc mips/t-linux" ++ ;; + mips*-*-linux*) # Linux MIPS, either endian. + tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h" + case $machine in +@@ -2129,6 +2159,11 @@ + out_file=rs6000/rs6000.c + tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm" + ;; ++powerpc-*-linux-uclibc*) ++ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h" ++ out_file=rs6000/rs6000.c ++ tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux-uclibc rs6000/t-ppccomm" ++ ;; + powerpc-*-linux*) + tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h" + out_file=rs6000/rs6000.c +@@ -2313,10 +2348,18 @@ + tmake_file="${tmake_file} sh/t-le" + ;; + esac +- tmake_file="${tmake_file} sh/t-linux" ++ case $machine in ++ *-*-linux-uclibc*) tmake_file="${tmake_file} sh/t-linux-uclibc" ;; ++ *) tmake_file="${tmake_file} sh/t-linux" ;; ++ esac + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/linux.h" + gas=yes gnu_ld=yes + case $machine in ++ sh64*-*-linux-uclibc*) ++ tmake_file="${tmake_file} sh/t-sh64-uclibc" ++ tm_file="${tm_file} sh/sh64.h" ++ extra_headers="shmedia.h ushmedia.h sshmedia.h" ++ ;; + sh64*) + tmake_file="${tmake_file} sh/t-sh64" + tm_file="${tm_file} sh/sh64.h" +diff -urN gcc-3.3.3/libstdc++-v3/aclocal.m4 gcc-3.3.3-new/libstdc++-v3/aclocal.m4 +--- gcc-3.3.3/libstdc++-v3/aclocal.m4 2004-01-12 10:18:44.000000000 -0600 ++++ gcc-3.3.3-new/libstdc++-v3/aclocal.m4 2004-02-16 21:12:16.000000000 -0600 +@@ -1216,6 +1216,9 @@ + dnl Default to "generic" + if test x$enable_clocale_flag = xno; then + case x${target_os} in ++ xlinux-uclibc*) ++ enable_clocale_flag=uclibc ++ ;; + xlinux* | xgnu*) + AC_EGREP_CPP([_GLIBCPP_ok], [ + #include +@@ -1339,6 +1342,41 @@ + CTIME_CC=config/locale/generic/time_members.cc + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h + ;; ++ xuclibc) ++ AC_MSG_RESULT(uclibc) ++ ++ # Declare intention to use gettext, and add support for specific ++ # languages. ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT ++ ALL_LINGUAS="de fr" ++ ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. ++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then ++ USE_NLS=yes ++ fi ++ # Export the build objects. ++ for ling in $ALL_LINGUAS; do \ ++ glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \ ++ glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \ ++ done ++ AC_SUBST(glibcpp_MOFILES) ++ AC_SUBST(glibcpp_POFILES) ++ ++ CLOCALE_H=config/locale/uclibc/c_locale.h ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc ++ CCODECVT_H=config/locale/uclibc/codecvt_specializations.h ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc ++ CMESSAGES_H=config/locale/uclibc/messages_members.h ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc ++ CTIME_H=config/locale/uclibc/time_members.h ++ CTIME_CC=config/locale/uclibc/time_members.cc ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h ++ ;; + *) + echo "$enable_clocale is an unknown locale package" 1>&2 + exit 1 +diff -urN gcc-3.3.3/libstdc++-v3/configure gcc-3.3.3-new/libstdc++-v3/configure +--- gcc-3.3.3/libstdc++-v3/configure 2004-01-12 10:18:45.000000000 -0600 ++++ gcc-3.3.3-new/libstdc++-v3/configure 2004-02-17 00:21:12.000000000 -0600 +@@ -2996,6 +2996,9 @@ + + if test x$enable_clocale_flag = xno; then + case x${target_os} in ++ xlinux-uclibc*) ++ enable_clocale_flag=uclibc ++ ;; + xlinux* | xgnu*) + cat > conftest.$ac_ext <&6 ++ ++ # Declare intention to use gettext, and add support for specific ++ # languages. ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT ++ ALL_LINGUAS="de fr" ++ ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. ++ # Extract the first word of "msgfmt", so it can be a program name with args. ++set dummy msgfmt; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:3117: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_check_msgfmt'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test -n "$check_msgfmt"; then ++ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test. ++else ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_check_msgfmt="yes" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" ++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no" ++fi ++fi ++check_msgfmt="$ac_cv_prog_check_msgfmt" ++if test -n "$check_msgfmt"; then ++ echo "$ac_t""$check_msgfmt" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then ++ USE_NLS=yes ++ fi ++ # Export the build objects. ++ for ling in $ALL_LINGUAS; do \ ++ glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \ ++ glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \ ++ done ++ ++ ++ ++ CLOCALE_H=config/locale/uclibc/c_locale.h ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc ++ CCODECVT_H=config/locale/uclibc/codecvt_specializations.h ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc ++ CMESSAGES_H=config/locale/uclibc/messages_members.h ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc ++ CTIME_H=config/locale/uclibc/time_members.h ++ CTIME_CC=config/locale/uclibc/time_members.cc ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h ++ ;; + *) + echo "$enable_clocale is an unknown locale package" 1>&2 + exit 1 +@@ -4212,6 +4279,968 @@ + # GLIBCPP_CHECK_MATH_SUPPORT + + case "$target" in ++ *-uclibc*) ++ os_include_dir="os/uclibc" ++ for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h \ ++ machine/endian.h machine/param.h sys/machine.h sys/types.h \ ++ fp.h locale.h float.h inttypes.h ++do ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "chec