From: Xiao Yang <ice_yangxiao@163.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>,
Daniel Borkmann <daniel@iogearbox.net>
Cc: Will Deacon <will@kernel.org>,
linux-arch <linux-arch@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Alexei Starovoitov <ast@kernel.org>
Subject: Re: Question about "asm/rwonce.h: No such file or directory"
Date: Wed, 13 Nov 2019 13:51:34 +0800 [thread overview]
Message-ID: <021e7b46-047e-d381-9dca-bd61db08e4f8@163.com> (raw)
In-Reply-To: <CAK7LNASR=R=gyuaMO=VzdXrY3gaQ_FVE4es60bzXf=9ASR2qUw@mail.gmail.com>
On 11/13/19 1:28 PM, Masahiro Yamada wrote:
> On Wed, Nov 13, 2019 at 12:13 AM Daniel Borkmann <daniel@iogearbox.net> wrote:
>> On 11/12/19 1:50 PM, Masahiro Yamada wrote:
>>> On Tue, Nov 12, 2019 at 9:31 PM Will Deacon <will@kernel.org> wrote:
>>>> [+lkml, Masahiro, Alexei and Daniel]
>>>>
>>>> On Tue, Nov 12, 2019 at 04:56:39PM +0800, Xiao Yang wrote:
>>>>> With your patch[1], I alway get the following error when building
>>>>> tools/bpf:
>>>> In case people want to reproduce this, my branch is here:
>>>>
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/log/?h=lto
>>>>
>>>>> ----------------------------------------------------------------------------------
>>>>>
>>>>> make -C tools/bpf/
>>>>> make: Entering directory
>>>>> '/usr/src/perf_selftests-x86_64-rhel-7.6-642a312d47ceb54603630d9d04f5052f3b46d9a3/tools/bpf'
>>>>>
>>>>> Auto-detecting system features:
>>>>> ... libbfd: [ on ]
>>>>> ... disassembler-four-args: [ OFF ]
>>>>>
>>>>> CC bpf_jit_disasm.o
>>>>> CC bpf_dbg.o
>>>>> In file included from
>>>>> /usr/src/perf_selftests-x86_64-rhel-7.6-642a312d47ceb54603630d9d04f5052f3b46d9a3/include/uapi/linux/filter.h:9:0,
>>>>> from
>>>>> /usr/src/perf_selftests-x86_64-rhel-7.6-642a312d47ceb54603630d9d04f5052f3b46d9a3/tools/bpf/bpf_dbg.c:41:
>>>>> /usr/src/perf_selftests-x86_64-rhel-7.6-642a312d47ceb54603630d9d04f5052f3b46d9a3/include/linux/compiler.h:247:24:
>>>>> fatal error: asm/rwonce.h: No such file or directory
>>>>> #include <asm/rwonce.h>
>>>>> ^
>>>>> compilation terminated.
>>>>> Makefile:61: recipe for target 'bpf_dbg.o' failed
>>>>> make: *** [bpf_dbg.o] Error 1
>>>>> make: *** Waiting for unfinished jobs....
>>>>> make: Leaving directory
>>>>>
>>>>> ----------------------------------------------------------------------------------
>>>>>
>>>>> [1] https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/commit/?h=lto&id=642a312d47ceb54603630d9d04f5052f3b46d9a3
>>>>>
>>>>> It seems that include/linux/compiler.h cannot find the asm/rwonce.h because
>>>>> tools/bpf/Makefile doesn't include arch/*/include/generated/asm/rwonce.h.
>>>> The problem with referring to the generated files is that they don't exist
>>>> unless you've configured the main source directory. The real problem here
>>>> seems to be that tools/bpf/ refers directly to header files in the kernel
>>>> sources without any understanding of kbuild, and therefore mandatory-y
>>>> headers simply don't exist when it goes looking for them.
>> Hmm, I am puzzled why that is. :/ I think there are two options, i) remove it
>> from CFLAGS like below (at least this doesn't let the build fail in my case
>> but requires linux headers to be installed) or ii) add a copy of filter.h to
>> tools/include/uapi/linux/filter.h so the few tools can just reuse it. We do have
>> bpf_common.h and bpf.h there already.
>>
>> diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
>> index 5d1995fd369c..08dfd289174c 100644
>> --- a/tools/bpf/Makefile
>> +++ b/tools/bpf/Makefile
>> @@ -10,7 +10,6 @@ MAKE = make
>> INSTALL ?= install
>>
>> CFLAGS += -Wall -O2
>> -CFLAGS += -D__EXPORTED_HEADERS__ -I$(srctree)/include/uapi -I$(srctree)/include
>>
>> # This will work when bpf is built in tools env. where srctree
>> # isn't set and when invoked from selftests build, where srctree
>>
>
> I think this is the most sane fix
> to include the linux/filter.h in the system.
>
> (probably, it is located in /usr/include/linux/filter.h)
Hi Masahiro,
Is it correct for include/linux/compiler.h to include <asm/rwonce.h>?
On x86_64 arch, asm/rwonce.h is generated in
./arch/x86/include/generated/ directory and compiler.h cannot find it.
Best Regards,
XIao Yang
>
>
next prev parent reply other threads:[~2019-11-13 5:51 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-12 8:56 Question about "asm/rwonce.h: No such file or directory" Xiao Yang
2019-11-12 12:31 ` Will Deacon
2019-11-12 12:31 ` Will Deacon
2019-11-12 12:50 ` Masahiro Yamada
2019-11-12 12:50 ` Masahiro Yamada
2019-11-12 15:13 ` Daniel Borkmann
2019-11-12 15:13 ` Daniel Borkmann
2019-11-13 3:44 ` Xiao Yang
2019-11-13 3:44 ` Xiao Yang
2019-11-13 5:28 ` Masahiro Yamada
2019-11-13 5:28 ` Masahiro Yamada
2019-11-13 5:51 ` Xiao Yang [this message]
2019-11-13 5:51 ` Xiao Yang
2019-11-13 6:57 ` Masahiro Yamada
2019-11-13 6:57 ` Masahiro Yamada
2019-11-13 7:16 ` Xiao Yang
2019-11-13 7:16 ` Xiao Yang
2019-11-13 7:53 ` Masahiro Yamada
2019-11-13 7:53 ` Masahiro Yamada
2019-11-13 8:35 ` Xiao Yang
2019-11-13 8:35 ` Xiao Yang
2019-11-13 8:54 ` Masahiro Yamada
2019-11-13 8:54 ` Masahiro Yamada
2019-11-13 14:55 ` Xiao Yang
2019-11-13 14:55 ` Xiao Yang
2019-11-13 15:48 ` Masahiro Yamada
2019-11-13 15:48 ` Masahiro Yamada
2019-11-13 0:59 ` Xiao Yang
2019-11-13 0:59 ` Xiao Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=021e7b46-047e-d381-9dca-bd61db08e4f8@163.com \
--to=ice_yangxiao@163.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=will@kernel.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox