selftests/x86: Check the availablity of sys/syscall.h
PATCH 1/1 selftests/x86: Check the availablity of sys/syscall.h
Since single_step_syscall.c depends on sys/syscall.h and its include, asm/unistd.h, we should check the availability of those headers.
Without this fix, if gcc-multilib is not installed but libc6-dev-i386 is installed, kselftest tries to build 32bit binary and failed with following error message.
In file included from single_step_syscall.c:18:/usr/include/sys/syscall.h:24:10: fatal error: asm/unistd.h: No such file or directory
#include <asm/unistd.h>
^~~~~~~~~~~~~~compilation terminated.
--- .../testing/selftests/x86/trivial_32bit_program.c | 1 + .../testing/selftests/x86/trivial_64bit_program.c | 1 + 2 files changed, 2 insertions(+)
tools/testing/selftests/x86/trivial_32bit_program.c +1 -0
@@ -8,6 +8,7 @@# error wrong architecture#endif +#include <sys/syscall.h> #include <stdio.h> int main ()
tools/testing/selftests/x86/trivial_64bit_program.c +1 -0
@@ -8,6 +8,7 @@# error wrong architecture#endif +#include <sys/syscall.h> #include <stdio.h> int main ()
Hi Shuah,
Could you pick this if there si no issue?
Thank you,
Quoted 44 lines · On Mon, 25 Nov 2019 20:03:44 +0900 Masami Hiramatsu <[email protected]> wrote:
Since
single_step_syscall.cdepends onsys/syscall.hand its include,asm/unistd.h, we should check the availability of those headers.
Without this fix, if gcc-multilib is not installed but libc6-dev-i386 is installed, kselftest tries to build 32bit binary and failed with following error message.In file included from single_step_syscall.c:18:
/usr/include/sys/syscall.h:24:10: fatal error:asm/unistd.h: No such file or directory#include <asm/unistd.h> ^~~~~~~~~~~~~~compilation terminated.
Signed-off-by Masami Hiramatsu <[email protected]>--- .../testing/selftests/x86/trivial_32bit_program.c | 1 + .../testing/selftests/x86/trivial_64bit_program.c | 1 + 2 files changed, 2 insertions(+)tools/testing/selftests/x86/trivial_32bit_program.c +1
-0@@ -8,6 +8,7 @@# error wrong architecture#endif +#include <sys/syscall.h> #include <stdio.h> int main ()tools/testing/selftests/x86/trivial_64bit_program.c +1
-0@@ -8,6 +8,7 @@# error wrong architecture#endif +#include <sys/syscall.h> #include <stdio.h> int main ()
Signature · 1 line
Masami Hiramatsu <[email protected]>