Le 27/08/2024 à 16:41, Xi Ruoyao a écrit :
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.
My usr/include/ is also empty (only Makefile and headers_check.pl) and
building directly in tools/testing/selftests/vDSO works for me.
The command is:
ppc-linux-gcc -std=gnu99 -D_GNU_SOURCE= -isystem
/home/chleroy/linux-powerpc/tools/testing/selftests/../../../tools/include
-isystem
/home/chleroy/linux-powerpc/tools/testing/selftests/../../../include/uapi
vdso_test_getrandom.c parse_vdso.c -o
/home/chleroy/linux-powerpc/tools/testing/selftests/vDSO/vdso_test_getrandom
I believe I get the needed headers through : -isystem
/home/chleroy/linux-powerpc/tools/testing/selftests/../../../include/uapi
Christophe
PS: By the way, did you see the -DBULID_VDSO for the chacha test ? Don't
know the impact though ....