[PATCH] crosstool-ng: several patches
Enrico Weigelt
weigelt@metux.de
Wed Mar 21 05:51:00 GMT 2007
Hi folks,
here are some patches against crosstool-ng.
Descriptions are in the pathfile's headers.
cu
--
---------------------------------------------------------------------
Enrico Weigelt == metux IT service - http://www.metux.de/
---------------------------------------------------------------------
Please visit the OpenSource QM Taskforce:
http://wiki.metux.de/public/OpenSource_QM_Taskforce
Patches / Fixes for a lot dozens of packages in dozens of versions:
http://patches.metux.de/
---------------------------------------------------------------------
-------------- next part --------------
#
# Submitted-By: Enrico Weigelt <weigelt@metux.de>, 2007-03-20
# Committed-By: Enrico Weigelt <weigelt@metux.de>, 2007-03-20
#
# Description:
#
# This patch adds two more (internal) configuration variables,
# $TOPDIR and $IDENT which can help making configuration some
# bit easier.
#
# These new variables have no direct effect by themlselves,
# but can be easily used within other variables, ie. pathes.
#
# State:
#
# Not notified yet.
#
diff -ruN crosstool-ng.orig/config/global.in crosstool-ng.dev/config/global.in
--- crosstool-ng.orig/config/global.in 2007-03-20 19:26:21.000000000 +0100
+++ crosstool-ng.dev/config/global.in 2007-03-20 20:26:38.000000000 +0100
@@ -46,6 +46,21 @@
comment "Paths"
+config TOPDIR
+ string
+ prompt "Top directory of Crosstool"
+ default "`pwd`"
+ help
+ This is the top directory of crosstool. You probably don't ever
+ want to change this.
+
+config IDENT
+ string
+ prompt "Toolchain identifier"
+ help
+ Define an additional identifier for this toolchain, which can be used
+ as variable in pathes.
+
config TARBALLS_DIR
string
prompt "Tarballs directory"
-------------- next part --------------
#
# Submitted-By: Enrico Weigelt <weigelt@metux.de>, 2007-03-20
# Committed-By: Enrico Weigelt <weigelt@metux.de>, 2007-03-20
#
# Error:
#
# The C++ compiler was always built with --enable-__cxa_atexit,
# so it generates code, which uses the __cxa_atexit symbol.
# When you libc does not supply this symbol (ie. on uClibc),
# you won't be able to build executable from your c++ code.
#
# Description:
#
# This patch introduces an new config option CC_CXA_ATEXIT
# which allows the user to control whether gcc should be
# compiled with --enable-__cxa_atexit.
#
# State:
#
# Not notified yet.
#
diff -ruN crosstool-ng.orig/config/cc_gcc.in crosstool-ng.dev/config/cc_gcc.in
--- crosstool-ng.orig/config/cc_gcc.in 2007-03-20 19:26:21.000000000 +0100
+++ crosstool-ng.dev/config/cc_gcc.in 2007-03-19 21:51:16.000000000 +0100
@@ -134,3 +134,11 @@
default ""
help
Extra flags to pass onto ./configure when configuring gcc.
+
+config CC_CXA_ATEXIT
+ bool
+ prompt "__cxa_atexit"
+ default "y"
+ help
+ If you get the missing symbol "__cxa_atexit" when building c++ programs,
+ you might want to try disabling this option.
diff -ruN crosstool-ng.orig/scripts/build/cc_core_gcc.sh crosstool-ng.dev/scripts/build/cc_core_gcc.sh
--- crosstool-ng.orig/scripts/build/cc_core_gcc.sh 2007-03-20 19:25:06.000000000 +0100
+++ crosstool-ng.dev/scripts/build/cc_core_gcc.sh 2007-03-20 19:02:48.000000000 +0100
@@ -20,6 +25,7 @@
[ -n "${CT_ARCH_TUNE}" ] && extra_config="${extra_config} --with-tune=${CT_ARCH_TUNE}"
[ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
[ -n "${CT_ARCH_FPU}" ] && extra_config="${extra_config} --with-fpu=${CT_ARCH_FPU}"
+ [ "${CT_CC_CXA_ATEXIT}" == "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
@@ -38,7 +44,6 @@
--disable-nls \
--enable-threads=no \
--enable-symvers=gnu \
- --enable-__cxa_atexit \
--enable-languages=c \
--disable-shared \
${CT_CC_CORE_EXTRA_CONFIG} 2>&1 |CT_DoLog DEBUG
diff -ruN crosstool-ng.orig/scripts/build/cc_gcc.sh crosstool-ng.dev/scripts/build/cc_gcc.sh
--- crosstool-ng.orig/scripts/build/cc_gcc.sh 2007-03-20 19:25:06.000000000 +0100
+++ crosstool-ng.dev/scripts/build/cc_gcc.sh 2007-03-19 22:34:40.000000000 +0100
@@ -38,6 +38,7 @@
else
extra_config="${extra_config} --disable-multilib"
fi
+ [ "${CT_CC_CXA_ATEXIT}" == "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
@@ -56,7 +57,6 @@
--disable-nls \
--enable-threads=posix \
--enable-symvers=gnu \
- --enable-__cxa_atexit \
--enable-c99 \
--enable-long-long \
${CT_CC_EXTRA_CONFIG} 2>&1 |CT_DoLog DEBUG
-------------- next part --------------
#
# Submitted-By: Enrico Weigelt <weigelt@metux.de>, 2007-03-20
# Committed-By: Enrico Weigelt <weigelt@metux.de>, 2007-03-20
#
# Error:
#
# Incremental builds are currently not supported. If your build
# breaks somewhere in the middle, you currently have to restart
# completely afresh. This can be extremly annoying since an
# toolchain build may take several hours.
#
# Description:
#
# This patch sets flag files for each completed component/step
# so it can skip it the build process is rerun.
#
# State:
#
# Not notified yet.
#
diff -ruN crosstool-ng.orig/scripts/build/binutils.sh crosstool-ng.dev/scripts/build/binutils.sh
--- crosstool-ng.orig/scripts/build/binutils.sh 2007-03-20 19:25:06.000000000 +0100
+++ crosstool-ng.dev/scripts/build/binutils.sh 2007-03-20 19:07:05.000000000 +0100
@@ -3,6 +3,11 @@
# Licensed under the GPL v2. See COPYING in the root of this package
do_binutils() {
+ if [ -f "${CT_PREFIX_DIR}/.finished.binutils" ]; then
+ CT_DoLog WARN "Skipping already installed binutils"
+ return
+ fi
+
mkdir -p "${CT_BUILD_DIR}/build-binutils"
cd "${CT_BUILD_DIR}/build-binutils"
@@ -35,5 +40,7 @@
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
done |CT_DoLog DEBUG
+ date > "${CT_PREFIX_DIR}/.finished.binutils"
+
CT_EndStep
}
diff -ruN crosstool-ng.orig/scripts/build/cc_core_gcc.sh crosstool-ng.dev/scripts/build/cc_core_gcc.sh
--- crosstool-ng.orig/scripts/build/cc_core_gcc.sh 2007-03-20 21:02:13.000000000 +0100
+++ crosstool-ng.dev/scripts/build/cc_core_gcc.sh 2007-03-20 19:02:48.000000000 +0100
@@ -6,6 +6,11 @@
mkdir -p "${CT_BUILD_DIR}/build-cc-core"
cd "${CT_BUILD_DIR}/build-cc-core"
+ if test -f ${CT_PREFIX_DIR}/.finished.core_gcc ; then
+ CT_DoLog EXTRA "Already installed core c compiler"
+ return
+ fi
+
CT_DoStep INFO "Installing core C compiler"
CT_DoLog EXTRA "Copy headers to install area of bootstrap gcc, so it can build libgcc2"
@@ -54,5 +59,7 @@
CT_DoLog EXTRA "Installing core C compiler"
make install-gcc 2>&1 |CT_DoLog DEBUG
+ date > ${CT_PREFIX_DIR}/.finished.core_gcc
+
CT_EndStep
}
diff -ruN crosstool-ng.orig/scripts/build/kernel_linux-libc-headers.sh crosstool-ng.dev/scripts/build/kernel_linux-libc-headers.sh
--- crosstool-ng.orig/scripts/build/kernel_linux-libc-headers.sh 2007-03-20 19:25:06.000000000 +0100
+++ crosstool-ng.dev/scripts/build/kernel_linux-libc-headers.sh 2007-03-20 19:06:19.000000000 +0100
@@ -13,6 +13,11 @@
# Wrapper to the actual headers install method
do_kernel_headers() {
+ if test -f "${CT_PREFIX_DIR}/finished.kernel-linux-includes" ; then
+ CT_DoLog WARN "Skipping already installed kernel headers"
+ return
+ fi
+
CT_DoStep INFO "Installing kernel headers"
# We need to enter this directory to find the kernel version strings
@@ -45,6 +50,8 @@
do_kernel_copy
fi
+ date > "${CT_PREFIX_DIR}/finished.kernel-linux-includes"
+
CT_EndStep
}
diff -ruN crosstool-ng.orig/scripts/build/kernel_linux.sh crosstool-ng.dev/scripts/build/kernel_linux.sh
--- crosstool-ng.orig/scripts/build/kernel_linux.sh 2007-03-20 19:25:06.000000000 +0100
+++ crosstool-ng.dev/scripts/build/kernel_linux.sh 2007-03-20 19:06:19.000000000 +0100
@@ -13,6 +13,11 @@
# Wrapper to the actual headers install method
do_kernel_headers() {
+ if test -f "${CT_PREFIX_DIR}/finished.kernel-linux-includes" ; then
+ CT_DoLog WARN "Skipping already installed kernel headers"
+ return
+ fi
+
CT_DoStep INFO "Installing kernel headers"
# We need to enter this directory to find the kernel version strings
@@ -45,6 +50,8 @@
do_kernel_copy
fi
+ date > "${CT_PREFIX_DIR}/finished.kernel-linux-includes"
+
CT_EndStep
}
diff -ruN crosstool-ng.orig/scripts/build/libc_uClibc.sh crosstool-ng.dev/scripts/build/libc_uClibc.sh
--- crosstool-ng.orig/scripts/build/libc_uClibc.sh 2007-03-20 19:25:06.000000000 +0100
+++ crosstool-ng.dev/scripts/build/libc_uClibc.sh 2007-03-20 19:14:04.000000000 +0100
@@ -28,6 +28,11 @@
# See also http://gcc.gnu.org/PR8180, which complains about the need for this step.
grep -q 'gcc-[34]' "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/ChangeLog" || return 0
+ if test -f "${CT_PREFIX_DIR}/.finished.uclibc.headers" ; then
+ CT_DoLog WARN "Skipping already installed C library headers (uClibc)"
+ return ;
+ fi
+
CT_DoStep INFO "Installing C library headers"
mkdir -p "${CT_BUILD_DIR}/build-libc-headers"
@@ -53,6 +58,8 @@
CT_DoLog EXTRA "Installing headers"
make CROSS= PREFIX="${CT_SYSROOT_DIR}/" install_dev 2>&1 |CT_DoLog DEBUG
+ date > "${CT_PREFIX_DIR}/.finished.uclibc.headers"
+
CT_EndStep
}
diff -ruN crosstool-ng.orig/scripts/crosstool.sh crosstool-ng.dev/scripts/crosstool.sh
--- crosstool-ng.orig/scripts/crosstool.sh 2007-03-20 19:25:07.000000000 +0100
+++ crosstool-ng.dev/scripts/crosstool.sh 2007-03-20 20:43:33.000000000 +0100
@@ -175,12 +175,16 @@
# Get rid of pre-existing installed toolchain and previous build directories.
# We need to do that _before_ we can safely log, because the log file will
# most probably be in the toolchain directory.
-if [ -d "${CT_PREFIX_DIR}" ]; then
- mv "${CT_PREFIX_DIR}" "${CT_PREFIX_DIR}.$$"
- nohup rm -rf "${CT_PREFIX_DIR}.$$" >/dev/null 2>&1 &
-fi
+# --> disabled this (temporarily) for our incrementing build experiments ;)
+# BTW: we should remove trailing slashes in pathames, otherwise this can fail.
+#if [ -d "${CT_PREFIX_DIR}" ]; then
+# mv "${CT_PREFIX_DIR}" "${CT_PREFIX_DIR}.$$"
+# nohup rm -rf "${CT_PREFIX_DIR}.$$" >/dev/null 2>&1 &
+#fi
+
mkdir -p "${CT_PREFIX_DIR}"
if [ -d "${CT_BUILD_DIR}" ]; then
+ CT_DoLog DEBUG "Removing old CT_BUILD_DIR: $CT_BUILD_DIR (FIXME: probably breaking incremental builds)"
mv "${CT_BUILD_DIR}" "${CT_BUILD_DIR}.$$"
nohup rm -rf "${CT_BUILD_DIR}.$$" >/dev/null 2>&1 &
fi
diff -ruN trunk.orig/scripts/build/cc_core_gcc.sh trunk/scripts/build/cc_core_gcc.sh
--- trunk.orig/scripts/build/cc_core_gcc.sh 2007-03-20 21:47:33.000000000 +0100
+++ trunk/scripts/build/cc_core_gcc.sh 2007-03-20 19:02:48.000000000 +0100
@@ -59,7 +59,7 @@
CT_DoLog EXTRA "Installing core C compiler"
make install-gcc 2>&1 |CT_DoLog DEBUG
- date > ${CT_PREFIX_DIR}/.finished.core_gcc
+ date > "${CT_PREFIX_DIR}/.finished.core_gcc"
CT_EndStep
}
diff -ruN trunk.orig/scripts/build/cc_gcc.sh trunk/scripts/build/cc_gcc.sh
--- trunk.orig/scripts/build/cc_gcc.sh 2007-03-20 21:47:33.000000000 +0100
+++ trunk/scripts/build/cc_gcc.sh 2007-03-20 23:04:10.000000000 +0100
@@ -3,6 +3,10 @@
# Licensed under the GPL v2. See COPYING in the root of this package
do_cc() {
+ if test -f "${CT_PREFIX_DIR}/.finished.gcc-final" ; then
+ CT_DoLog WARN "Skipping already installed final C compiler"
+ return
+ fi
CT_DoStep INFO "Installing final C compiler"
mkdir -p "${CT_BUILD_DIR}/build-cc"
@@ -110,6 +114,7 @@
# fi
# ;;
#esac
+ date > "${CT_PREFIX_DIR}/.finished.gcc-final"
CT_EndStep
}
diff -ruN trunk.orig/scripts/build/kernel_linux-libc-headers.sh trunk/scripts/build/kernel_linux-libc-headers.sh
--- trunk.orig/scripts/build/kernel_linux-libc-headers.sh 2007-03-20 21:47:33.000000000 +0100
+++ trunk/scripts/build/kernel_linux-libc-headers.sh 2007-03-20 19:06:19.000000000 +0100
@@ -13,7 +13,7 @@
# Wrapper to the actual headers install method
do_kernel_headers() {
- if test -f "${CT_PREFIX_DIR}/finished.kernel-linux-includes" ; then
+ if test -f "${CT_PREFIX_DIR}/.finished.kernel_linux-headers" ; then
CT_DoLog WARN "Skipping already installed kernel headers"
return
fi
@@ -50,7 +50,7 @@
do_kernel_copy
fi
- date > "${CT_PREFIX_DIR}/finished.kernel-linux-includes"
+ date > "${CT_PREFIX_DIR}/.finished.kernel_linux-headers"
CT_EndStep
}
diff -ruN trunk.orig/scripts/build/kernel_linux.sh trunk/scripts/build/kernel_linux.sh
--- trunk.orig/scripts/build/kernel_linux.sh 2007-03-20 21:47:33.000000000 +0100
+++ trunk/scripts/build/kernel_linux.sh 2007-03-21 00:32:41.000000000 +0100
@@ -13,7 +13,7 @@
# Wrapper to the actual headers install method
do_kernel_headers() {
- if test -f "${CT_PREFIX_DIR}/finished.kernel-linux-includes" ; then
+ if test -f "${CT_PREFIX_DIR}/.finished.kernel_linux-headers" ; then
CT_DoLog WARN "Skipping already installed kernel headers"
return
fi
@@ -50,7 +50,7 @@
do_kernel_copy
fi
- date > "${CT_PREFIX_DIR}/finished.kernel-linux-includes"
+ date > "${CT_PREFIX_DIR}/.finished.kernel_linux-headers"
CT_EndStep
}
diff -ruN trunk.orig/scripts/build/libc_uClibc.sh trunk/scripts/build/libc_uClibc.sh
--- trunk.orig/scripts/build/libc_uClibc.sh 2007-03-20 21:47:33.000000000 +0100
+++ trunk/scripts/build/libc_uClibc.sh 2007-03-20 21:51:48.000000000 +0100
@@ -65,6 +65,11 @@
# This function build and install the full uClibc
do_libc() {
+ if test -f "${CT_PREFIX_DIR}/.finished.uclibc.binary" ; then
+ CT_DoLog WARN "Skipping already installed C library (uClibc)"
+ return ;
+ fi
+
CT_DoStep INFO "Installing C library"
mkdir -p "${CT_BUILD_DIR}/build-libc"
@@ -113,6 +118,8 @@
STRIPTOOL=true \
install 2>&1 |CT_DoLog DEBUG
+ date > "${CT_PREFIX_DIR}/.finished.uclibc.binary"
+
CT_EndStep
}
-------------- next part --------------
#
# Submitted-By: Enrico Weigelt <weigelt@metux.de>, 2007-03-20
# Committed-By: Enrico Weigelt <weigelt@metux.de>, 2007-03-20
#
# Error:
#
# The config variable name "Prefix directory" is (IMHO) not very
# clear - "Installation prefix" would fit better.
#
# Description:
#
# This patch just changes the label of the PREFIX_DIR variable
# (within the config menu). Just an trivial cosmetic change,
# has no influence on the build process.
#
# State:
#
# Not notified yet.
#
diff -ruN crosstool-ng.orig/config/global.in crosstool-ng.dev/config/global.in
--- crosstool-ng.orig/config/global.in 2007-03-20 19:26:21.000000000 +0100
+++ crosstool-ng.dev/config/global.in 2007-03-20 20:26:38.000000000 +0100
@@ -77,7 +92,7 @@
config PREFIX_DIR
string
- prompt "Prefix directory"
+ prompt "Installation prefix"
default "${HOME}/${CT_TARGET}"
help
This is the path the toolchain will run from.
-------------- next part --------------
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list