Index: doexe =================================================================== RCS file: /var/cvsroot/gentoo-src/portage/bin/doexe,v retrieving revision 1.10 diff -u -b -B -w -p -r1.10 doexe --- doexe 4 Oct 2004 13:56:50 -0000 1.10 +++ doexe 1 Dec 2004 23:53:23 -0000 @@ -12,19 +12,17 @@ if [ ! -d "${D}${EXEDESTTREE}" ] ; then install -d "${D}${EXEDESTTREE}" fi -if [ ! -z "${CBUILD}" ] && [ "${CBUILD}" != "${CHOST}" ]; then - STRIP=${CHOST}-strip -else - STRIP=strip -fi +#STRIP="${STRIP:-${CTARGET:-${CHOST}}-strip}" +#type -p ${STRIP} > /dev/null || STRIP=strip +#STRIP_FLAGS="${STRIP_FLAGS:---strip-unneeded}" for x in "$@" ; do - if [ "${FEATURES//*nostrip*/true}" != "true" ] && [ "${RESTRICT//*nostrip*/true}" != "true" ] ; then - MYVAL=`file "${x}" | grep "ELF"` - if [ -n "$MYVAL" ] ; then - ${STRIP} "${x}" - fi - fi + #if [ "${FEATURES//*nostrip*/true}" != "true" ] && [ "${RESTRICT//*nostrip*/true}" != "true" ] ; then + # MYVAL=`file "${x}" | grep "ELF"` + # if [ -n "$MYVAL" ] ; then + # ${STRIP} ${STRIP_FLAGS} "${x}" + # fi + #fi if [ -L "${x}" ] ; then cp "${x}" "${T}" mysrc="${T}"/`/usr/bin/basename "${x}"` Index: ebuild-default-functions.sh =================================================================== RCS file: /var/cvsroot/gentoo-src/portage/bin/ebuild-default-functions.sh,v retrieving revision 1.13 diff -u -b -B -w -p -r1.13 ebuild-default-functions.sh --- ebuild-default-functions.sh 15 Nov 2004 22:30:08 -0000 1.13 +++ ebuild-default-functions.sh 1 Dec 2004 23:53:23 -0000 @@ -310,6 +310,7 @@ dyn_compile() { cd "${BUILDDIR}" cd build-info + if [ "$PKG_FORMAT" = "" ] || hasq tbz2 ${PKG_FORMAT} ; then echo "$ASFLAGS" > ASFLAGS echo "$CATEGORY" > CATEGORY echo "$CBUILD" > CBUILD @@ -336,6 +337,7 @@ dyn_compile() { echo "$RESTRICT" > RESTRICT echo "$SLOT" > SLOT echo "$USE" > USE + fi export_environ "${BUILDDIR}/build-info/environment.bz2" 'bzip2 -c9' cp "${EBUILD}" "${PF}.ebuild" if hasq nostrip $FEATURES $RESTRICT; then Index: preplib.so =================================================================== RCS file: /var/cvsroot/gentoo-src/portage/bin/preplib.so,v retrieving revision 1.10 diff -u -b -B -w -p -r1.10 preplib.so --- preplib.so 4 Oct 2004 13:56:50 -0000 1.10 +++ preplib.so 1 Dec 2004 23:53:23 -0000 @@ -7,21 +7,18 @@ if [ "${FEATURES//*nostrip*/true}" == "t exit 0 fi -if [ ! -z "${CBUILD}" ] && [ "${CBUILD}" != "${CHOST}" ]; then - STRIP=${CHOST}-strip -else - STRIP=strip -fi +#STRIP="${STRIP:-${CTARGET:-${CHOST}}-strip}" +#type -p ${STRIP} > /dev/null || STRIP=strip for x in "$@" ; do if [ -d "${D}${x}" ] ; then - for y in `find "${D}${x}"/ -type f \( -name "*.so" -or -name "*.so.*" \) 2>/dev/null` ; do - f="`file "${y}"`" - if [ "${f/*SB shared object*/1}" == "1" ] ; then - echo "${y}" - ${STRIP} --strip-debug "${y}" - fi - done + #for y in `find "${D}${x}"/ -type f \( -name "*.so" -or -name "*.so.*" \) 2>/dev/null` ; do + # f="`file "${y}"`" + # if [ "${f/*SB shared object*/1}" == "1" ] ; then + # echo "${y}" + # ${STRIP} --strip-debug "${y}" + # fi + #done ldconfig -n -N "${D}${x}" fi done Index: prepstrip =================================================================== RCS file: /var/cvsroot/gentoo-src/portage/bin/prepstrip,v retrieving revision 1.23 diff -u -b -B -w -p -r1.23 prepstrip --- prepstrip 19 Oct 2004 04:58:42 -0000 1.23 +++ prepstrip 1 Dec 2004 23:53:23 -0000 @@ -7,15 +8,29 @@ if [ "${FEATURES//*nostrip*/true}" == "t echo "nostrip" STRIP="/bin/false" else - if [ ! -z "${CBUILD}" ] && [ "${CBUILD}" != "${CHOST}" ]; then - STRIP=${CHOST}-strip - else - STRIP=strip - fi + STRIP="${STRIP:-${CTARGET:-${CHOST}}-strip}" + type -p ${STRIP} > /dev/null || STRIP=strip fi -echo "strip: " +STRIP_FLAGS="${STRIP_FLAGS:---strip-unneeded}" + +echo "strip: ${STRIP_FLAGS}" retval=0 + +strip_note() { + local f=$1 + local note="-R .note" + if [ -x /usr/bin/objdump ]; then + if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \ + grep ALLOC >/dev/null; then + note= + fi + else + note= + fi + ${STRIP} -R .comment $note $f || : +} + for x in "$@"; do # "$@" quotes each element... Plays nice with spaces. if [ -d "${x}" ]; then # We only want files. So make a pass for each directory and call again. @@ -23,13 +38,19 @@ for x in "$@"; do # "$@" quotes each ele $XARGS -0 -n500 prepstrip else f=$(file "${x}") + if [ -z "${f/*current ar archive*/}" ]; then + echo " ${x:${#D}:${#x}}" + ${STRIP} -g $f + fi if [ -z "${f/*SB executable*/}" ]; then echo " ${x:${#D}:${#x}}" ${STRIP} "${x}" + strip_note "${x}" fi if [ -z "${f/*SB shared object*/}" ]; then echo " ${x:${#D}:${#x}}" - ${STRIP} --strip-unneeded "${x}" + ${STRIP} ${STRIP_FLAGS} "${x}" + strip_note "${x}" if [ -x /usr/bin/readelf ] ; then /usr/bin/readelf -d "${x}" | grep TEXTREL > /dev/null