📄 crosstool-uclibc-0.28-rc5-ter.patch
字号:
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"; thendiff -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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -