Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
[linux/fpc-iii.git] / tools / perf / arch / x86 / tests / gen-insn-x86-dat.sh
blob2d4ef94cff987a694f1cfdcf4e81658a55cfbdfa
1 #!/bin/sh
2 # gen-insn-x86-dat: generate data for the insn-x86 test
3 # Copyright (c) 2015, Intel Corporation.
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms and conditions of the GNU General Public License,
7 # version 2, as published by the Free Software Foundation.
9 # This program is distributed in the hope it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 # more details.
14 set -e
16 if [ "$(uname -m)" != "x86_64" ]; then
17 echo "ERROR: This script only works on x86_64"
18 exit 1
21 cd $(dirname $0)
23 trap 'echo "Might need a more recent version of binutils"' EXIT
25 echo "Compiling insn-x86-dat-src.c to 64-bit object"
27 gcc -g -c insn-x86-dat-src.c
29 objdump -dSw insn-x86-dat-src.o | awk -f gen-insn-x86-dat.awk > insn-x86-dat-64.c
31 rm -f insn-x86-dat-src.o
33 echo "Compiling insn-x86-dat-src.c to 32-bit object"
35 gcc -g -c -m32 insn-x86-dat-src.c
37 objdump -dSw insn-x86-dat-src.o | awk -f gen-insn-x86-dat.awk > insn-x86-dat-32.c
39 rm -f insn-x86-dat-src.o
41 trap - EXIT
43 echo "Done (use git diff to see the changes)"