Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Le 27/08/2024 à 17:00, Jason A. Donenfeld a écrit :
On Tue, Aug 27, 2024 at 04:50:59PM +0200, Christophe Leroy wrote:


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

The effect of this patch is to replace include/uapi with usr/include, so
it will break for you too.

What I'm wondering is why yours and mine work like that, while Ruoyao's
breaks. He makes a good argument as to why this patch is the "right
way", even if it breaks our workflow...

Ah yes he is probably right.

Then I'll have to first do:

make CROSS_COMPILE=powerpc64-linux- ARCH=powerpc headers

Then everything should be fine.

Christophe



Christophe

PS: By the way, did you see the -DBULID_VDSO for the chacha test ? Don't
know the impact though ....

Yes and https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fall%2F20240827145454.3317093-1-Jason%40zx2c4.com%2F&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7C627846cc0a0e429e45c508dcc6a90690%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638603676502990226%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=H7PPFv8QGHsb9xh3J%2FzyeFrpvDu2uSKqx4ZwrPNwC2s%3D&reserved=0




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux