From patchwork Wed Apr 29 03:45:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1278934 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming-bpf@patchwork.ozlabs.org Delivered-To: patchwork-incoming-bpf@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=bpf-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.a=rsa-sha256 header.s=dec2015msa header.b=NXKxpfSe; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49Bkwv68r0z9sSv for ; Wed, 29 Apr 2020 13:47:27 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726974AbgD2DrW (ORCPT ); Tue, 28 Apr 2020 23:47:22 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:30764 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726596AbgD2Dq2 (ORCPT ); Tue, 28 Apr 2020 23:46:28 -0400 Received: from oscar.flets-west.jp (softbank126090202047.bbtec.net [126.90.202.47]) (authenticated) by conuserg-12.nifty.com with ESMTP id 03T3jXlj020748; Wed, 29 Apr 2020 12:45:39 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com 03T3jXlj020748 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1588131940; bh=qf2+zEQEuF8SgfIntsv9BASpYGvM27L/RyYRNFP16ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NXKxpfSe9kB+g4C67Az4wxu36qpOc8qpOtcsL0g+ZRS/P/ixie8D9uVse6AuJJXsA qa7dNkL2mckFc7xBby8GzkxRxm93iwDu6Rs0Z/iqYqugA9HbmmXjGk2YO1yMdCavla zdarbHX5lWuIohhHY1anZ0LDNE1k8ZK4Hx1n90qjsc0gil2XlHaJxShpW4EBP0aVxI J80qFa56U1l76Xd5Vlt5exNhOTh60XwCUp/Mty3pyESyRhhS5if2I95EVr5H21MkN0 smLpKyz7upZp3XXKv5ABv19YXVSJVrl/BqLKv7pKPkmKkZzlPb7u6Eb25XIETmDvMu ISnDJU/+vCgEw== X-Nifty-SrcIP: [126.90.202.47] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: bpf , Arnd Bergmann , Sam Ravnborg , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH v2 08/15] samples: hidraw: build sample program for target architecture Date: Wed, 29 Apr 2020 12:45:20 +0900 Message-Id: <20200429034527.590520-9-masahiroy@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200429034527.590520-1-masahiroy@kernel.org> References: <20200429034527.590520-1-masahiroy@kernel.org> MIME-Version: 1.0 Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org This userspace program includes UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the same architecture as the kernel), so the sample program should be built for the target as well. Kbuild now supports 'userprogs' for that. I also guarded the CONFIG option by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg --- Changes in v2: None samples/Kconfig | 2 +- samples/hidraw/Makefile | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/samples/Kconfig b/samples/Kconfig index 2560e87c9cae..08f2d025ca05 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -118,7 +118,7 @@ config SAMPLE_CONNECTOR config SAMPLE_HIDRAW bool "hidraw sample" - depends on HEADERS_INSTALL + depends on CC_CAN_LINK && HEADERS_INSTALL config SAMPLE_PIDFD bool "pidfd sample" diff --git a/samples/hidraw/Makefile b/samples/hidraw/Makefile index 8bd25f77671f..d2c77ed60b39 100644 --- a/samples/hidraw/Makefile +++ b/samples/hidraw/Makefile @@ -1,8 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -# List of programs to build -hostprogs := hid-example -always-y := $(hostprogs) +userprogs := hid-example +always-y := $(userprogs) -HOSTCFLAGS_hid-example.o += -I$(objtree)/usr/include - -all: hid-example +userccflags += -I usr/include