📄 crosstool-0.38-uclibc1.diff
字号:
diff -urN crosstool-0.38.orig/all.sh crosstool-0.38/all.sh--- crosstool-0.38.orig/all.sh 2005-07-07 23:18:01.000000000 +0200+++ crosstool-0.38/all.sh 2005-11-22 11:19:36.000000000 +0100@@ -18,14 +18,20 @@ 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" -# When building a cygwin target LINUX_DIR and GLIBC_DIR are not needed.+# When building a cygwin target LINUX_DIR and LIBC_DIR are not needed. if test "${CYGWIN_DIR}" = ""; then if test -z "${LINUX_SANITIZED_HEADER_DIR}" ; then test -z "${LINUX_DIR}" && abort "Please set either LINUX_DIR or LINUX_SANITIZED_HEADER_DIR to the bare filename of the tarball or directory containing the kernel headers" else test -n "${LINUX_DIR}" && echo "You set both LINUX_DIR and LINUX_SANITIZED_HEADER_DIR - ignoring LINUX_DIR for the build" fi- 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 libc 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 fi # Five environment variables are optional, namely:@@ -38,7 +44,7 @@ set -ex -TOOLCOMBO=$GCC_DIR-$GLIBC_DIR+TOOLCOMBO=$GCC_DIR-$LIBC_DIR BUILD_DIR=`pwd`/build/$TARGET/$TOOLCOMBO TOP_DIR=`pwd`@@ -50,15 +56,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 test -w /tmp || abort "Cannot write to /tmp. This makes patch and configure scripts unhappy. Please fix."@@ -120,8 +128,12 @@ 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 if test "${CYGWIN_DIR}" = ""; then@@ -131,7 +143,7 @@ fi cd $TOP_DIR - sh testhello.sh+ sh testhello.sh $GCC_LANGUAGES fi if test "$opt_gdb" = "1"; then # Build a debuggerdiff -urN crosstool-0.38.orig/arm-softfloat-uclibc.dat crosstool-0.38/arm-softfloat-uclibc.dat--- crosstool-0.38.orig/arm-softfloat-uclibc.dat 1970-01-01 01:00:00.000000000 +0100+++ crosstool-0.38/arm-softfloat-uclibc.dat 2005-11-22 11:19:36.000000000 +0100@@ -0,0 +1,5 @@+KERNELCONFIG=`pwd`/arm.config+TARGET=arm-softfloat-linux-uclibc+TARGET_CFLAGS="-O"+GCC_EXTRA_CONFIG="--with-float=soft"+GLIBC_EXTRA_CONFIG="--without-fp"diff -urN crosstool-0.38.orig/crosstest.sh crosstool-0.38/crosstest.sh--- crosstool-0.38.orig/crosstest.sh 2005-05-20 07:54:43.000000000 +0200+++ crosstool-0.38/crosstest.sh 2005-11-22 11:22:01.000000000 +0100@@ -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"@@ -109,8 +115,8 @@ find . -name '*.log' | xargs rm -f #--- glibc tests ----if true; then-cd build-glibc+if test "${C_LIBRARY}" = glibc ; then+cd build-libc make tests @@ -150,20 +156,20 @@ echo "rm -rf $BUILD_DIR || true" >> ../glibctest.sh # this fails on one of my systems with EDIRTOOLONG (glibc problem?), so break it up-#echo "mkdir -p $BUILD_DIR; ln -s /build-glibc $BUILD_DIR/build-glibc" >> ../glibctest.sh+#echo "mkdir -p $BUILD_DIR; ln -s /build-libc $BUILD_DIR/build-libc" >> ../glibctest.sh echo "mkdir -p $TOP_DIR" >> ../glibctest.sh >> ../glibctest.sh REST=`echo $BUILD_DIR | sed 's,$TOP_DIR/,,'`-echo "(cd $TOP_DIR; mkdir -p $REST; ln -s /build-glibc $REST/build-glibc)" >> ../glibctest.sh+echo "(cd $TOP_DIR; mkdir -p $REST; ln -s /build-libc $REST/build-libc)" >> ../glibctest.sh # For some reason, several dlfcn and elf tests don't pass without LD_LIBRARY_PATH-echo "LD_LIBRARY_PATH=../../build-glibc/elf:../../build-glibc/dlfcn; export LD_LIBRARY_PATH" >> ../glibctest.sh+echo "LD_LIBRARY_PATH=../../build-libc/elf:../../build-libc/dlfcn; export LD_LIBRARY_PATH" >> ../glibctest.sh cat ../tests.out >> ../glibctest.sh # Grab files needed to run tests cd .. TESTPROGRAMS=`grep = tests.out | sed 's/[A-Z_]*=[^ ]* *//g;s/ .*//' | sort -u | sed "s,$REMOTE_TOP/,,"` INPUTFILES="glibc*/*/*.input glibc*/stdio-common/xbug.c glibc*/io/Makefile glibc*/io/bug-ftw2.c"-TESTLIBS=`ls build-glibc/elf/*.so build-glibc/dlfcn/*.so | grep -v ld.so`+TESTLIBS=`ls build-libc/elf/*.so build-libc/dlfcn/*.so | grep -v ld.so` tar -czf test.tar.gz glibctest.sh $TESTPROGRAMS $INPUTFILES $TESTLIBS # Strip the executables we're going to send to the target - makes a difference when compiled -g rm -rf tmp || true@@ -177,15 +183,15 @@ rm -rf tmp # Transfer to target system and run. -rsh -n -l root-jail $REMOTE rm -rf build-glibc+rsh -n -l root-jail $REMOTE rm -rf build-libc cat test.tar.gz | rsh -l root-jail $REMOTE tar -xzf - rsh -n -l root-jail $REMOTE sh -e glibctest.sh > glibctest.out 2>&1 if grep Error glibctest.out; then- echo "Some glibc test failed. Check logfiles on target in /jail/build-glibc/*/*.out."+ echo "Some glibc test failed. Check logfiles on target in /jail/build-libc/*/*.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 ---@@ -254,7 +260,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 .. @@ -270,7 +276,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 -urN crosstool-0.38.orig/crosstool.sh crosstool-0.38/crosstool.sh--- crosstool-0.38.orig/crosstool.sh 2005-07-21 19:58:19.000000000 +0200+++ crosstool-0.38/crosstool.sh 2005-11-22 11:20:53.000000000 +0100@@ -33,7 +33,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 "${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)" if test -z "${LINUX_SANITIZED_HEADER_DIR}" ; then@@ -61,6 +67,8 @@ test -z "${GCC_HOST}" && echo "GCC_HOST not set, assuming HOST=BUILD" test -z "${KERNELCONFIG}" && test ! -f ${LINUX_DIR}/.config && echo "KERNELCONFIG not set, and no .config file found, so not configuring linux kernel" 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 "${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 "${SHARED_MODE}" && SHARED_MODE="--enable-shared" && echo "SHARED_MODE not set, so defaulting to --enable-shared" test -z "${GCC_LANGUAGES}" && echo "GCC_LANGUAGES not set, assuming c,c++" GCC_LANGUAGES=${GCC_LANGUAGES-"c,c++"}@@ -85,7 +93,9 @@ test -z "${LD_LIBRARY_PATH}" || abort "glibc refuses to build if LD_LIBRARY_PATH is set. Please unset it before running this script." # 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."@@ -127,7 +137,8 @@ GCC_LANGUAGES \ GDB_DIR \ GLIBC_ADDON_OPTIONS \-GLIBC_DIR \+LIBC_DIR \+C_LIBRARY \ GLIBC_EXTRA_CC_ARGS \ GLIBC_EXTRA_CONFIG \ GLIBC_EXTRA_ENV \@@ -229,7 +240,8 @@ GCC_DIR=`cd ${SRC_DIR}/${GCC_DIR}; pwd` GCC_CORE_DIR=`cd ${SRC_DIR}/${GCC_CORE_DIR}; pwd` LINUX_HEADER_DIR=`cd ${SRC_DIR}/${LINUX_HEADER_DIR}; pwd`-GLIBC_DIR=`cd ${SRC_DIR}/${GLIBC_DIR}; pwd`+LINUX_DIR=`cd ${SRC_DIR}/${LINUX_DIR}; pwd`+LIBC_DIR=`cd ${SRC_DIR}/${LIBC_DIR}; pwd` # Always install the bootstrap gcc (used to build glibc) # somewhere it can't interfere with the final gcc.@@ -373,6 +385,62 @@ # test to see if this step passed logresult binutils ${PREFIX}/bin/${TARGET}-ld${EXEEXT} +# A few functions for configuring uClibc, since they're used twice++defaultuClibcConfig() {+ make defconfig+ UCARCH=${ARCH}+ if test "${UCARCH}" = "ppc"; then+ UCARCH=powerpc+ fi+ + # - take care that TARGET_${ARCH} is correct for ppc+ # - FIXME: RSC: this was here before as well, don't know if it is+ # still necessary in uClibc-0.9.27: + # s/^TARGET_ARCH=".*"/TARGET_ARCH="${UCARCH}"/+ # s/^\(TARGET_.*_ENDIAN\)=y/\\# \\1 is not set/++ cat > munge-defconfig.sed <<-ENDSED+ s/^\(TARGET_.*\)=y$/\\# \\1 is not set/+ s/^\\# TARGET_${UCARCH} is not set/TARGET_${UCARCH}=y/+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}"/+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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -