On Tue, 2024-08-27 at 16:15 +0200, Jason A. Donenfeld wrote:
/* snip */
> gcc -std=gnu99 -D_GNU_SOURCE= -isystem
> /home/zx2c4/Projects/random-linux/tools/testing/selftests/../../../tools/include
> -isystem
> /home/zx2c4/Projects/random-linux/tools/testing/selftests/../../../usr/include
> vdso_test_getrandom.c parse_vdso.c -o
> /home/zx2c4/Projects/random-linux/tools/testing/selftests/vDSO/vdso_test_getrandom
> vdso_test_getrandom.c:43:41: error: field ‘params’ has incomplete type
> 43 | struct vgetrandom_opaque_params params;
> | ^~~~~~
>
> $ ls
> /home/zx2c4/Projects/random-linux/tools/testing/selftests/../../../usr/include
> headers_check.pl Makefile
>
> Since I don't build in there, this directory is empty.
In the toplevel Makefile:
kselftest-%: headers FORCE
$(Q)$(MAKE) -C $(srctree)/tools/testing/selftests $*
So running "make kselftest-all" to build the self tests should have
already caused make to build the "headers" target, which puts the
headers into usr/include.
I don't think it's supported to build self tests w/o invoking the
toplevel Makefile: many other self tests use KHDR_INCLUDES as well, so
generally building with something like "make -C tools/testing/selftests"
just won't work.
--
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University