Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp162940ybz; Tue, 28 Apr 2020 20:49:30 -0700 (PDT) X-Google-Smtp-Source: APiQypLgVyMCYCAHOBlE4eN9cb2lyUSgEPG62iB2HTSDg+wGDiZ2Z3ZN/kiSHUAR/hfU8eU8n6uv X-Received: by 2002:a05:6402:2208:: with SMTP id cq8mr815868edb.293.1588132170815; Tue, 28 Apr 2020 20:49:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588132170; cv=none; d=google.com; s=arc-20160816; b=A/TrEWHm5EKd1N3ed6CFaV/zgAx4cZgFMo97lpdEdtMu43CJJlczCAVSsAdk30fgsu t5KJNojrcLh3Ntg7Y8en4TpsPvjt3iePXtmObrxTkJb2Q7TNXpJTPE296LPuSV891xaM tmD69JnQa0jUt6N6nzgdPglRjqLhoOqAzEBGWmpsVE9RT64YVqhPo5YwZNn3mVLARnVA RpRuapszQPwSazKJm9rOTzD2Qlee+6rXH02DBj76/mnSazEJyfei9umPk6awSS1suxyx nWoLpM1FcPL9CmUlTnz4pHPZjygvNFppAFo21SsLxieVbVffLcKs/TMY+BTpI46jhoLO 22XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=/uCEadxNK92jCzF6r8Ms1SjECd/NnWflpdES5lPj8ng=; b=H72q8PAlkNYU9BjmkWCEP/CJ+8WiLgYS/EHGHT0hImvvqymyd1VCE2Yp+40bqo1+Sy IghXBeuHzHgeVfe7OBAYJzib4nFdSnCiPrJ27nZxiMT7H3ylwFkUlpzuZmbYZ2kmctje 70I08+m7OOC3pFT0uXLPTqUUHr3L6X6MtVMxUeVPHhfCcjfs2t+jMjMvbGYm2oSqrckA teWmO9ZiQ91ay7L1p4UFTrbygH9Xa7YJiNiEh3XdT3xPpLNvzUFDTg1qIivsmfIWYrom VGar/84wZpd73OMGeWf2sYJK/ncd8ogwk2+CzN+gSsZlYfJDv2fmk8gzE/a32aNve3MN BV/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="e8y/rtn7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd5si2887614edb.34.2020.04.28.20.49.08; Tue, 28 Apr 2020 20:49:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="e8y/rtn7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726741AbgD2Dqb (ORCPT + 99 others); Tue, 28 Apr 2020 23:46:31 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:30763 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbgD2Dq2 (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 03T3jXli020748; Wed, 29 Apr 2020 12:45:39 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com 03T3jXli020748 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1588131939; bh=/uCEadxNK92jCzF6r8Ms1SjECd/NnWflpdES5lPj8ng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e8y/rtn7q/UuXhFyssQ1z+aGJwEDik/s6i/MovKMuj2mnaSzDZcQ29I1Us79HvY61 pjzkO0G374/1hdJvwOhUDD1xcjJejvRFyjiI0R8yB0piGI2nJvPB4+OTtXpIDCnsSI 9HTCBcuhl7JpF1NRyy1lmVzl6K0RtHVRTyXIUdr/c0rHS2XN0+AOb+V5TJ15uHxrGi z8GFRmOO32VEN5N+P19b/QwHZ8XHmObWzVxZCiu1M0pG8rNtqUFVXWOVaphlaZtRvC nsgfp5HwdGxS0qlSKS3pK3NJ8dNnYECOCjKePALhnv8d2YI+bQWqPOTEom4BXj9xdc /WB46ncPH86Hg== 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 07/15] samples: uhid: build sample program for target architecture Date: Wed, 29 Apr 2020 12:45:19 +0900 Message-Id: <20200429034527.590520-8-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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. Add the entry to samples/Makefile to put this into the build bot coverage. I also added the CONFIG option guarded 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 | 6 ++++++ samples/Makefile | 1 + samples/uhid/.gitignore | 2 ++ samples/uhid/Makefile | 9 +++------ 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 samples/uhid/.gitignore diff --git a/samples/Kconfig b/samples/Kconfig index 8949e9646125..2560e87c9cae 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -131,6 +131,12 @@ config SAMPLE_SECCOMP Build samples of seccomp filters using various methods of BPF filter construction. +config SAMPLE_UHID + bool "UHID sample" + depends on CC_CAN_LINK && HEADERS_INSTALL + help + Build UHID sample program. + config SAMPLE_VFIO_MDEV_MTTY tristate "Build VFIO mtty example mediated device sample code -- loadable modules only" depends on VFIO_MDEV_DEVICE && m diff --git a/samples/Makefile b/samples/Makefile index 5ce50ef0f2b2..bdc168405452 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -19,6 +19,7 @@ obj-$(CONFIG_SAMPLE_TRACE_EVENTS) += trace_events/ obj-$(CONFIG_SAMPLE_TRACE_PRINTK) += trace_printk/ obj-$(CONFIG_SAMPLE_FTRACE_DIRECT) += ftrace/ obj-$(CONFIG_SAMPLE_TRACE_ARRAY) += ftrace/ +subdir-$(CONFIG_SAMPLE_UHID) += uhid obj-$(CONFIG_VIDEO_PCI_SKELETON) += v4l/ obj-y += vfio-mdev/ subdir-$(CONFIG_SAMPLE_VFS) += vfs diff --git a/samples/uhid/.gitignore b/samples/uhid/.gitignore new file mode 100644 index 000000000000..0e0a5a929f5d --- /dev/null +++ b/samples/uhid/.gitignore @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +/uhid-example diff --git a/samples/uhid/Makefile b/samples/uhid/Makefile index 5f44ea40d6d5..9e652fc34103 100644 --- a/samples/uhid/Makefile +++ b/samples/uhid/Makefile @@ -1,8 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -# List of programs to build -hostprogs := uhid-example +userprogs := uhid-example +always-y := $(userprogs) -# Tell kbuild to always build the programs -always-y := $(hostprogs) - -HOSTCFLAGS_uhid-example.o += -I$(objtree)/usr/include +userccflags += -I usr/include -- 2.25.1