2014-08-07 20:33:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
TOOLCHAINCMD="$1"
|
|
|
|
shift
|
|
|
|
|
|
|
|
if [[ "$TOOLCHAINCMD" != "gcc" ]] || [[ -z "$TEMPDIR" ]]; then
|
|
|
|
exec "$TOOLCHAINCMD" "$@"
|
|
|
|
fi
|
|
|
|
|
|
|
|
declare -a args=($@)
|
|
|
|
|
|
|
|
while [ "$#" -gt 0 ]; do
|
|
|
|
if [ "$1" = "-o" ]; then
|
2014-08-13 01:39:24 +00:00
|
|
|
obj=$2
|
|
|
|
[[ $2 = */.tmp_*.o ]] && obj=${2/.tmp_/}
|
|
|
|
case "$obj" in
|
2014-08-08 19:13:07 +00:00
|
|
|
*.mod.o|\
|
|
|
|
*built-in.o|\
|
|
|
|
vmlinux.o|\
|
|
|
|
.tmp_kallsyms1.o|\
|
|
|
|
.tmp_kallsyms2.o|\
|
|
|
|
init/version.o|\
|
|
|
|
arch/x86/boot/version.o|\
|
|
|
|
arch/x86/boot/compressed/eboot.o|\
|
|
|
|
arch/x86/boot/header.o|\
|
|
|
|
arch/x86/boot/compressed/efi_stub_64.o|\
|
|
|
|
arch/x86/boot/compressed/piggy.o|\
|
2014-08-08 19:18:46 +00:00
|
|
|
kernel/system_certificates.o|\
|
2014-08-08 19:13:07 +00:00
|
|
|
.*.o)
|
2014-08-13 01:39:24 +00:00
|
|
|
break
|
2014-08-07 20:33:31 +00:00
|
|
|
;;
|
|
|
|
*.o)
|
2014-08-13 01:39:24 +00:00
|
|
|
mkdir -p "$TEMPDIR/orig/$(dirname $obj)"
|
|
|
|
cp -f "$obj" "$TEMPDIR/orig/$obj"
|
|
|
|
echo "$obj" >> "$TEMPDIR/changed_objs"
|
|
|
|
break
|
2014-08-07 20:33:31 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
exec "$TOOLCHAINCMD" "${args[@]}"
|