From patchwork Fri Jun 8 17:12:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 138064 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1123157lji; Fri, 8 Jun 2018 10:13:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJAyyiA1oWaTqy1B4b3aADIEegjaWHCefIZKxhuMb73E7wfjUNOj4dJrVvcUMw+SOiy19Ap X-Received: by 2002:aa7:8491:: with SMTP id u17-v6mr2202029pfn.48.1528478008758; Fri, 08 Jun 2018 10:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528478008; cv=none; d=google.com; s=arc-20160816; b=dz2BiMHcom5iCVm95B4taCTzqiKHGC3QrGghD3bnwG4xagwiFUJmdYFUlEMd49SJJB AyjBrfGTnDn0z8WjDvIFJRmvXn/JTBPIDMEFtVWm1KzcLxgyhSSU5A1ImDNP5X9lUJUs XjWjpTkdpajcwrzZp2cNeP5JGxiEhr+9c1MX1BKJ7IozHQ7Lsx06mkYFsc0cQEJiPbMk 8iir67NQq9CcVVGnD8ezyy7Dnsnt6Ce6WpRT2AwkMQhpZQqVviE5VpXbX+j7/51ZooMI 9h0xeQdWhs58sEh2mPb9z7fe0w03gTRrDrIptmrUlrfErd9P1o8vXelaZt+SQHfoBsne 9UWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=sFOR8yPtAuS5GqeUxlJjV5u9vMKxeK8qrl3vZ67e+B8=; b=AQTr4JdB5mRmYXqIacsQeaE1pT3S3F26W4L2IzQ4s9wNld0KWsw/GUPAECY4atJkSG VdwuARhVXGCNw1cIguXfBdd+C5Qt4QXaiTRIelgSSh5VNTU7ipgXCToihRBYp0ZVkCyc r9HO3eV9lcWmqcj3LSTZEc3A9IZwRkl/kNA6jj5K3JoIJvXIwYPHFK1PQYU/r8dszIrT Gy/ntwBJ+obEN4R8FficIJb7aMCFV4JJMuPTZ6qXfBxG2Yds74MAcfBxtrYO0Skxz3Tq +cAY0e+DdhejHDe6CpaS5RAm9+r7CBak0B2b1QYN8YJNqyjrSxgwWEemxociHwqyeR3Z mINA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=XyXVS+t7; 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 w65-v6si27563567pfw.201.2018.06.08.10.13.28; Fri, 08 Jun 2018 10:13:28 -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=XyXVS+t7; 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 S1752712AbeFHRNC (ORCPT + 30 others); Fri, 8 Jun 2018 13:13:02 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:19838 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751719AbeFHRNB (ORCPT ); Fri, 8 Jun 2018 13:13:01 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-10.nifty.com with ESMTP id w58HCbWF008555; Sat, 9 Jun 2018 02:12:40 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w58HCbWF008555 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1528477960; bh=sFOR8yPtAuS5GqeUxlJjV5u9vMKxeK8qrl3vZ67e+B8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XyXVS+t7bL0S4pTNtX4JYs8XZw7iQqbNG/93vjhxGbk4g0299O91tGr2RyE0RRPfN 9CyEpQ/4nLuTtTupdchKKmiIeLbK/1Vc5AUikQNk7/UaAMuuWA+OtZ7U+cAwk7t118 aTSP6XnA7hFZSLxJgg58BvL3moI75Rz+xNASLUCaVAZcSuRNTVBC4CzTbgtCChaByJ BL3K28mJT6kqNO+qdGCx+sN4Ru9g01AilX6E3r6PP58TdLoixZSecu+TANRk9XFi+E ch3lJM043w/GXpL2NJYsb4LIdDFXQKFS5YfXd4ARxGCdYjDB3k2v7Il/1tJ7+U6upn XcjEAyvQ3Of2w== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: netdev@vger.kernel.org, Alexei Starovoitov , "David S . Miller" Cc: Arnd Bergmann , Geert Uytterhoeven , linux-kernel@vger.kernel.org, Masahiro Yamada , YueHaibing Subject: [PATCH 3/3] bpfilter: do not (ab)use host-program build rule Date: Sat, 9 Jun 2018 02:12:10 +0900 Message-Id: <1528477930-7342-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528477930-7342-1-git-send-email-yamada.masahiro@socionext.com> References: <1528477930-7342-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is an ugly hack to overwrite $(HOSTCC) with $(CC) to reuse the build rules from scripts/Makefile.host. It should not be tedious to write a build rule for its own. Signed-off-by: Masahiro Yamada --- net/bpfilter/Makefile | 17 +++++++++++------ net/bpfilter/{main.c => bpfilter_umh.c} | 0 2 files changed, 11 insertions(+), 6 deletions(-) rename net/bpfilter/{main.c => bpfilter_umh.c} (100%) -- 2.7.4 diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile index 39c6980..6571b30 100644 --- a/net/bpfilter/Makefile +++ b/net/bpfilter/Makefile @@ -3,18 +3,23 @@ # Makefile for the Linux BPFILTER layer. # -hostprogs-y := bpfilter_umh -bpfilter_umh-objs := main.o -HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi -HOSTCC := $(CC) - ifeq ($(CONFIG_BPFILTER_UMH), y) # builtin bpfilter_umh should be compiled with -static # since rootfs isn't mounted at the time of __init # function is called and do_execv won't find elf interpreter -HOSTLDFLAGS += -static +STATIC := -static endif +quiet_cmd_cc_user = CC $@ + cmd_cc_user = $(CC) -Wall -Wmissing-prototypes -O2 -std=gnu89 \ + -I$(srctree) -I$(srctree)/tools/include/ \ + -I$(srctree)/tools/include/uapi $(STATIC) -o $@ $< + +$(obj)/bpfilter_umh: $(src)/bpfilter_umh.c FORCE + $(call if_changed,cc_user) + +targets += bpfilter_umh + $(obj)/bpfilter_umh_blob.o: $(obj)/bpfilter_umh obj-$(CONFIG_BPFILTER_UMH) += bpfilter.o diff --git a/net/bpfilter/main.c b/net/bpfilter/bpfilter_umh.c similarity index 100% rename from net/bpfilter/main.c rename to net/bpfilter/bpfilter_umh.c