Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4751101imm; Mon, 14 May 2018 12:21:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrmdX0wcX9a/A1jfdXAH4BDTMWVO49csEQE2mLSwRtuCMmFhCsDgNof1x6T87fGk7M3a2XE X-Received: by 2002:a62:568f:: with SMTP id h15-v6mr11778219pfj.131.1526325703101; Mon, 14 May 2018 12:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526325703; cv=none; d=google.com; s=arc-20160816; b=Dx9R0qpHnr8AnjymrdYq5S34c71q7x3neW+Ly7H+BwacO6AbPk4cBE2GKWAp3MkzQh +kEQ+bBEbgOtwRjYzcTavkPN4/qTUWnS37W+Rim8qtgMOFya7X5eBcXs97oNkfa0r1VK nBaz/J8pg9U14v50s0F9h0p8OLPL91d/kvJeBNXOrCrjjDrKBLtWRXUrHSAljztALHvB beWstXyS/ydIurYeOAGce0mElObqbsuilwuctwBSr+hEu5DS3x9h/0kqtHzLJ7Eyd4C0 SGgG1RQ3qbKSbwQKMH4MmLVXivCHaIYUBmci7CFqcg3bL3NZ92Ga8AWI0uS3gbCHUbYO /xMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=bWuQdmes/2uxoM0gqT8N81CucF5W0B7OvDHs2yw5wjM=; b=d5agOrEH+1I6JXtNMURIyJDzUs+kI5KwN36rqawdOZ6df6EuWuWGl2Yd3lvuw5dWV/ K6j70wVN/ELZloYeJGQNU0xr5Hexo699rfZljMmDkxZNJUBrMGfE9DZICi8lVlkR1mc2 jgCgrgqgoPCEiVhWSs+fKPCxDmJSWIHOIdLi7C94G8JbBy0o2j/vvHV3DusMDhk6RNRy igF9yJnnmk3VFzYshjE5PC5kuROsgTlPXNw5WxnHsy9pVkktH9YogEOsEY4ZJosft/NN 44GhxHmKOz4+MzLVPJ70er/PLzt8Hq7hIr+5ZSOpbXHmj1vb8ww2bgRSCNVpqaagV5he aKnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10-v6si3994444pgn.304.2018.05.14.12.21.29; Mon, 14 May 2018 12:21:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752185AbeENTUk (ORCPT + 99 others); Mon, 14 May 2018 15:20:40 -0400 Received: from www62.your-server.de ([213.133.104.62]:43844 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750750AbeENTUi (ORCPT ); Mon, 14 May 2018 15:20:38 -0400 Received: from [62.202.221.10] (helo=linux.home) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-SHA:256) (Exim 4.85_2) (envelope-from ) id 1fIJ1E-0004Qi-VA; Mon, 14 May 2018 21:20:25 +0200 Subject: Re: [PATCH v3] selftests: add headers_install to lib.mk To: Anders Roxell , yamada.masahiro@socionext.com, michal.lkml@markovi.net, shuah@kernel.org, bamv2005@gmail.com, brgl@bgdev.pl, pbonzini@redhat.com, akpm@linux-foundation.org, rppt@linux.vnet.ibm.com, aarcange@redhat.com Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, alexei.starovoitov@gmail.com References: <20180413090351.25662-1-anders.roxell@linaro.org> <20180514115809.9803-1-anders.roxell@linaro.org> From: Daniel Borkmann Message-ID: <1a021bf3-cf93-aa12-c5a8-1ea6c7900fbb@iogearbox.net> Date: Mon, 14 May 2018 21:20:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180514115809.9803-1-anders.roxell@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.99.3/24569/Mon May 14 14:33:21 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/14/2018 01:58 PM, Anders Roxell wrote: > If the kernel headers aren't installed we can't build all the tests. > Add a new make target rule 'khdr' in the file lib.mk to generate the > kernel headers and that gets include for every test-dir Makefile that > includes lib.mk If the testdir in turn have its own sub-dirs the > top_srcdir needs to be set to the linux-rootdir to be able to generate > the kernel headers. > > Signed-off-by: Anders Roxell > Reviewed-by: Fathi Boudra > --- > Makefile | 14 +------------- > scripts/subarch.include | 13 +++++++++++++ > tools/testing/selftests/android/Makefile | 2 +- > tools/testing/selftests/android/ion/Makefile | 1 + > tools/testing/selftests/bpf/Makefile | 5 ++--- > tools/testing/selftests/futex/functional/Makefile | 1 + > tools/testing/selftests/gpio/Makefile | 7 ++----- > tools/testing/selftests/kvm/Makefile | 7 ++----- > tools/testing/selftests/lib.mk | 10 ++++++++++ > tools/testing/selftests/vm/Makefile | 4 ---- > 10 files changed, 33 insertions(+), 31 deletions(-) > create mode 100644 scripts/subarch.include [...] > diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile > index 438d4f93875b..9741609a0eb1 100644 > --- a/tools/testing/selftests/bpf/Makefile > +++ b/tools/testing/selftests/bpf/Makefile > @@ -16,9 +16,8 @@ LDLIBS += -lcap -lelf -lrt -lpthread > TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read > all: $(TEST_CUSTOM_PROGS) > > -$(TEST_CUSTOM_PROGS): urandom_read > - > -urandom_read: urandom_read.c > +$(TEST_CUSTOM_PROGS):| khdr > +$(TEST_CUSTOM_PROGS): urandom_read.c > $(CC) -o $(TEST_CUSTOM_PROGS) -static $< > > # Order correspond to 'make run_tests' order Can you elaborate on the error in BPF you're seeing that would force a headers_install for it? Some people are running the tools/ infrastructure (incl. BPF kselftests) outside of kernel tree where this dependency would break their setup. Why BPF bits cannot be fixed otherwise? Thanks, Daniel