Skip to contentSkip to conversation

cc1 and cc1plus had about 20 mbytes of debug information each, in the final redistributable form. This patch strips those two binaries yielding a savings of about 40 mbytes per SDK.

PATCH In review Dick Hollenbeck 2 participants 2 messages Mar 7, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cc1 and cc1plus had about 20 mbytes of debug information each, in the final redistributable form. This patch strips those two binaries yielding a savings of about 40 mbytes per SDK.

---
 recipes/gcc/gcc-package-sdk.inc    |    5 +++++
 recipes/gcc/gcc-package-target.inc |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)
recipes/gcc/gcc-package-sdk.inc +5 -0
index 1b6529f..54452fa 100644
@@ -65,4 +65,9 @@ do_install () {
 			fi
 		done
 	fi
+
+    # Manually strip unneeded debug info from files that were not being stripped
+    ${BUILD_STRIP} ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1${EXEEXT}
+    ${BUILD_STRIP} ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus${EXEEXT}
+    ${BUILD_STRIP} ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2${EXEEXT}
 }
recipes/gcc/gcc-package-target.inc +5 -0
index 438c314..2a415be 100644
@@ -168,4 +168,9 @@ GROUP ( libgcc_s.so.1 libgcc.a )" > ${D}${libdir}/libgcc_s.so
 
 	# Remove precompiled c++ headers as they are really big
 	rm -rf ${D}${includedir}/c++/${BINV}/${TARGET_SYS}/bits/*.gch
+
+    # Manually strip unneeded debug info from files that were not being stripped
+    ${STRIP} ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1
+    ${STRIP} ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus
+    ${STRIP} ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2
 }
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 1 line · Dick Hollenbeck

We recently added logic to conf/distro/include/sane-toolchain-* to handle the debug level via DEBUG_LEVEL. Would you mind adding a DEBUG_LEVEL_HOST to conf/bitbake.conf and making BUILD_OPTIMIZATION obey that instead so that we can drop debug info from all of them? Thanks.

Signature · 2 lines
Tom Rini
Mentor Graphics Corporation