From patchwork Mon Jan 14 13:51:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762621 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0250D1390 for ; Mon, 14 Jan 2019 13:52:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6FDD28BF8 for ; Mon, 14 Jan 2019 13:52:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAE2828C02; Mon, 14 Jan 2019 13:52:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B54C28C03 for ; Mon, 14 Jan 2019 13:52:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726712AbfANNvs (ORCPT ); Mon, 14 Jan 2019 08:51:48 -0500 Received: from laurent.telenet-ops.be ([195.130.137.89]:57706 "EHLO laurent.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbfANNvs (ORCPT ); Mon, 14 Jan 2019 08:51:48 -0500 Received: from ramsan ([84.194.111.163]) by laurent.telenet-ops.be with bizsmtp id QDrm1z0063XaVaC01DrmWu; Mon, 14 Jan 2019 14:51:46 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eX-0000EX-Uf; Mon, 14 Jan 2019 14:51:45 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eX-0006ns-Sw; Mon, 14 Jan 2019 14:51:45 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 01/12] selftests: gpio-mockup-chardev: Check asprintf() for error Date: Mon, 14 Jan 2019 14:51:33 +0100 Message-Id: <20190114135144.26096-2-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With gcc 7.3.0: gpio-mockup-chardev.c: In function ‘get_debugfs’: gpio-mockup-chardev.c:62:3: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result] asprintf(path, "%s/gpio", mnt_fs_get_target(fs)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Handle asprintf() failures to fix this. Signed-off-by: Geert Uytterhoeven --- tools/testing/selftests/gpio/gpio-mockup-chardev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/gpio/gpio-mockup-chardev.c b/tools/testing/selftests/gpio/gpio-mockup-chardev.c index f8d468f54e986dd0..aaa1e9f083c37215 100644 --- a/tools/testing/selftests/gpio/gpio-mockup-chardev.c +++ b/tools/testing/selftests/gpio/gpio-mockup-chardev.c @@ -37,7 +37,7 @@ static int get_debugfs(char **path) struct libmnt_table *tb; struct libmnt_iter *itr = NULL; struct libmnt_fs *fs; - int found = 0; + int found = 0, ret; cxt = mnt_new_context(); if (!cxt) @@ -58,8 +58,11 @@ static int get_debugfs(char **path) break; } } - if (found) - asprintf(path, "%s/gpio", mnt_fs_get_target(fs)); + if (found) { + ret = asprintf(path, "%s/gpio", mnt_fs_get_target(fs)); + if (ret < 0) + err(EXIT_FAILURE, "failed to format string"); + } mnt_free_iter(itr); mnt_free_context(cxt); From patchwork Mon Jan 14 13:51:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 467421390 for ; Mon, 14 Jan 2019 13:52:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36BE5287FE for ; Mon, 14 Jan 2019 13:52:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B3AB28BC2; Mon, 14 Jan 2019 13:52:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC97F287FE for ; Mon, 14 Jan 2019 13:52:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726687AbfANNwq (ORCPT ); Mon, 14 Jan 2019 08:52:46 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:51466 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726684AbfANNvs (ORCPT ); Mon, 14 Jan 2019 08:51:48 -0500 Received: from ramsan ([84.194.111.163]) by andre.telenet-ops.be with bizsmtp id QDrm1z0033XaVaC01DrmK4; Mon, 14 Jan 2019 14:51:47 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eX-0000EZ-Vc; Mon, 14 Jan 2019 14:51:45 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eX-0006nv-US; Mon, 14 Jan 2019 14:51:45 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 02/12] selftests: Fix output directory with O= Date: Mon, 14 Jan 2019 14:51:34 +0100 Message-Id: <20190114135144.26096-3-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When building kselftest in a separate output directory, the individual test directories end up in the root of the output directory, instead of under tools/testing/selftests/. Fix this by passing the expected path to the make subprocess. Signed-off-by: Geert Uytterhoeven --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 088059312237b5d5..ed7c1ea324e97ac2 100644 --- a/Makefile +++ b/Makefile @@ -1191,11 +1191,11 @@ endif PHONY += kselftest kselftest: - $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests + $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests O=$(abspath $(objtree)/tools/testing/selftests) PHONY += kselftest-clean kselftest-clean: - $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests clean + $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests clean O=$(abspath $(objtree)/tools/testing/selftests) PHONY += kselftest-merge kselftest-merge: From patchwork Mon Jan 14 13:51:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762617 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0755B13B4 for ; Mon, 14 Jan 2019 13:52:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE6D12899F for ; Mon, 14 Jan 2019 13:52:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC7E628BF8; Mon, 14 Jan 2019 13:52:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96E8A28C15 for ; Mon, 14 Jan 2019 13:52:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726665AbfANNwZ (ORCPT ); Mon, 14 Jan 2019 08:52:25 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:59248 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726660AbfANNvt (ORCPT ); Mon, 14 Jan 2019 08:51:49 -0500 Received: from ramsan ([84.194.111.163]) by baptiste.telenet-ops.be with bizsmtp id QDrm1z0033XaVaC01DrmHR; Mon, 14 Jan 2019 14:51:47 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eY-0000Eb-0G; Mon, 14 Jan 2019 14:51:46 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eX-0006o0-VM; Mon, 14 Jan 2019 14:51:45 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 03/12] selftests: Fix header install directory with O= Date: Mon, 14 Jan 2019 14:51:35 +0100 Message-Id: <20190114135144.26096-4-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When building kselftest in a separate output directory, the kernel headers are still installed in the source directory, instead of in the specified output directory. Fix this by passing the expected path to the make subprocess. Signed-off-by: Geert Uytterhoeven --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ed7c1ea324e97ac2..5355033dda6ed1ea 100644 --- a/Makefile +++ b/Makefile @@ -1191,7 +1191,7 @@ endif PHONY += kselftest kselftest: - $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests O=$(abspath $(objtree)/tools/testing/selftests) + $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests O=$(abspath $(objtree)/tools/testing/selftests) INSTALL_HDR_PATH=$(abspath $(INSTALL_HDR_PATH)) PHONY += kselftest-clean kselftest-clean: From patchwork Mon Jan 14 13:51:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762601 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 30FA813B4 for ; Mon, 14 Jan 2019 13:52:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2202728BAB for ; Mon, 14 Jan 2019 13:52:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 165E628BE8; Mon, 14 Jan 2019 13:52:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5BCA28BAB for ; Mon, 14 Jan 2019 13:52:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726747AbfANNv6 (ORCPT ); Mon, 14 Jan 2019 08:51:58 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:51426 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbfANNvt (ORCPT ); Mon, 14 Jan 2019 08:51:49 -0500 Received: from ramsan ([84.194.111.163]) by andre.telenet-ops.be with bizsmtp id QDrm1z0053XaVaC01DrmK5; Mon, 14 Jan 2019 14:51:47 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eY-0000Ef-1e; Mon, 14 Jan 2019 14:51:46 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eY-0006o3-00; Mon, 14 Jan 2019 14:51:46 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 04/12] selftests: android: ion: Fix ionmap_test dependencies Date: Mon, 14 Jan 2019 14:51:36 +0100 Message-Id: <20190114135144.26096-5-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When building kselftest in a separate output directory: /tmp/cc44s4yX.o: In function `socket_send_fd': tools/testing/selftests/android/ion/ionutils.c:221: undefined reference to `sendtosocket' /tmp/cc44s4yX.o: In function `socket_receive_fd': tools/testing/selftests/android/ion/ionutils.c:243: undefined reference to `receivefromsocket' The dependencies for the various test programs are expressed twice: 1. Once using $(TEST_GEN_FILES), which supports building in the source directory only, 2. A second time using $(OUTPUT), which supports building in either the source or build directory, but lacks a dependency of ionmap_test on ipcsocket, causing the link error above. Fix this by: - Adding the missing dependency to 2, - Dropping superfluous rule 1. Remove the "all" target while at it, as that is already handled by the included lib.mk. Fixes: ac93f7046a5371ff ("selftests: ion: Add simple test with the vgem driver") Signed-off-by: Geert Uytterhoeven --- tools/testing/selftests/android/ion/Makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/testing/selftests/android/ion/Makefile b/tools/testing/selftests/android/ion/Makefile index 88cfe88e466fb0e6..ce05c5f3594bcf87 100644 --- a/tools/testing/selftests/android/ion/Makefile +++ b/tools/testing/selftests/android/ion/Makefile @@ -4,10 +4,6 @@ CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test -all: $(TEST_GEN_FILES) - -$(TEST_GEN_FILES): ipcsocket.c ionutils.c - TEST_PROGS := ion_test.sh KSFT_KHDR_INSTALL := 1 @@ -16,4 +12,4 @@ include ../../lib.mk $(OUTPUT)/ionapp_export: ionapp_export.c ipcsocket.c ionutils.c $(OUTPUT)/ionapp_import: ionapp_import.c ipcsocket.c ionutils.c -$(OUTPUT)/ionmap_test: ionmap_test.c ionutils.c +$(OUTPUT)/ionmap_test: ionmap_test.c ipcsocket.c ionutils.c From patchwork Mon Jan 14 13:51:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762629 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4CCAB1390 for ; Mon, 14 Jan 2019 13:52:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E52A287EA for ; Mon, 14 Jan 2019 13:52:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32D4128BEC; Mon, 14 Jan 2019 13:52:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9A89287EA for ; Mon, 14 Jan 2019 13:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726703AbfANNvs (ORCPT ); Mon, 14 Jan 2019 08:51:48 -0500 Received: from albert.telenet-ops.be ([195.130.137.90]:39656 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726643AbfANNvs (ORCPT ); Mon, 14 Jan 2019 08:51:48 -0500 Received: from ramsan ([84.194.111.163]) by albert.telenet-ops.be with bizsmtp id QDrm1z0093XaVaC06Drml0; Mon, 14 Jan 2019 14:51:46 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eY-0000Ej-2F; Mon, 14 Jan 2019 14:51:46 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eY-0006o6-0x; Mon, 14 Jan 2019 14:51:46 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 05/12] selftests: seccomp: Fix test dependencies and rules Date: Mon, 14 Jan 2019 14:51:37 +0100 Message-Id: <20190114135144.26096-6-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When building kselftest in a separate output directory, the seccomp_bpf binary ends up in the source directory instead of in the output directory, and the build of seccomp_benchmark fails: make[5]: *** No rule to make target 'seccomp_benchmark', needed by 'all'. Stop. Fix this by declaring both test binaries using TEST_GEN_PROGS, and using the build support from lib.mk properly. Fixes: 967d7ba841513910 ("selftests/seccomp: Add simple seccomp overhead benchmark") Signed-off-by: Geert Uytterhoeven --- tools/testing/selftests/seccomp/Makefile | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile index fce7f4ce069251a6..c728bd7a366f78b9 100644 --- a/tools/testing/selftests/seccomp/Makefile +++ b/tools/testing/selftests/seccomp/Makefile @@ -1,17 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 -all: -include ../lib.mk - -.PHONY: all clean - -BINARIES := seccomp_bpf seccomp_benchmark CFLAGS += -Wl,-no-as-needed -Wall +LDFLAGS += -lpthread -seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h - $(CC) $(CFLAGS) $(LDFLAGS) -lpthread $< -o $@ +TEST_GEN_PROGS = seccomp_bpf seccomp_benchmark -TEST_PROGS += $(BINARIES) -EXTRA_CLEAN := $(BINARIES) - -all: $(BINARIES) +include ../lib.mk From patchwork Mon Jan 14 13:51:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 699C2186E for ; Mon, 14 Jan 2019 13:52:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B61B28BDB for ; Mon, 14 Jan 2019 13:52:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59EBE28C06; Mon, 14 Jan 2019 13:52:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE56D28BDB for ; Mon, 14 Jan 2019 13:52:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726752AbfANNwE (ORCPT ); Mon, 14 Jan 2019 08:52:04 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:51424 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726688AbfANNvt (ORCPT ); Mon, 14 Jan 2019 08:51:49 -0500 Received: from ramsan ([84.194.111.163]) by andre.telenet-ops.be with bizsmtp id QDrm1z0083XaVaC01DrmK7; Mon, 14 Jan 2019 14:51:47 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eY-0000El-2c; Mon, 14 Jan 2019 14:51:46 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eY-0006o9-1c; Mon, 14 Jan 2019 14:51:46 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 06/12] selftests: lib.mk: Add rule to build object file from C source file Date: Mon, 14 Jan 2019 14:51:38 +0100 Message-Id: <20190114135144.26096-7-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently there are rules to compile and link one or more C or assembler source files into a full executable, and to assemble a single assembler source into an object file. Add a generic rule to compile a single C source file into an object file, for reuse of object files in multiple executables. Signed-off-by: Geert Uytterhoeven --- tools/testing/selftests/lib.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 8b0f16409ed7eb53..77a71264d8c5a743 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -141,6 +141,7 @@ clean: # ifneq ($(KBUILD_SRC),) LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) +COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c COMPILE.S = $(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c LINK.S = $(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) endif @@ -151,6 +152,9 @@ ifeq ($(OVERRIDE_TARGETS),) $(OUTPUT)/%:%.c $(LINK.c) $^ $(LDLIBS) -o $@ +$(OUTPUT)/%.o:%.c + $(COMPILE.c) $^ -o $@ + $(OUTPUT)/%.o:%.S $(COMPILE.S) $^ -o $@ From patchwork Mon Jan 14 13:51:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762591 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9977C1390 for ; Mon, 14 Jan 2019 13:51:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A4FD28B64 for ; Mon, 14 Jan 2019 13:51:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AE9228BE6; Mon, 14 Jan 2019 13:51:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D4272899F for ; Mon, 14 Jan 2019 13:51:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726701AbfANNvs (ORCPT ); Mon, 14 Jan 2019 08:51:48 -0500 Received: from laurent.telenet-ops.be ([195.130.137.89]:57696 "EHLO laurent.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726631AbfANNvs (ORCPT ); Mon, 14 Jan 2019 08:51:48 -0500 Received: from ramsan ([84.194.111.163]) by laurent.telenet-ops.be with bizsmtp id QDrm1z00D3XaVaC01DrmWv; Mon, 14 Jan 2019 14:51:46 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eY-0000En-3I; Mon, 14 Jan 2019 14:51:46 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eY-0006oC-2H; Mon, 14 Jan 2019 14:51:46 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 07/12] selftests: memfd: Fix build with O= Date: Mon, 14 Jan 2019 14:51:39 +0100 Message-Id: <20190114135144.26096-8-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When building kselftest in a separate output directory: make[3]: *** No rule to make target 'common.o', needed by '/tmp/kselftest/memfd/memfd_test'. Stop. Fix this by explicitly listing common.o (in the output tree) in the build targets (allowing the EXTRA_CLEAN rule to be dropped), and updating the dependencies of the final executables. Signed-off-by: Geert Uytterhoeven --- tools/testing/selftests/memfd/Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile index 53a848109f7bbbd0..f3e988e54ec81083 100644 --- a/tools/testing/selftests/memfd/Makefile +++ b/tools/testing/selftests/memfd/Makefile @@ -6,7 +6,7 @@ CFLAGS += -I../../../../usr/include/ TEST_GEN_PROGS := memfd_test TEST_PROGS := run_fuse_test.sh run_hugetlbfs_test.sh -TEST_GEN_FILES := fuse_mnt fuse_test +TEST_GEN_FILES := fuse_mnt fuse_test common.o fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags) @@ -14,7 +14,5 @@ include ../lib.mk $(OUTPUT)/fuse_mnt: LDLIBS += $(shell pkg-config fuse --libs) -$(OUTPUT)/memfd_test: memfd_test.c common.o -$(OUTPUT)/fuse_test: fuse_test.c common.o - -EXTRA_CLEAN = common.o +$(OUTPUT)/memfd_test: memfd_test.c $(OUTPUT)/common.o +$(OUTPUT)/fuse_test: fuse_test.c $(OUTPUT)/common.o From patchwork Mon Jan 14 13:51:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762593 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E988B13B4 for ; Mon, 14 Jan 2019 13:51:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB68428BDB for ; Mon, 14 Jan 2019 13:51:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFC0028BF1; Mon, 14 Jan 2019 13:51:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53B7028BC0 for ; Mon, 14 Jan 2019 13:51:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726639AbfANNvt (ORCPT ); Mon, 14 Jan 2019 08:51:49 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:59254 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726656AbfANNvs (ORCPT ); Mon, 14 Jan 2019 08:51:48 -0500 Received: from ramsan ([84.194.111.163]) by baptiste.telenet-ops.be with bizsmtp id QDrm1z00B3XaVaC01DrmHV; Mon, 14 Jan 2019 14:51:47 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eY-0000Eq-3t; Mon, 14 Jan 2019 14:51:46 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eY-0006oG-2u; Mon, 14 Jan 2019 14:51:46 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 08/12] selftests: timestamping: Remove superfluous rules Date: Mon, 14 Jan 2019 14:51:40 +0100 Message-Id: <20190114135144.26096-9-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Makefile:14: warning: overriding recipe for target 'clean' ../../lib.mk:137: warning: ignoring old recipe for target 'clean' "all" and "clean" are already handled by the included lib.mk. Signed-off-by: Geert Uytterhoeven --- tools/testing/selftests/networking/timestamping/Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tools/testing/selftests/networking/timestamping/Makefile b/tools/testing/selftests/networking/timestamping/Makefile index 9050eeea5f5f2953..49ede79660c0208d 100644 --- a/tools/testing/selftests/networking/timestamping/Makefile +++ b/tools/testing/selftests/networking/timestamping/Makefile @@ -4,11 +4,6 @@ CFLAGS += -I../../../../../usr/include TEST_GEN_FILES := hwtstamp_config rxtimestamp timestamping txtimestamp TEST_PROGS := txtimestamp.sh -all: $(TEST_PROGS) - top_srcdir = ../../../../.. KSFT_KHDR_INSTALL := 1 include ../../lib.mk - -clean: - rm -fr $(TEST_GEN_FILES) From patchwork Mon Jan 14 13:51:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762627 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A2BAB14E5 for ; Mon, 14 Jan 2019 13:52:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 950E928BD9 for ; Mon, 14 Jan 2019 13:52:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 802CB28C02; Mon, 14 Jan 2019 13:52:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4310128C0F for ; Mon, 14 Jan 2019 13:52:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726709AbfANNvs (ORCPT ); Mon, 14 Jan 2019 08:51:48 -0500 Received: from xavier.telenet-ops.be ([195.130.132.52]:42454 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726586AbfANNvs (ORCPT ); Mon, 14 Jan 2019 08:51:48 -0500 Received: from ramsan ([84.194.111.163]) by xavier.telenet-ops.be with bizsmtp id QDrm1z00L3XaVaC01Drm9n; Mon, 14 Jan 2019 14:51:47 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eY-0000Ev-4w; Mon, 14 Jan 2019 14:51:46 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eY-0006oK-3c; Mon, 14 Jan 2019 14:51:46 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 09/12] selftests: sparc64: Remove superfluous rules Date: Mon, 14 Jan 2019 14:51:41 +0100 Message-Id: <20190114135144.26096-10-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP "all" and the generic %.c dependency are already handled by the included lib.mk. Signed-off-by: Geert Uytterhoeven --- tools/testing/selftests/sparc64/drivers/Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/testing/selftests/sparc64/drivers/Makefile b/tools/testing/selftests/sparc64/drivers/Makefile index deb0df4155659ec1..174dbd675f1f8264 100644 --- a/tools/testing/selftests/sparc64/drivers/Makefile +++ b/tools/testing/selftests/sparc64/drivers/Makefile @@ -4,10 +4,6 @@ CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g TEST_GEN_FILES := adi-test -all: $(TEST_GEN_FILES) - -$(TEST_GEN_FILES): adi-test.c - TEST_PROGS := drivers_test.sh include ../../lib.mk From patchwork Mon Jan 14 13:51:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 451A81390 for ; Mon, 14 Jan 2019 13:52:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35F6628C0F for ; Mon, 14 Jan 2019 13:52:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33F7828BD9; Mon, 14 Jan 2019 13:52:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9542B28BDA for ; Mon, 14 Jan 2019 13:52:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726764AbfANNwE (ORCPT ); Mon, 14 Jan 2019 08:52:04 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:59218 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726664AbfANNvt (ORCPT ); Mon, 14 Jan 2019 08:51:49 -0500 Received: from ramsan ([84.194.111.163]) by baptiste.telenet-ops.be with bizsmtp id QDrm1z00H3XaVaC01DrmHX; Mon, 14 Jan 2019 14:51:47 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eY-0000Ez-6O; Mon, 14 Jan 2019 14:51:46 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eY-0006oN-4J; Mon, 14 Jan 2019 14:51:46 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 10/12] selftests: intel_pstate: Remove unused header dependency rule Date: Mon, 14 Jan 2019 14:51:42 +0100 Message-Id: <20190114135144.26096-11-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The intel_pstate test doesn't contain any header files, so there is no need to declare a rule for header dependencies. Signed-off-by: Geert Uytterhoeven --- tools/testing/selftests/intel_pstate/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/testing/selftests/intel_pstate/Makefile b/tools/testing/selftests/intel_pstate/Makefile index 7340fd6a9a9f2cbd..3f51f9226286f661 100644 --- a/tools/testing/selftests/intel_pstate/Makefile +++ b/tools/testing/selftests/intel_pstate/Makefile @@ -12,5 +12,3 @@ endif TEST_PROGS := run.sh include ../lib.mk - -$(TEST_GEN_FILES): $(HEADERS) From patchwork Mon Jan 14 13:51:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762637 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5F8A214E5 for ; Mon, 14 Jan 2019 13:52:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5156B287FE for ; Mon, 14 Jan 2019 13:52:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4544B28BDA; Mon, 14 Jan 2019 13:52:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED2C2288B4 for ; Mon, 14 Jan 2019 13:52:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726690AbfANNwq (ORCPT ); Mon, 14 Jan 2019 08:52:46 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:51458 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726679AbfANNvs (ORCPT ); Mon, 14 Jan 2019 08:51:48 -0500 Received: from ramsan ([84.194.111.163]) by andre.telenet-ops.be with bizsmtp id QDrm1z00C3XaVaC01DrmK8; Mon, 14 Jan 2019 14:51:47 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eY-0000F2-7x; Mon, 14 Jan 2019 14:51:46 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eY-0006oQ-66; Mon, 14 Jan 2019 14:51:46 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 11/12] selftests: Add kselftest-build target Date: Mon, 14 Jan 2019 14:51:43 +0100 Message-Id: <20190114135144.26096-12-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The documented way to build kselftest is to run make -C tools/testing/selftests with an optional "O=..." parameter to specify the output directory. However, all of the above assume you run make from the source directory. while other make commands can simply be run from the output directory, too (the autogenerated Makefile in the output directory takes care of this). Add a "kselftest-build" target, so "make kselftest-build" can be used from either the source or output directory. Signed-off-by: Geert Uytterhoeven --- Perhaps this make target should just be called "kselftest", and the existing "kselftest" target be renamed to "kselftest-run"? --- Documentation/dev-tools/kselftest.rst | 4 ++++ Makefile | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/Documentation/dev-tools/kselftest.rst b/Documentation/dev-tools/kselftest.rst index 7756f7a7c23b9408..b90b4ee6334a0941 100644 --- a/Documentation/dev-tools/kselftest.rst +++ b/Documentation/dev-tools/kselftest.rst @@ -21,6 +21,10 @@ To build the tests:: $ make -C tools/testing/selftests +Or: + + $ make kselftest-build + To run the tests:: $ make -C tools/testing/selftests run_tests diff --git a/Makefile b/Makefile index 5355033dda6ed1ea..27a56de7ed45091e 100644 --- a/Makefile +++ b/Makefile @@ -1193,6 +1193,10 @@ PHONY += kselftest kselftest: $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests O=$(abspath $(objtree)/tools/testing/selftests) INSTALL_HDR_PATH=$(abspath $(INSTALL_HDR_PATH)) +PHONY += kselftest-build +kselftest-build: + $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests O=$(abspath $(objtree)/tools/testing/selftests) INSTALL_HDR_PATH=$(abspath $(INSTALL_HDR_PATH)) + PHONY += kselftest-clean kselftest-clean: $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests clean O=$(abspath $(objtree)/tools/testing/selftests) @@ -1445,6 +1449,7 @@ help: @echo ' kselftest - Build and run kernel selftest (run as root)' @echo ' Build, install, and boot kernel before' @echo ' running kselftest on it' + @echo ' kselftest-build - Build kselftest files' @echo ' kselftest-clean - Remove all generated kselftest files' @echo ' kselftest-merge - Merge all the config dependencies of kselftest to existing' @echo ' .config.' From patchwork Mon Jan 14 13:51:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07FF71390 for ; Mon, 14 Jan 2019 13:51:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE25328BDE for ; Mon, 14 Jan 2019 13:51:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E27ED28BB8; Mon, 14 Jan 2019 13:51:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C006287FE for ; Mon, 14 Jan 2019 13:51:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726625AbfANNv5 (ORCPT ); Mon, 14 Jan 2019 08:51:57 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:59242 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726659AbfANNvt (ORCPT ); Mon, 14 Jan 2019 08:51:49 -0500 Received: from ramsan ([84.194.111.163]) by baptiste.telenet-ops.be with bizsmtp id QDrm1z00M3XaVaC01DrmHY; Mon, 14 Jan 2019 14:51:47 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eY-0000F5-8y; Mon, 14 Jan 2019 14:51:46 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eY-0006oU-7c; Mon, 14 Jan 2019 14:51:46 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 12/12] selftests: gpio: Fix building tools/gpio from kselftests Date: Mon, 14 Jan 2019 14:51:44 +0100 Message-Id: <20190114135144.26096-13-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When running "make kselftests": make[3]: Entering directory 'tools/gpio' Makefile:24: tools/build/Makefile.include: No such file or directory make[3]: *** No rule to make target 'tools/build/Makefile.include'. Stop. When building kselftest in a separate output directory, the gpio tools are still built in the source directory. Fix this by passing the correct source and build paths to the make subprocess. Signed-off-by: Geert Uytterhoeven --- Marked RFC as there are still issues with this approach: - "make kselftest O=" needs: all: $(TEST_PROGS_EXTENDED) "make kselftest" needs that line to be replaced by: TEST_GEN_PROGS_EXTENDED := $(TEST_PROGS_EXTENDED) Having both lines doesn't help. - gpio-mockup-chardev is no longer built. --- tools/testing/selftests/gpio/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile index 0bb80619db580af1..1eb4304fcfcbad67 100644 --- a/tools/testing/selftests/gpio/Makefile +++ b/tools/testing/selftests/gpio/Makefile @@ -13,20 +13,22 @@ TEST_PROGS := gpio-mockup.sh TEST_FILES := gpio-mockup-sysfs.sh TEST_PROGS_EXTENDED := gpio-mockup-chardev -GPIODIR := $(realpath ../../../gpio) +GPIOSRCDIR := $(abspath $(CURDIR)/../../../gpio) +GPIOOBJDIR := $(abspath $(OUTPUT)/../../../gpio) GPIOOBJ := gpio-utils.o all: $(TEST_PROGS_EXTENDED) override define CLEAN $(RM) $(TEST_PROGS_EXTENDED) - $(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean + $(MAKE) -C $(GPIOSRCDIR) OUTPUT=$(GPIOOBJDIR)/ clean endef KSFT_KHDR_INSTALL := 1 include ../lib.mk -$(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) +$(TEST_PROGS_EXTENDED): $(GPIOOBJDIR)/$(GPIOOBJ) -$(GPIODIR)/$(GPIOOBJ): - $(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR) +$(GPIOOBJDIR)/$(GPIOOBJ): + mkdir -p $(GPIOOBJDIR) + $(MAKE) OUTPUT=$(GPIOOBJDIR)/ -C $(GPIOSRCDIR)