aboutsummaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
authorRemy Bohmer <linux@bohmer.net>2010-05-27 23:18:19 +0200
committerRemy Bohmer <linux@bohmer.net>2010-05-27 23:18:19 +0200
commitb1ac0964f4f8dc791c4e2fea9f08c4e61a170e15 (patch)
tree8efafe10b1f68e520ccd884b1cca35da64ffcc85 /scripts/build
parent0c771a45d4d3bcb0ef04304eb04bdae70e6e3baf (diff)
downloadcrosstool-ng-b1ac0964f4f8dc791c4e2fea9f08c4e61a170e15.tar.gz
crosstool-ng-b1ac0964f4f8dc791c4e2fea9f08c4e61a170e15.tar.bz2
crosstool-ng-b1ac0964f4f8dc791c4e2fea9f08c4e61a170e15.zip
scripts: add option to strip all toolchain executables
To reduce filesizes of the toolchain and even improve build times of projects to be build with this toolchain it is usefull to strip the delivered toolchain executables. Since it is not likely that we will debug the toolchain executables itself we do not need the debug information inside the executables itself. Signed-off-by: Remy Bohmer <linux@bohmer.net>
Diffstat (limited to 'scripts/build')
-rw-r--r--scripts/build/internals.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh
index 3e5ee5dd..09636727 100644
--- a/scripts/build/internals.sh
+++ b/scripts/build/internals.sh
@@ -8,6 +8,21 @@ do_finish() {
CT_DoStep INFO "Cleaning-up the toolchain's directory"
+ if [ "${CT_STRIP_ALL_TOOLCHAIN_EXECUTABLES}" = "y" ]; then
+ CT_DoLog INFO "Stripping all toolchain executables"
+ CT_Pushd "${CT_PREFIX_DIR}"
+ for t in ar as c++ c++filt cpp dlltool dllwrap g++ gcc gcc-${CT_CC_VERSION} gcov gprof ld nm objcopy objdump ranlib readelf size strings strip addr2line windmc windres; do
+ [ -x bin/${CT_TARGET}-${t}${CT_HOST_SUFFIX} ] && ${CT_HOST}-strip --strip-all -v bin/${CT_TARGET}-${t}${CT_HOST_SUFFIX}
+ [ -x ${CT_TARGET}/bin/${t}${CT_HOST_SUFFIX} ] && ${CT_HOST}-strip --strip-all -v ${CT_TARGET}/bin/${t}${CT_HOST_SUFFIX}
+ done
+ CT_Popd
+ CT_Pushd "${CT_PREFIX_DIR}/libexec/gcc/${CT_TARGET}/${CT_CC_VERSION}"
+ for t in cc1 cc1plus collect2; do
+ [ -x ${t}${CT_HOST_SUFFIX} ] && ${CT_HOST}-strip --strip-all -v ${t}${CT_HOST_SUFFIX}
+ done
+ CT_Popd
+ fi
+
if [ "${CT_BARE_METAL}" != "y" ]; then
CT_DoLog EXTRA "Installing the populate helper"
sed -r -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;' \