summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/internals.sh15
-rw-r--r--scripts/crosstool-NG.sh.in3
2 files changed, 18 insertions, 0 deletions
diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh
index 3e5ee5d..0963672 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;' \
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index 7efb297..b7148a1 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -441,6 +441,9 @@ if [ -z "${CT_RESTART}" ]; then
gcj)
CT_TestAndAbort "Missing: '${t}${tool}${!s}' or '${t}${tool}' or '${tool}' : either needed!" "${CT_CC_LANG_JAVA}" = "y"
;;
+ strip)
+ CT_TestAndAbort "Missing: '${t}${tool}${!s}' or '${t}${tool}' or '${tool}' : either needed!" "${CT_STRIP_ALL_TOOLCHAIN_EXECUTABLES}" = "y"
+ ;;
# If any other is missing, only warn at low level
*)
# It does not deserve a WARN level.