Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753496AbbLISzc (ORCPT ); Wed, 9 Dec 2015 13:55:32 -0500 Received: from mail-oi0-f53.google.com ([209.85.218.53]:35733 "EHLO mail-oi0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753280AbbLISzb (ORCPT ); Wed, 9 Dec 2015 13:55:31 -0500 MIME-Version: 1.0 In-Reply-To: <20151208093407.GB27180@pd.tnic> References: <20151208093407.GB27180@pd.tnic> From: Andy Lutomirski Date: Wed, 9 Dec 2015 10:55:11 -0800 Message-ID: Subject: Re: [PATCH 01/12] selftests/x86: Extend Makefile to allow 64-bit only tests To: Borislav Petkov Cc: Andy Lutomirski , X86 ML , "linux-kernel@vger.kernel.org" , Brian Gerst , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , Denys Vlasenko , Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3422 Lines: 69 On Tue, Dec 8, 2015 at 1:34 AM, Borislav Petkov wrote: > On Mon, Dec 07, 2015 at 01:51:26PM -0800, Andy Lutomirski wrote: >> There aren't any yet, but there might be a few some day. >> >> Signed-off-by: Andy Lutomirski >> --- >> tools/testing/selftests/x86/Makefile | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile >> index 389701f59940..a460fe7c5365 100644 >> --- a/tools/testing/selftests/x86/Makefile >> +++ b/tools/testing/selftests/x86/Makefile >> @@ -8,8 +8,9 @@ TARGETS_C_BOTHBITS := single_step_syscall sysret_ss_attrs ldt_gdt syscall_nt ptr >> TARGETS_C_32BIT_ONLY := entry_from_vm86 syscall_arg_fault sigreturn test_syscall_vdso unwind_vdso >> >> TARGETS_C_32BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_32BIT_ONLY) >> +TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_64BIT_ONLY) >> BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32) >> -BINARIES_64 := $(TARGETS_C_BOTHBITS:%=%_64) >> +BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64) >> >> CFLAGS := -O2 -g -std=gnu99 -pthread -Wall >> >> @@ -37,7 +38,7 @@ clean: >> $(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c >> $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl >> >> -$(TARGETS_C_BOTHBITS:%=%_64): %_64: %.c >> +$(TARGETS_C_64BIT_ALL:%=%_64): %_64: %.c >> $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl >> >> # x86_64 users should be encouraged to install 32-bit libraries >> -- > > It doesn't build some of the tests here if I run make in the x86 dir. > This is unrelated but maybe for the future we should add some feature > testing like perf tool does to warn people if stuff is missing on the > system... > > $ cd tools/testing/selftests/x86 > $ make > gcc -m32 -o single_step_syscall_32 -O2 -g -std=gnu99 -pthread -Wall single_step_syscall.c -lrt -ldl -lm > gcc -m32 -o sysret_ss_attrs_32 -O2 -g -std=gnu99 -pthread -Wall sysret_ss_attrs.c -lrt -ldl -lm > gcc -m32 -o ldt_gdt_32 -O2 -g -std=gnu99 -pthread -Wall ldt_gdt.c -lrt -ldl -lm > gcc -m32 -o syscall_nt_32 -O2 -g -std=gnu99 -pthread -Wall syscall_nt.c -lrt -ldl -lm > gcc -m32 -o ptrace_syscall_32 -O2 -g -std=gnu99 -pthread -Wall ptrace_syscall.c raw_syscall_helper_32.S -lrt -ldl -lm > gcc -m32 -o entry_from_vm86_32 -O2 -g -std=gnu99 -pthread -Wall entry_from_vm86.c -lrt -ldl -lm > gcc -m32 -o syscall_arg_fault_32 -O2 -g -std=gnu99 -pthread -Wall syscall_arg_fault.c -lrt -ldl -lm > gcc -m32 -o sigreturn_32 -O2 -g -std=gnu99 -pthread -Wall sigreturn.c -lrt -ldl -lm > gcc -m32 -o test_syscall_vdso_32 -O2 -g -std=gnu99 -pthread -Wall test_syscall_vdso.c thunks_32.S -lrt -ldl -lm > In file included from ptrace_syscall.c:6:0: > /usr/include/sys/syscall.h:24:24: fatal error: asm/unistd.h: No such file or directory > compilation terminated. > In file included from entry_from_vm86.c:14:0: > /usr/include/sys/syscall.h:24:24: fatal error: asm/unistd.h: No such file or directory > compilation terminated. Ick. What are you missing? That's weird. We actually do have a test in the makefile, but it's obviously incomplete given the failure you're seeing. --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/