From 2bf2991ebd96a69c3ca413a330e34696eeb286a7 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 5 Dec 2010 16:27:06 +0100 Subject: scripts/internals: strip all executables Using a list of files to strip misses a few of them. Now, scan appropriate directories, and strip all ELF executables and shared objects. Signed-off-by: "Yann E. MORIN" diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh index 1ef8e97..4dafafb 100644 --- a/scripts/build/internals.sh +++ b/scripts/build/internals.sh @@ -5,6 +5,7 @@ # crosstool-NG-provided files. do_finish() { local _t + local _type local strip_args CT_DoStep INFO "Cleaning-up the toolchain's directory" @@ -20,14 +21,19 @@ do_finish() { esac 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_args} bin/${CT_TARGET}-${t}${CT_HOST_SUFFIX} - [ -x ${CT_TARGET}/bin/${t}${CT_HOST_SUFFIX} ] && ${CT_HOST}-strip ${strip_args} ${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_args} ${t}${CT_HOST_SUFFIX} + for _t in "bin/${CT_TARGET}-"* \ + "${CT_TARGET}/bin/"* \ + "libexec/gcc/${CT_TARGET}/${CT_CC_VERSION}/"* \ + "libexec/gcc/${CT_TARGET}/${CT_CC_VERSION}/install-tools/"* \ + ; do + _type="$( file "${_t}" |cut -d ' ' -f 2- )" + case "${_type}" in + *"shell script text executable") + ;; + *executable*) + CT_DoExecLog ALL ${CT_HOST}-strip ${strip_args} "${_t}" + ;; + esac done CT_Popd fi -- cgit v0.10.2-6-g49f6