Received: by 10.213.65.68 with SMTP id h4csp468391imn; Tue, 27 Mar 2018 02:54:37 -0700 (PDT) X-Google-Smtp-Source: AG47ELsNblb4eTmgA3+bQ8UthqQoBh6ZO0HQadN96I2Rnqn3+5hA6WZfczdED0ZX38cxb12fQhsq X-Received: by 2002:a17:902:7c95:: with SMTP id y21-v6mr21721751pll.170.1522144477224; Tue, 27 Mar 2018 02:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522144477; cv=none; d=google.com; s=arc-20160816; b=xw358Es0Fo4OvPmjEjFppFiJ+MnnVN6Ey5l8DdOoPQR2FkgGdW5JhzKJkD7eRglQFX hjs8AaOHjHZ3ehuonB1fSHcXCXK+M/0uIU8gVKfOiUP0GOQpP1PGABXIa6wR4UwvYIpW 5HeSJk8PC9PVf0SODBp2KSZvcBCMKqoP4Ha6bOViNV7AgcCXtWqhAVuCJr4AMboFW0lr bgseYMLTBI88szNICq2HM0vG9FBRRyU1ov26oll8BW+kjexlTh7gA4ZBkSOU8KkKLliq 9OIfYp7CQaw7/54GjjrQKkrUm1aPJSzxuLeVfVSkZ4SLsY1HnqnlBQ4RnUfy+Lv3ua+b xx3A== 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=6sCjWPVEXsbX/GCV+2PkWL9rrzf13hgT8KCl3H+JOf8=; b=PiUfQi846YUiEwmCq4XpK6c4T0mVgJXZZbG4Nynt7GDRRH60n1ku3fGJSP1gMbiJxI CRf90QKaKgKWR/cfqCgRoFUOao/2pGXffA7R5R7227r4XrwM5HEXswBuCa1XwCG8tOvB A90SAGl8E07L+wV1sWj21BveyZARQ08I8ljL5u9sKkCG/5DkD8fL/XP4kp50C+dJ43++ 8JAUTshGC+BXWmq1tqfCwnuK/rmHVe5HvWZISmim9oftm4EeNrEgTIODnqhQYA/yjpZa Mp4UN8hQFdn8XiTMK4zeSF847DVZhidMZtsot+CBHElQ0lhrGTHRa388CShuM7yKjHdr GJLA== 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 m37-v6si976545pla.346.2018.03.27.02.54.22; Tue, 27 Mar 2018 02:54:37 -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 S1752183AbeC0Jwe (ORCPT + 99 others); Tue, 27 Mar 2018 05:52:34 -0400 Received: from www62.your-server.de ([213.133.104.62]:54247 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750978AbeC0Jwc (ORCPT ); Tue, 27 Mar 2018 05:52:32 -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 1f0lHI-0001eU-J9; Tue, 27 Mar 2018 11:52:28 +0200 Subject: Re: [PATCH 4/4] selftests/bpf: fix compiling errors To: "Du, Changbin" Cc: Alexei Starovoitov , shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <1522056208-4004-1-git-send-email-changbin.du@intel.com> <1522056208-4004-5-git-send-email-changbin.du@intel.com> <20180326145511.lzoi6wja6iht5lvq@ast-mbp.dhcp.thefacebook.com> <20180327022010.57u6rn73inbkrycn@intel.com> <20180327030229.txifuth2qmnjo3hy@ast-mbp> <20180327030613.hkp7hox3g4prnbsg@intel.com> <2dd7c04a-eb10-e730-148e-3b04a18e9b44@iogearbox.net> <20180327090000.fou6oyvr663lbyuq@intel.com> From: Daniel Borkmann Message-ID: <90ce8146-cecd-c928-f9c6-470db97b2051@iogearbox.net> Date: Tue, 27 Mar 2018 11:52:27 +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: <20180327090000.fou6oyvr663lbyuq@intel.com> 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/24424/Tue Mar 27 06:23:22 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/27/2018 11:00 AM, Du, Changbin wrote: > On Tue, Mar 27, 2018 at 10:52:57AM +0200, Daniel Borkmann wrote: >> On 03/27/2018 05:06 AM, Du, Changbin wrote: >>> On Mon, Mar 26, 2018 at 08:02:30PM -0700, Alexei Starovoitov wrote: >>>> On Tue, Mar 27, 2018 at 10:20:10AM +0800, Du, Changbin wrote: >>>>> On Mon, Mar 26, 2018 at 07:55:13AM -0700, Alexei Starovoitov wrote: >>>>>> On Mon, Mar 26, 2018 at 05:23:28PM +0800, changbin.du@intel.com wrote: >>>>>>> Signed-off-by: Changbin Du >>>>>>> --- >>>>>>> tools/testing/selftests/bpf/Makefile | 5 +++-- >>>>>>> 1 file changed, 3 insertions(+), 2 deletions(-) >>>>>>> >>>>>>> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile >>>>>>> index 5c43c18..dc0fdc8 100644 >>>>>>> --- a/tools/testing/selftests/bpf/Makefile >>>>>>> +++ b/tools/testing/selftests/bpf/Makefile >>>>>>> @@ -10,7 +10,8 @@ ifneq ($(wildcard $(GENHDR)),) >>>>>>> GENFLAGS := -DHAVE_GENHDR >>>>>>> endif >>>>>>> >>>>>>> -CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) -I../../../include >>>>>>> +CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) \ >>>>>>> + -I../../../include -I../../../../usr/include >>>>>>> LDLIBS += -lcap -lelf -lrt -lpthread >>>>>>> >>>>>>> # Order correspond to 'make run_tests' order >>>>>>> @@ -62,7 +63,7 @@ else >>>>>>> CPU ?= generic >>>>>>> endif >>>>>>> >>>>>>> -CLANG_FLAGS = -I. -I./include/uapi -I../../../include/uapi \ >>>>>>> +CLANG_FLAGS = -I. -I./include/uapi -I../../../include/uapi -I../../../../usr/include \ >>>>>>> -Wno-compare-distinct-pointer-types >>>>>> >>>>>> Nack. >>>>>> I suspect that will break the build for everyone else who's doing it in the directory >>>>>> itself instead of the outer one. >>>>> >>>>> This one? But I didn't see any problem. >>>> >>>> because the build was lucky and additional path ../../../../usr/include didn't point >>>> to a valid dir? >> >> Agree. >> >>> I am sorry but I don't understand why you mean *lucky*. Of cause, the path is valid. >> >> The problem is that this suddenly requires users to do a 'make headers_install' in >> order to populate usr/include/ directory in the first place. While it's annoying >> enough for BPF samples where this is needed, I absolutely don't want to introduce >> this for BPF kselftests. It's the wrong approach. Besides, in tools infra, there is >> a tools/arch/*/include/uapi/asm/bitsperlong.h header copy already, so we really need >> to use that instead. Please adapt your patch accordingly and respin. Please also Cc >> us and netdev@vger.kernel.org for BPF kselftests changes. >> > Thanks for the explanation. So we expect that tools/arch/*/include is in the searching list, right? > The corrent makefile seems not. How do you get this built? E.g. take a look at tools/include/asm/barrier.h or tools/include/uapi/asm/bpf_perf_event.h just to name two examples. We'd need something similar to this which then points to the arch specific includes. Thanks, Daniel > changbin@gvt-dell-host:~/work/linux/tools/testing/selftests/bpf$ make -p > [...] > clang -I. -I./include/uapi -I../../../include/uapi -Wno-compare-distinct-pointer-types \ > -O2 -target bpf -emit-llvm -c test_pkt_access.c -o - | \ > llc -march=bpf -mcpu=generic -filetype=obj -o /home/changbin/work/linux/tools/testing/selftests/bpf/test_pkt_access.o > In file included from test_pkt_access.c:9: > In file included from ../../../include/uapi/linux/bpf.h:11: > In file included from ./include/uapi/linux/types.h:5: > /usr/include/asm-generic/int-ll64.h:11:10: fatal error: 'asm/bitsperlong.h' file not found > #include > >