2 # strip-exec: Try to build the smallest executable possible from the current
7 # Slack 3.4 standard gcc -- change if you need to, but gcc 2.7.2.3 typically
8 # generates much smaller code than egcs/pgcc
10 CC="gcc -V2.7.2.3 -bi486-unknown-linux-gnulibc1"
11 CFLAGS="-O2 -D__OPTIMIZE_SIZE__ -m486"
12 SECTIONS=".note.ABI-tag .gnu.version .rel.got .dtors .comment .note"
21 echo "*** WARNING: This script is intended for advanced users only, and"
22 echo "*** is highly experimental. It will most likely fail -- please do"
23 echo "*** not complain if it does."
30 CC="$CC" CFLAGS="$CFLAGS" ./configure --enable-dcache
34 # -malign-* doesn't remove _all_ .align occurrences :-)
37 echo "Removing alignment from $FILE..."
38 grep -v .align < $FILE > `basename $FILE .s`2.s
39 mv `basename $FILE .s`2.s $FILE
42 make betaftpd-from-assembly-files
43 strip --strip-all $EXEC
45 for SECTION in $SECTIONS; do
46 echo Stripping $SECTION...
47 strip --remove-section=$SECTION $EXEC