All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Shuah Khan <shuah@kernel.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Jonathan Corbet <corbet@lwn.net>,
	Bamvor Jian Zhang <bamv2005@gmail.com>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	linux-kbuild <linux-kbuild@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 05/12] selftests: seccomp: Fix test dependencies and rules
Date: Mon, 14 Jan 2019 15:16:17 -0800	[thread overview]
Message-ID: <CAGXu5j+SHuqv0=gxdsYBqraPyZMWdVD+uxrtYrepVZBX3ZzTKw@mail.gmail.com> (raw)
In-Reply-To: <20190114135144.26096-6-geert+renesas@glider.be>

On Mon, Jan 14, 2019 at 5:51 AM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
>
> 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 <geert+renesas@glider.be>
> ---
>  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

This breaks the dep on ../kselftest_harness.h. Changes go unnoticed if
this is changed:

$ touch tools/testing/selftests/kselftest_harness.h
$ make O=/tmp/kselftest -C tools/testing/selftests
...
make[1]: Entering directory
'/home/kees/src/linux/tools/testing/selftests/seccomp'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory
'/home/kees/src/linux/tools/testing/selftests/seccomp'
...

>
> -TEST_PROGS += $(BINARIES)
> -EXTRA_CLEAN := $(BINARIES)
> -
> -all: $(BINARIES)
> +include ../lib.mk
> --
> 2.17.1
>


-- 
Kees Cook

WARNING: multiple messages have this Message-ID
From: keescook at chromium.org (Kees Cook)
Subject: [PATCH 05/12] selftests: seccomp: Fix test dependencies and rules
Date: Mon, 14 Jan 2019 15:16:17 -0800	[thread overview]
Message-ID: <CAGXu5j+SHuqv0=gxdsYBqraPyZMWdVD+uxrtYrepVZBX3ZzTKw@mail.gmail.com> (raw)
In-Reply-To: <20190114135144.26096-6-geert+renesas@glider.be>

On Mon, Jan 14, 2019 at 5:51 AM Geert Uytterhoeven
<geert+renesas at glider.be> wrote:
>
> 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 <geert+renesas at glider.be>
> ---
>  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

This breaks the dep on ../kselftest_harness.h. Changes go unnoticed if
this is changed:

$ touch tools/testing/selftests/kselftest_harness.h
$ make O=/tmp/kselftest -C tools/testing/selftests
...
make[1]: Entering directory
'/home/kees/src/linux/tools/testing/selftests/seccomp'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory
'/home/kees/src/linux/tools/testing/selftests/seccomp'
...

>
> -TEST_PROGS += $(BINARIES)
> -EXTRA_CLEAN := $(BINARIES)
> -
> -all: $(BINARIES)
> +include ../lib.mk
> --
> 2.17.1
>


-- 
Kees Cook

WARNING: multiple messages have this Message-ID
From: keescook@chromium.org (Kees Cook)
Subject: [PATCH 05/12] selftests: seccomp: Fix test dependencies and rules
Date: Mon, 14 Jan 2019 15:16:17 -0800	[thread overview]
Message-ID: <CAGXu5j+SHuqv0=gxdsYBqraPyZMWdVD+uxrtYrepVZBX3ZzTKw@mail.gmail.com> (raw)
Message-ID: <20190114231617.Wi1NYvDpAjagXRR0y0uA0ZH1Cu7FjxYL2vvE362cM8w@z> (raw)
In-Reply-To: <20190114135144.26096-6-geert+renesas@glider.be>

On Mon, Jan 14, 2019 at 5:51 AM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
>
> 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 <geert+renesas at glider.be>
> ---
>  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

This breaks the dep on ../kselftest_harness.h. Changes go unnoticed if
this is changed:

$ touch tools/testing/selftests/kselftest_harness.h
$ make O=/tmp/kselftest -C tools/testing/selftests
...
make[1]: Entering directory
'/home/kees/src/linux/tools/testing/selftests/seccomp'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory
'/home/kees/src/linux/tools/testing/selftests/seccomp'
...

>
> -TEST_PROGS += $(BINARIES)
> -EXTRA_CLEAN := $(BINARIES)
> -
> -all: $(BINARIES)
> +include ../lib.mk
> --
> 2.17.1
>


-- 
Kees Cook

  reply	other threads:[~2019-01-14 23:16 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 13:51 [PATCH 00/12] selftests: Miscellaneous fixes Geert Uytterhoeven
2019-01-14 13:51 ` Geert Uytterhoeven
2019-01-14 13:51 ` geert+renesas
2019-01-14 13:51 ` [PATCH 01/12] selftests: gpio-mockup-chardev: Check asprintf() for error Geert Uytterhoeven
2019-01-14 13:51   ` Geert Uytterhoeven
2019-01-14 13:51   ` geert+renesas
2019-01-16 22:03   ` shuah
2019-01-16 22:03     ` shuah
2019-01-16 22:03     ` shuah
2019-01-14 13:51 ` [PATCH 02/12] selftests: Fix output directory with O= Geert Uytterhoeven
2019-01-14 13:51   ` Geert Uytterhoeven
2019-01-14 13:51   ` geert+renesas
2019-01-14 13:51 ` [PATCH 03/12] selftests: Fix header install " Geert Uytterhoeven
2019-01-14 13:51   ` Geert Uytterhoeven
2019-01-14 13:51   ` geert+renesas
2019-01-14 13:51 ` [PATCH 04/12] selftests: android: ion: Fix ionmap_test dependencies Geert Uytterhoeven
2019-01-14 13:51   ` Geert Uytterhoeven
2019-01-14 13:51   ` geert+renesas
2019-01-14 13:51 ` [PATCH 05/12] selftests: seccomp: Fix test dependencies and rules Geert Uytterhoeven
2019-01-14 13:51   ` Geert Uytterhoeven
2019-01-14 13:51   ` geert+renesas
2019-01-14 23:16   ` Kees Cook [this message]
2019-01-14 23:16     ` Kees Cook
2019-01-14 23:16     ` Kees Cook
2019-01-14 23:16     ` keescook
2019-01-14 13:51 ` [PATCH 06/12] selftests: lib.mk: Add rule to build object file from C source file Geert Uytterhoeven
2019-01-14 13:51   ` Geert Uytterhoeven
2019-01-14 13:51   ` geert+renesas
2019-01-14 13:51 ` [PATCH 07/12] selftests: memfd: Fix build with O= Geert Uytterhoeven
2019-01-14 13:51   ` Geert Uytterhoeven
2019-01-14 13:51   ` geert+renesas
2019-01-14 13:51 ` [PATCH 08/12] selftests: timestamping: Remove superfluous rules Geert Uytterhoeven
2019-01-14 13:51   ` Geert Uytterhoeven
2019-01-14 13:51   ` geert+renesas
2019-01-14 13:51 ` [PATCH 09/12] selftests: sparc64: " Geert Uytterhoeven
2019-01-14 13:51   ` Geert Uytterhoeven
2019-01-14 13:51   ` geert+renesas
2019-01-14 13:51 ` [PATCH 10/12] selftests: intel_pstate: Remove unused header dependency rule Geert Uytterhoeven
2019-01-14 13:51   ` Geert Uytterhoeven
2019-01-14 13:51   ` geert+renesas
2019-01-14 13:51 ` [PATCH 11/12] selftests: Add kselftest-build target Geert Uytterhoeven
2019-01-14 13:51   ` Geert Uytterhoeven
2019-01-14 13:51   ` geert+renesas
2019-01-14 13:51 ` [PATCH/RFC 12/12] selftests: gpio: Fix building tools/gpio from kselftests Geert Uytterhoeven
2019-01-14 13:51   ` Geert Uytterhoeven
2019-01-14 13:51   ` geert+renesas
2019-01-18  4:14 ` [PATCH 00/12] selftests: Miscellaneous fixes Masahiro Yamada
2019-01-18  4:14   ` Masahiro Yamada
2019-01-18  4:14   ` Masahiro Yamada
2019-01-18  4:14   ` yamada.masahiro
2019-01-18  7:57   ` Geert Uytterhoeven
2019-01-18  7:57     ` Geert Uytterhoeven
2019-01-18  7:57     ` Geert Uytterhoeven
2019-01-18  7:57     ` geert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGXu5j+SHuqv0=gxdsYBqraPyZMWdVD+uxrtYrepVZBX3ZzTKw@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=bamv2005@gmail.com \
    --cc=corbet@lwn.net \
    --cc=geert+renesas@glider.be \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=shuah@kernel.org \
    --cc=yamada.masahiro@socionext.com \
    --subject='Re: [PATCH 05/12] selftests: seccomp: Fix test dependencies and rules' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.