Skip to contentSkip to conversation

selftests: powerpc: Add header symlinks for building papr character device tests

PATCH In review Michal Suchanek 3 participants 6 messages Feb 15, 2024 – Feb 19, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: powerpc: Add header symlinks for building papr character device tests

From: root <[email protected]>

Without the headers the tests don't build.

Fixes 9118c5d32bdd ("powerpc/selftests: Add test for papr-vpd")
Fixes 76b2ec3faeaa ("powerpc/selftests: Add test for papr-sysparm")
---
 tools/testing/selftests/powerpc/include/asm/papr-miscdev.h | 1 +
 tools/testing/selftests/powerpc/include/asm/papr-sysparm.h | 1 +
 tools/testing/selftests/powerpc/include/asm/papr-vpd.h     | 1 +
 3 files changed, 3 insertions(+)
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-miscdev.h
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-sysparm.h
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-vpd.h
tools/testing/selftests/powerpc/include/asm/papr-miscdev.h new file +1 -0
new file mode 120000
index 000000000000..0f811020354d
@@ -0,0 +1 @@
+../../../../../../arch/powerpc/include/uapi/asm/papr-miscdev.h
\ No newline at end of file
tools/testing/selftests/powerpc/include/asm/papr-sysparm.h new file +1 -0
new file mode 120000
index 000000000000..6355e122245e
@@ -0,0 +1 @@
+../../../../../../arch/powerpc/include/uapi/asm/papr-sysparm.h
\ No newline at end of file
tools/testing/selftests/powerpc/include/asm/papr-vpd.h new file +1 -0
new file mode 120000
index 000000000000..403ddec6b422
@@ -0,0 +1 @@
+../../../../../../arch/powerpc/include/uapi/asm/papr-vpd.h
\ No newline at end of file
Signature · 1 line
2.43.0
#1 lore raw
Quoted 14 lines · Michal Suchanek

Without the headers the tests don't build.

Fixes 9118c5d32bdd ("powerpc/selftests: Add test for papr-vpd")
Fixes 76b2ec3faeaa ("powerpc/selftests: Add test for papr-sysparm")
---
 tools/testing/selftests/powerpc/include/asm/papr-miscdev.h | 1 +
 tools/testing/selftests/powerpc/include/asm/papr-sysparm.h | 1 +
 tools/testing/selftests/powerpc/include/asm/papr-vpd.h     | 1 +
 3 files changed, 3 insertions(+)
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-miscdev.h
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-sysparm.h
 create mode 120000
Quoted 1 line

tools/testing/selftests/powerpc/include/asm/papr-vpd.h

I really hope making symlinks into the kernel source isn't necessary. I haven't experienced build failures with these tests. How are you building them?

I usually do something like (on a x86 build host):

$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- ppc64le_defconfig
$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- headers
$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- -C tools/testing/selftests/powerpc/

without issue.

#2 lore raw
Quoted 21 lines · Nathan Lynch
Quoted 14 lines · Michal Suchanek

Without the headers the tests don't build.

Fixes 9118c5d32bdd ("powerpc/selftests: Add test for papr-vpd")
Fixes 76b2ec3faeaa ("powerpc/selftests: Add test for papr-sysparm")
---
 tools/testing/selftests/powerpc/include/asm/papr-miscdev.h | 1 +
 tools/testing/selftests/powerpc/include/asm/papr-sysparm.h | 1 +
 tools/testing/selftests/powerpc/include/asm/papr-vpd.h     | 1 +
 3 files changed, 3 insertions(+)
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-miscdev.h
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-sysparm.h
 create mode 120000
Quoted 1 line

tools/testing/selftests/powerpc/include/asm/papr-vpd.h

I really hope making symlinks into the kernel source isn't necessary. I haven't experienced build failures with these tests. How are you building them?

Quoted 7 lines

I usually do something like (on a x86 build host):

$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- ppc64le_defconfig
$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- headers
$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- -C tools/testing/selftests/powerpc/

without issue.

I am not configuring the kernel, only building the tests, and certainly not installing headers on the system.

Apparently this is what people aim to do, and report bugs when it does not work: build the kselftests as self-contained testsuite that relies only on standard libc, and whatever it brought in the sources.

That said, the target to install headers is headers_install, not headers. The headers target is not documented, it's probably meant to be internal to the build system. Yet it is not enforced that it is built before building the selftests.

Thanks

Michal

#3 lore raw
Quoted 24 lines · Michal Suchánek
Quoted 23 lines · Nathan Lynch
Quoted 14 lines · Michal Suchanek

Without the headers the tests don't build.

Fixes 9118c5d32bdd ("powerpc/selftests: Add test for papr-vpd")
Fixes 76b2ec3faeaa ("powerpc/selftests: Add test for papr-sysparm")
---
 tools/testing/selftests/powerpc/include/asm/papr-miscdev.h | 1 +
 tools/testing/selftests/powerpc/include/asm/papr-sysparm.h | 1 +
 tools/testing/selftests/powerpc/include/asm/papr-vpd.h     | 1 +
 3 files changed, 3 insertions(+)
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-miscdev.h
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-sysparm.h
 create mode 120000
Quoted 1 line

tools/testing/selftests/powerpc/include/asm/papr-vpd.h

I really hope making symlinks into the kernel source isn't necessary. I haven't experienced build failures with these tests. How are you building them?

I usually do something like (on a x86 build host):

Quoted 8 lines
Quoted 5 lines
$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- ppc64le_defconfig
$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- headers
$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- -C tools/testing/selftests/powerpc/

without issue.

I am not configuring the kernel, only building the tests, and certainly not installing headers on the system.

OK, but again: how do you provoke the build errors, exactly? Don't make us guess please.

Quoted 8 lines

Apparently this is what people aim to do, and report bugs when it does not work: build the kselftests as self-contained testsuite that relies only on standard libc, and whatever it brought in the sources.

That said, the target to install headers is headers_install, not headers. The headers target is not documented, it's probably meant to be internal to the build system. Yet it is not enforced that it is built before building the selftests.

<shrug> the headers target is used in Documentation/dev-tools/kselftest.rst:

"""
To build the tests::

  $ make headers
  $ make -C tools/testing/selftests
"""

This is what I've been following.

#4 lore raw
Quoted 29 lines · Nathan Lynch
Quoted 28 lines · Michal Suchánek
Quoted 27 lines · Nathan Lynch
Quoted 14 lines · Michal Suchanek

Without the headers the tests don't build.

Fixes 9118c5d32bdd ("powerpc/selftests: Add test for papr-vpd")
Fixes 76b2ec3faeaa ("powerpc/selftests: Add test for papr-sysparm")
---
 tools/testing/selftests/powerpc/include/asm/papr-miscdev.h | 1 +
 tools/testing/selftests/powerpc/include/asm/papr-sysparm.h | 1 +
 tools/testing/selftests/powerpc/include/asm/papr-vpd.h     | 1 +
 3 files changed, 3 insertions(+)
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-miscdev.h
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-sysparm.h
 create mode 120000
Quoted 1 line

tools/testing/selftests/powerpc/include/asm/papr-vpd.h

I really hope making symlinks into the kernel source isn't necessary. I haven't experienced build failures with these tests. How are you building them?

I usually do something like (on a x86 build host):

$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- ppc64le_defconfig
$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- headers
$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- -C tools/testing/selftests/powerpc/
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

without issue.

I am not configuring the kernel, only building the tests, and certainly not installing headers on the system.

OK, but again: how do you provoke the build errors, exactly? Don't make us guess please.

cd tools/testing/selftests/powerpc/

make -k

Quoted 9 lines
Quoted 8 lines

Apparently this is what people aim to do, and report bugs when it does not work: build the kselftests as self-contained testsuite that relies only on standard libc, and whatever it brought in the sources.

That said, the target to install headers is headers_install, not headers. The headers target is not documented, it's probably meant to be internal to the build system. Yet it is not enforced that it is built before building the selftests.

Quoted 8 lines

<shrug> the headers target is used in Documentation/dev-tools/kselftest.rst:

"""
To build the tests::

  $ make headers
  $ make -C tools/testing/selftests
"""

Indeed so it's not supposed to work otherwise. It would be nice if it did but might be difficult to achieve with plain makefiles.

'headers' is not in 'make help' output but whatever.

Thanks

Michal

#5 lore raw
Quoted 56 lines · Michal Suchánek
Quoted 29 lines · Nathan Lynch
Quoted 28 lines · Michal Suchánek
Quoted 27 lines · Nathan Lynch
Quoted 14 lines · Michal Suchanek

Without the headers the tests don't build.

Fixes 9118c5d32bdd ("powerpc/selftests: Add test for papr-vpd")
Fixes 76b2ec3faeaa ("powerpc/selftests: Add test for papr-sysparm")
---
 tools/testing/selftests/powerpc/include/asm/papr-miscdev.h | 1 +
 tools/testing/selftests/powerpc/include/asm/papr-sysparm.h | 1 +
 tools/testing/selftests/powerpc/include/asm/papr-vpd.h     | 1 +
 3 files changed, 3 insertions(+)
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-miscdev.h
 create mode 120000 tools/testing/selftests/powerpc/include/asm/papr-sysparm.h
 create mode 120000
Quoted 1 line

tools/testing/selftests/powerpc/include/asm/papr-vpd.h

I really hope making symlinks into the kernel source isn't necessary. I haven't experienced build failures with these tests. How are you building them?

I usually do something like (on a x86 build host):

$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- ppc64le_defconfig
$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- headers
$ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- -C tools/testing/selftests/powerpc/
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

without issue.

I am not configuring the kernel, only building the tests, and certainly not installing headers on the system.

OK, but again: how do you provoke the build errors, exactly? Don't make us guess please.

cd tools/testing/selftests/powerpc/

make -k

Quoted 14 lines
Quoted 8 lines

Apparently this is what people aim to do, and report bugs when it does not work: build the kselftests as self-contained testsuite that relies only on standard libc, and whatever it brought in the sources.

That said, the target to install headers is headers_install, not headers. The headers target is not documented, it's probably meant to be internal to the build system. Yet it is not enforced that it is built before building the selftests.

<shrug> the headers target is used in Documentation/dev-tools/kselftest.rst:

"""
To build the tests::

Quoted 6 lines
Quoted 3 lines
  $ make headers
  $ make -C tools/testing/selftests
"""

Indeed so it's not supposed to work otherwise. It would be nice if it did but might be difficult to achieve with plain makefiles.

It used to work without the headers, but at some point folks decided it was causing too many problems and building the headers was made mandatory.

Note that by default they aren't installed globally, they just end up in $KBUILD_OUTPUT/usr/include. So it shouldn't affect the host system.

cheers