Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4644866imm; Mon, 25 Jun 2018 20:59:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJCyPGZlk63QoLbNTm52FFyLnxNVJL+GviqBlJx/iEBZQ/sBFb5DvqpTEEBzdC3l0QzsXUS X-Received: by 2002:a17:902:a989:: with SMTP id bh9-v6mr15343864plb.245.1529985556376; Mon, 25 Jun 2018 20:59:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529985556; cv=none; d=google.com; s=arc-20160816; b=ZMLe/pVyr3dNv992PDcZTa5Zoqn0BhfK1XQBIlYFweW/Cqsm0YS7JwljVFJ1NXdMk5 Wji7fgdDlYZus9VVRB6aEcb3HRuf1SPwu62UUhc/KekIP1F37uvV+U59HX8Hcxab3GNf f+ztkJUuWMWFeKouYPCPddiaig+yOUazpfA0UVB29Vy2s+qkLvB4Htv+jYMA6N9aF4LO 0C+HpBA1ja1s5+TYQUAffoi0uTyHloRmgzhV0loOrOygHB3CAXRH8LUtVUnF7xvJ6ITd 6sf2qkeYTsmzg3WaXyRLNYc+ZQLGkI1eZmDLlVZO6TL4u5po7RoIzTZJCUsZLx4VJ17Q oQjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=vFqrl0yfN2D/Um8ZkgXnGPldzzwp/IOIYE5gV2wf3gg=; b=afjw6B5UUGoATt/M3aIi/sU5xeVwdTixiEaBojz8kAxkqqt7OmLlGeFCbgPdIv72Y0 z7k0nf2FYbJKi7ldKnDOUHC6phn/kwtzUlPTBL+g1RPI6K+3iJIsXPlt0QPcVpl3MCg1 y9BUZB6Z0GQ1cHqpHP/5F4oEchmnVmO7E91DANVYzd4arVRqsae7J+Um/MWcGgU2mfXE KvbQjvB2G/Rs8gS32Mrx6Zg5vVadxBUlWtpGWERw4ONXx1ZfK75BZrG5Xind7qqT1AB3 yl1FR1AILrZcwjBG2AbTTIrYL/1/0DDAKdpekc+J0z33ujlWZokoKnnlhFBuSJNFnGdL 95eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=oa1cSiFt; 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 k15-v6si570778pgr.286.2018.06.25.20.59.02; Mon, 25 Jun 2018 20:59:16 -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=@nifty.com header.s=dec2015msa header.b=oa1cSiFt; 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 S935309AbeFZD5F (ORCPT + 99 others); Mon, 25 Jun 2018 23:57:05 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:60893 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934448AbeFZD5C (ORCPT ); Mon, 25 Jun 2018 23:57:02 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id w5Q3tpaS000721; Tue, 26 Jun 2018 12:55:51 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com w5Q3tpaS000721 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1529985352; bh=vFqrl0yfN2D/Um8ZkgXnGPldzzwp/IOIYE5gV2wf3gg=; h=From:To:Cc:Subject:Date:From; b=oa1cSiFtGbo3xFcbkILHI44EH0caJc1yPYmv+b3UFX0hUfRhMLBc5TQJGKI/HM81d 66MOoPWM0QCZHZm0JwJH9isI0l788nptAuRsUlmUUPnRLJT5GtkYPUFh7fdsLw0muG 3efFkgw0mEyXWp0rE2rnAy7y39CWuBv/r2Lg6MPnqvfEQOpvSFJbRTs4jigvybi3Kj BCJc0wu2ZmdZK9c7NRR08SmuicpoIzTcHoMmBhRrxko9z8PuluWpxJaGJP+TV4ywP3 c36ax+ldMl0E31C/GUpl/TjxpCcEV0xzP9gpq4C+e7NtQXj6ItLNn81Z6z3bV2fL/T BJvxvHvRtPQVQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: "David S . Miller" , netdev@vger.kernel.org, Alexei Starovoitov Cc: Matteo Croce , Arnd Bergmann , Masahiro Yamada , linux-kbuild@vger.kernel.org, Alexei Starovoitov , linux-kernel@vger.kernel.org, Michal Marek , Daniel Borkmann Subject: [RESEND PATCH] bpfilter: check compiler capability in Kconfig Date: Tue, 26 Jun 2018 12:55:35 +0900 Message-Id: <1529985336-27522-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the brand-new syntax extension of Kconfig, we can directly check the compiler capability in the configuration phase. If the cc-can-link.sh fails, the BPFILTER_UMH is automatically hidden by the dependency. I also deleted 'default n', which is no-op. Signed-off-by: Masahiro Yamada --- Makefile | 5 ----- net/Makefile | 4 ---- net/bpfilter/Kconfig | 2 +- scripts/cc-can-link.sh | 2 +- 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index a6d4872..f71ea52 100644 --- a/Makefile +++ b/Makefile @@ -520,11 +520,6 @@ ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLA KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO endif -ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/cc-can-link.sh $(CC)), y) - CC_CAN_LINK := y - export CC_CAN_LINK -endif - # The expansion should be delayed until arch/$(SRCARCH)/Makefile is included. # Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile. # CC_VERSION_TEXT is referenced from Kconfig (so it needs export), diff --git a/net/Makefile b/net/Makefile index 13ec0d5..bdaf539 100644 --- a/net/Makefile +++ b/net/Makefile @@ -20,11 +20,7 @@ obj-$(CONFIG_TLS) += tls/ obj-$(CONFIG_XFRM) += xfrm/ obj-$(CONFIG_UNIX) += unix/ obj-$(CONFIG_NET) += ipv6/ -ifneq ($(CC_CAN_LINK),y) -$(warning CC cannot link executables. Skipping bpfilter.) -else obj-$(CONFIG_BPFILTER) += bpfilter/ -endif obj-$(CONFIG_PACKET) += packet/ obj-$(CONFIG_NET_KEY) += key/ obj-$(CONFIG_BRIDGE) += bridge/ diff --git a/net/bpfilter/Kconfig b/net/bpfilter/Kconfig index a948b07..76deb66 100644 --- a/net/bpfilter/Kconfig +++ b/net/bpfilter/Kconfig @@ -1,6 +1,5 @@ menuconfig BPFILTER bool "BPF based packet filtering framework (BPFILTER)" - default n depends on NET && BPF && INET help This builds experimental bpfilter framework that is aiming to @@ -9,6 +8,7 @@ menuconfig BPFILTER if BPFILTER config BPFILTER_UMH tristate "bpfilter kernel module with user mode helper" + depends on $(success,$(srctree)/scripts/cc-can-link.sh $(CC)) default m help This builds bpfilter kernel module with embedded user mode helper diff --git a/scripts/cc-can-link.sh b/scripts/cc-can-link.sh index 208eb28..6efcead 100755 --- a/scripts/cc-can-link.sh +++ b/scripts/cc-can-link.sh @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 -cat << "END" | $@ -x c - -o /dev/null >/dev/null 2>&1 && echo "y" +cat << "END" | $@ -x c - -o /dev/null >/dev/null 2>&1 #include int main(void) { -- 2.7.4