minimize the size of the binaries on the roborio

This helps both with the amount of time to download and runtime memory
usage, both of which we are having issues with.

Change-Id: Ia79690a9a63751148a55d47b246166cd50e67538
diff --git a/aos/build/strip_debuglink b/aos/build/strip_debuglink
new file mode 100755
index 0000000..fce95e6
--- /dev/null
+++ b/aos/build/strip_debuglink
@@ -0,0 +1,18 @@
+#!/bin/dash
+
+set -e
+
+OBJCOPY=$1
+shift
+
+# The arguments after any -o flags.
+OUTPUT=`echo "$@" | awk \
+  'BEGIN { RS=" " }; output { print ; output = 0 }; /-o/ { output = 1 }'`
+DEBUG_DIR=$(dirname $(dirname ${OUTPUT}))/unstripped_files
+mkdir -p ${DEBUG_DIR}
+DEBUG_FILE=${DEBUG_DIR}/$(basename ${OUTPUT}).full
+
+"$@"
+
+cp ${OUTPUT} ${DEBUG_FILE}
+${OBJCOPY} --strip-debug --add-gnu-debuglink=${DEBUG_FILE} ${OUTPUT}