Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp492967ybc; Tue, 12 Nov 2019 04:52:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwgheI5/vGL0p6KXuns+AiL4RDvkkPNgt2oppoeW8L0pK0P1knllSh+CPzEuiqH0TOLTKiB X-Received: by 2002:aa7:cc95:: with SMTP id p21mr32401687edt.189.1573563153352; Tue, 12 Nov 2019 04:52:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573563153; cv=none; d=google.com; s=arc-20160816; b=zkX22cJWWACmYjFnJ4L7RMSjOqQ7t9wHdXAvzCRrrnWE7RWTj+5FSrFqwIkQxXblWg LmkR2xXxrmLZJfuJ7aAp9/WHbGG/bve3NZnkMNPbQitGWKELzhV29MMQS9cRUo1wtEIQ 9Ft4L6C7WU/bYmLJ8NIx/Wcy45vfXJhRx20OCx+HtO6JfteMe6YeugphfKWYr3dLOHIn k6lbfMv3xJSd1zZBy8B+dnWdc3afsXCB1nIQ2UKIIFtpIdDK7tW+vsrihsb3m+6aAPjd jj8HKnN+PhA3NgAfLlTpQu1D7l9MgP0oTffy+Te7sj/gS66M4NCLWsCGQxXVyRc68eq2 7AfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=pERbu/D6TsAoFYrJhhErJt2I5IFldM4FmNpzx6W3OhY=; b=RYxIT2uiLCzsDiGzKWqLz+C2omhNVxDBTGCnBZocb6eepAEqMP65vVm+Ws+mWxLLxy lX//mxJS+o+AyVDyWcHKSQffHNoz6ENdotuBppiLTCAsjIGXkq/ldB0/sn65cHahZsK1 KreTSV2ZN6JPgPNaIkuPFHFtCl7UED8s/CzKVgoEwXNVCPHAIhgqb4kIbnPJOUSTf8mW 6tKX1k0tNT1x2xD+klQEpQPGLPgHdhg31PxlB9wV2DDleZPcYjPInKdQDS2CBAd3J9u7 xWB8Ced6ATnVcxFRBB/tNp4SpnT1A0mi+FXkq8MZrwsrDMtDCFcWUixrlK0Y58KCRQr3 /INg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hhAwl8Vu; 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 f3si13960603eda.251.2019.11.12.04.52.09; Tue, 12 Nov 2019 04:52:33 -0800 (PST) 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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hhAwl8Vu; 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 S1726985AbfKLMvT (ORCPT + 99 others); Tue, 12 Nov 2019 07:51:19 -0500 Received: from conssluserg-04.nifty.com ([210.131.2.83]:53981 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbfKLMvS (ORCPT ); Tue, 12 Nov 2019 07:51:18 -0500 Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com [209.85.217.45]) (authenticated) by conssluserg-04.nifty.com with ESMTP id xACCp8Kp030082; Tue, 12 Nov 2019 21:51:09 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com xACCp8Kp030082 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1573563069; bh=pERbu/D6TsAoFYrJhhErJt2I5IFldM4FmNpzx6W3OhY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=hhAwl8VuQ3Yd0T/pN6/IlaZnHDDCkMvn4AkJaBnukC253y9L8B9fG++arcrdl5Z5R /9rD9bJPmjSLxO4qwDHCLEV1+DZeFXxu3i2pTz9FzfFEuMpTsZ5NY1K3MvQBvltwM+ EuM3IMQqTzCGj/Cgeds+eBcPGUtyWxj1+j8IMM6wFlWw7ZidfuOGGAdUtCZdA13bf2 fdxUCJHu4eK/2YdS1rZHCeYr3wjmX6o/CROPeuUQ5kq1iFGodfCrbDdgRtuMyikDuj hNfP1Bi0zXdRSJR15wzOsmWUxaF0G47IS5Fzkm3WNVYy3T96Ijn7eqyHXvZN29ek67 XKVfuzxXV1s+Q== X-Nifty-SrcIP: [209.85.217.45] Received: by mail-vs1-f45.google.com with SMTP id c25so10695270vsp.0; Tue, 12 Nov 2019 04:51:08 -0800 (PST) X-Gm-Message-State: APjAAAUBMt2tRJdM3Qw3Hl3Xo3ar2p6dmK6gXkvCDmY08DTjdi3o0AQC ULTuaWkZHeVyN1rAEOyfryjjnCVnXWwyT4/HC84= X-Received: by 2002:a05:6102:726:: with SMTP id u6mr21481694vsg.179.1573563067515; Tue, 12 Nov 2019 04:51:07 -0800 (PST) MIME-Version: 1.0 References: <1da2db04-da6a-cedb-e85a-6ded68dada82@163.com> <20191112123125.GD17835@willie-the-truck> In-Reply-To: <20191112123125.GD17835@willie-the-truck> From: Masahiro Yamada Date: Tue, 12 Nov 2019 21:50:31 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Question about "asm/rwonce.h: No such file or directory" To: Will Deacon Cc: Xiao Yang , linux-arch , Linux Kernel Mailing List , Alexei Starovoitov , Daniel Borkmann Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 12, 2019 at 9:31 PM Will Deacon 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 > > ^ > > 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. Please note tools/ is out of scope of Kbuild. The tools/ created a completely different build system. tools/bpf/ looks like a host program. Does it include a kernel-space header of the target architecture? I see a lots of header duplication in tools/include/, but I am not sure if tools/include/linux/filter.h is the correct header to include. > > Perhaps it's possible to introduce a dependency on a top-level "make > asm-generic" so that we can reference the generated headers from the arch > directly. Thoughts? > > Will -- Best Regards Masahiro Yamada