Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp353470imm; Sat, 26 May 2018 00:42:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrhWSGjLR3dK138VweqP8pQ7ki+Xr4ZEeCQHgaTE3i/cEecEQJwPTdwv5I+aJ45HIv4CfUp X-Received: by 2002:a65:534d:: with SMTP id w13-v6mr4270152pgr.178.1527320554973; Sat, 26 May 2018 00:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527320554; cv=none; d=google.com; s=arc-20160816; b=lbnTp2M0mSVZbkPY5QFkOWmc273Wce/+bEA2IUXFvXwj5jdb+ARP51xEOv38/GkIif jclZ8YyKeyzcFeivfNWQHjdci2fzw+EpiP9y4zaGN+1j7VRn2JkbunmEnMxv66kQi2/y iZnHi67gZOXeZTIZRcBjWeR/RNxMfqv4AWT36vcWG6Egq0VeYezDf/ZDSEruUFC/sXsD F4ggJIKq/R9M7H+nTqVwUwFUEytmHd24juM1y7i25n9iCtR/NzFno6F8nHjMLY5ykulD 1wAkyyOMecqjLd7pu9mZgzrZEerUGyDM/SWAQ0wkNjvrM8HpC3alVy1+J6/eRMw3iG+A ieSA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=BstKXQQDxRN05BHkP5/exo44n2kZjc/P/PFlundwegE=; b=0jIYYe0ApkXftNsXIlbLgs18KR+QLFZocPUkgiA4S8fqudCN8nVa6W08oAgFyLfh8t o8heo/u4iP4pnLVMYYgVd2vGhDvQUTAJrycDlFBxb26ZTReOy/IdS9UB0935P12i1hXu f5OpUpcTm8Awv+gXPNtG30Qz53Gai1Q9SB6gLwUnwgDBDST2yfdGwav1LDZYqfFbU9SI cqv0La7uES4mgwo//D/SDtt4hOojRAFTLyhRMZQIULNkCb3LyulJbI5OUVJoYlWuFI/u iJzygRnOxKLt0Rd0qt1cjU+/oi1xQ0uQ+uraRE5zdHlpgB32iKZSpXn1ceByxsPjWCUB Av9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UJ6xHg+t; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11-v6si19166375pgf.469.2018.05.26.00.42.19; Sat, 26 May 2018 00:42:34 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UJ6xHg+t; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031300AbeEZHmJ (ORCPT + 99 others); Sat, 26 May 2018 03:42:09 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:38851 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031131AbeEZHmH (ORCPT ); Sat, 26 May 2018 03:42:07 -0400 Received: by mail-it0-f68.google.com with SMTP id q4-v6so9483421ite.3; Sat, 26 May 2018 00:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BstKXQQDxRN05BHkP5/exo44n2kZjc/P/PFlundwegE=; b=UJ6xHg+tjghb0tngYwXD5E/Qc+l4t1rFCS7JpJ5TF2LNk5YPA8yXCtR1p2OeGyMc8m xxE/PPqpVqTN0FOXomI+Xr1poyGQ1J0FjROp+pHztiTxeOb8AK3YjKuSfUorSAPzMO2b 9VQh1a2A0Nf76tHupRoYj6pjkKBaX/xMksfkKhuBvhxkRyCgAGT/A6Dx66L4pLEaY4I1 4cmhK2jypW4ooknGL9MA1hHEUpwOs/gbg4HtgH0t+W1ny8IdF7k+K81xPaJaKFw4kvuz qzeE5/s20ebtKWKK4bvcp980/cdzomojh5EYJdmZfEgG7xFTuHfX4TnGAs5TXFfhdF3Y yDxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=BstKXQQDxRN05BHkP5/exo44n2kZjc/P/PFlundwegE=; b=KElspxZJLMo5Y7NBS45vrY2xKCQTkvz5UNmUmVdl44qn7gKT5oN4bOkrAqm6C60D6h ZjYBQ9Ge8rOTmVMpVbJvf+kxz1QHbk7w2DFOgmM2Vzji3dk54lVkcXUF26R2FlG3Ph74 VWvn5X5jf3NuJ29o31OLk2MEzgdDx7WXDRN6dhTLLFk/JlEHs6lbE58Gz9HOiIpOKuro ZAJ2YIHD8Q0mrELiWPTZuTaUKoHee1PtkGpit1MwC16rrf972GiMC8sT05hamFzyQurj SrqSXxrc+fOCBYdE5F9AG19G19OG4G6KVTXJC0iknnrLrwXXrfC35o5CCSwKn2AOiQXC yDfA== X-Gm-Message-State: ALKqPwcmaxVHo71gxNqdr9S3nubL6xAIYee9Cs3I+0l66fhVw06f5Ei2 53xrj0Rqh2xK9AGUSYJ2/EQtmZobUugZViL8AsjjPA== X-Received: by 2002:a24:97cf:: with SMTP id k198-v6mr4762837ite.105.1527320526936; Sat, 26 May 2018 00:42:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:ef03:0:0:0:0:0 with HTTP; Sat, 26 May 2018 00:41:26 -0700 (PDT) In-Reply-To: <176ee190-ecda-9b3e-5066-ecf3fbaf32bb@huawei.com> References: <20180525101757.13756-1-yuehaibing@huawei.com> <20180525161925.crdamzqjgs5wg77e@ast-mbp> <176ee190-ecda-9b3e-5066-ecf3fbaf32bb@huawei.com> From: Yafang Shao Date: Sat, 26 May 2018 15:41:26 +0800 Message-ID: Subject: Re: [PATCH net-next] bpfilter: fix a build err To: YueHaibing Cc: Alexei Starovoitov , David Miller , ast@kernel.org, netdev@vger.kernel.org, LKML 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 Sat, May 26, 2018 at 10:25 AM, YueHaibing wrote: > On 2018/5/26 0:19, Alexei Starovoitov wrote: >> On Fri, May 25, 2018 at 06:17:57PM +0800, YueHaibing wrote: >>> gcc-7.3.0 report following err: >>> >>> HOSTCC net/bpfilter/main.o >>> In file included from net/bpfilter/main.c:9:0: >>> ./include/uapi/linux/bpf.h:12:10: fatal error: linux/bpf_common.h: No such file or directory >>> #include >>> >>> remove it by adding a include path. >>> Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module") >>> >>> Signed-off-by: YueHaibing >>> --- >>> net/bpfilter/Makefile | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile >>> index 2af752c..3f3cb87 100644 >>> --- a/net/bpfilter/Makefile >>> +++ b/net/bpfilter/Makefile >>> @@ -5,7 +5,7 @@ >>> >>> hostprogs-y := bpfilter_umh >>> bpfilter_umh-objs := main.o >>> -HOSTCFLAGS += -I. -Itools/include/ >>> +HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi >> >> Strangely I don't see this error with gcc 7.3 >> I've tried this patch and it doesn't hurt, >> but before it gets applied could you please try >> the top two patches from this tree: >> https://git.kernel.org/pub/scm/linux/kernel/git/ast/bpf.git/?h=ipt_bpf >> in your environment? >> These two patches add the actual meat of bpfilter and I'd like >> to make sure the build setup is good for everyone before >> we proceed too far. > > after applied these two patches on net-next, the err still here: > bpfilter: rough bpfilter codegen example hack > bpfilter: add iptable get/set parsing > > HOSTCC net/bpfilter/main.o > In file included from net/bpfilter/main.c:13:0: > ./include/uapi/linux/bpf.h:12:10: fatal error: linux/bpf_common.h: No such file or directory > #include > ^~~~~~~~~~~~~~~~~~~~ > compilation terminated. > make[2]: *** [net/bpfilter/main.o] Error 1 > make[1]: *** [net/bpfilter] Error 2 > make: *** [net] Error 2 > > Also I compile your tree, error is same > > my gcc version info as follow: > [root@localhost net-next]# gcc -v > Using built-in specs. > COLLECT_GCC=gcc > COLLECT_LTO_WRAPPER=/home/yuehb/gcc-7.3.0-tools/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/lto-wrapper > Target: x86_64-pc-linux-gnu > Configured with: ../gcc-7.3.0/configure --enable-checking=release --enable-languages=c,c++ > --disable-multilib --prefix=/home/yuehb/gcc-7.3.0-tools > Thread model: posix > gcc version 7.3.0 (GCC) > >> This error also occurs on gcc-4.8.5. After applied Haibin's patch, this build error disapears. Thanks Yafang