lkml.org 
[lkml]   [2022]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] selftests/landlock: fix broken include of linux/landlock.h

On 03/08/2022 22:13, Guillaume Tucker wrote:
> Revert part of the earlier changes to fix the kselftest build when
> using a sub-directory from the top of the tree as this broke the
> landlock test build as a side-effect when building with "make -C
> tools/testing/selftests/landlock".
>
> Reported-by: Mickaël Salaün <mic@digikod.net>
> Fixes: a917dd94b832 ("selftests/landlock: drop deprecated headers dependency")
> Fixes: f2745dc0ba3d ("selftests: stop using KSFT_KHDR_INSTALL")
> Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
> ---
> tools/testing/selftests/landlock/Makefile | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/landlock/Makefile b/tools/testing/selftests/landlock/Makefile
> index a6959df28eb0..02868ac3bc71 100644
> --- a/tools/testing/selftests/landlock/Makefile
> +++ b/tools/testing/selftests/landlock/Makefile
> @@ -9,10 +9,13 @@ TEST_GEN_PROGS := $(src_test:.c=)
> TEST_GEN_PROGS_EXTENDED := true
>
> OVERRIDE_TARGETS := 1
> +top_srcdir := ../../../..

Not sure it changes much, but most other selftests Makefiles use
"top_srcdir = ../../../.." (without ":="). Why this change?


> include ../lib.mk
>
> +khdr_dir = $(top_srcdir)/usr/include
> +
> $(OUTPUT)/true: true.c
> $(LINK.c) $< $(LDLIBS) -o $@ -static
>
> -$(OUTPUT)/%_test: %_test.c ../kselftest_harness.h common.h
> - $(LINK.c) $< $(LDLIBS) -o $@ -lcap
> +$(OUTPUT)/%_test: %_test.c $(khdr_dir)/linux/landlock.h ../kselftest_harness.h common.h
> + $(LINK.c) $< $(LDLIBS) -o $@ -lcap -I$(khdr_dir)

\
 
 \ /
  Last update: 2022-08-04 12:37    [W:0.141 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site