2014-08-07 20:33:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
TOOLCHAINCMD="$1"
|
|
|
|
shift
|
|
|
|
|
|
|
|
if [[ "$TOOLCHAINCMD" != "gcc" ]] || [[ -z "$TEMPDIR" ]]; then
|
|
|
|
exec "$TOOLCHAINCMD" "$@"
|
|
|
|
fi
|
|
|
|
|
2014-09-15 03:55:29 +00:00
|
|
|
declare -a args=("$@")
|
2014-08-07 20:33:31 +00:00
|
|
|
|
|
|
|
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-09-15 13:02:37 +00:00
|
|
|
arch/x86/vdso/*|\
|
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[@]}"
|