Fix CI for CentOS 7
cover Fix CI for CentOS 7
Hi,
this is untested fix for CentOS 7. i.e. it fixes the compilation, but I haven't tested it on the actual VM (I don't have any and don't plan to do any further testing).
That brings me to the question if we still want to keep support for CentOS 7, which has kernel: 3.10, glibc: 2.17, gcc: 4.8.5 [1]. But I'll raise this question on a separate RFC thread on ML, where I Cc more people.
Kind regards,
Petr
[1] https://github.com/linux-test-project/ltp/wiki/Supported-kernel,-libc,-toolchain-versions
Petr Vorel (2):
lapi: Add uinput.h
input_helper: Fix compilation on CentOS 7
configure.ac | 1 + include/lapi/uinput.h | 15 +++++++++++++++ testcases/kernel/input/input_helper.c | 1 + 3 files changed, 17 insertions(+) create mode 100644 include/lapi/uinput.h
Signature · 5 lines
2.42.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 1/2 lapi: Add uinput.h
With the only definition UI_GET_SYSNAME, which was added in kernel 3.15, but we 3.10 (CentOS 7).
--- configure.ac | 1 + include/lapi/uinput.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 include/lapi/uinput.h
configure.ac +1 -0
@@ -67,6 +67,7 @@ AC_CHECK_HEADERS_ONCE([ \ linux/tls.h \ linux/tty.h \ linux/types.h \ + linux/uinput.h \ linux/userfaultfd.h \ netinet/sctp.h \ pthread.h \
include/lapi/uinput.h new file +15 -0
@@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* Copyright (c) 2023 Petr Vorel <[email protected]> +*/ + +#ifndef LAPI_UINPUT_H__ +#define LAPI_UINPUT_H__ + +#include <linux/uinput.h> + +#ifndef UI_GET_SYSNAME +# define UI_GET_SYSNAME (len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 44, len) +#endif + +#endif /* LAPI_UINPUT_H__ */
Signature · 5 lines
2.42.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
Hello,
Quoted 15 lines · Petr Vorel
With the only definition
UI_GET_SYSNAME, which was added in kernel 3.15, but we 3.10 (CentOS 7).Signed-off-by Petr Vorel <[email protected]>--- configure.ac | 1 + include/lapi/uinput.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 include/lapi/uinput.hconfigure.ac +0
-0
configure.ac AC_CHECK_HEADERS_ONCE([ \ · line 70
Quoted 4 lines
configure.ac +1
-0@@ -67,6 +67,7 @@ AC_CHECK_HEADERS_ONCE([ \ linux/tls.h \ linux/tty.h \ linux/types.h \ + linux/uinput.h \
Do we use this?
Quoted 24 lines
configure.ac +0
-0linux/userfaultfd.h \ netinet/sctp.h \ pthread.h \include/lapi/uinput.h new file +15
-0@@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* Copyright (c) 2023 Petr Vorel <[email protected]> +*/ + +#ifndef LAPI_UINPUT_H__ +#define LAPI_UINPUT_H__ + +#include <linux/uinput.h> + +#ifndef UI_GET_SYSNAME +# define UI_GET_SYSNAME (len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 44, len) +#endif + +#endif /* LAPI_UINPUT_H__ */
Signature · 5 lines
Thank you, Richard. -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
Hi Richie,
Quoted 8 lines
configure.ac AC_CHECK_HEADERS_ONCE([ \ · line 70
Quoted 6 lines
+++ b/configure.ac
configure.ac +1
-0@@ -67,6 +67,7 @@ AC_CHECK_HEADERS_ONCE([ \ linux/tls.h \ linux/tty.h \ linux/types.h \ + linux/uinput.h \Do we use this?
Yes, see below.
Quoted 10 lines
Quoted 10 lines
configure.ac +0
-0linux/userfaultfd.h \ netinet/sctp.h \ pthread.h \include/lapi/uinput.h new file +1
-0@@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-or-later
Quoted 8 lines
include/lapi/uinput.h line 9
Quoted 8 lines
include/lapi/uinput.h new file +8
-0+/* +* Copyright (c) 2023 Petr Vorel <[email protected]> +*/ + +#ifndef LAPI_UINPUT_H__ +#define LAPI_UINPUT_H__ + +#include <linux/uinput.h>
Here. We have policy, that we first load the header and then check for a fallback.
Kind regards,
Petr
Quoted 6 lines
Quoted 6 lines
include/lapi/uinput.h new file +6
-0+ +#ifndef UI_GET_SYSNAME +# define UI_GET_SYSNAME (len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 44, len) +#endif + +#endif /* LAPI_UINPUT_H__ */
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
Hi!
Quoted 9 lines
Quoted 8 lines
configure.ac AC_CHECK_HEADERS_ONCE([ \ · line 70
Quoted 6 lines
+++ b/configure.ac
configure.ac +1
-0@@ -67,6 +67,7 @@ AC_CHECK_HEADERS_ONCE([ \ linux/tls.h \ linux/tty.h \ linux/types.h \ + linux/uinput.h \Do we use this?
Yes, see below.
Ritchie probably means the macro HAVE_LINUX_UINPUT_H that is generated by this, and no we do not use that, we include <linux/uinput.h> unconditionally.
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
Quoted 9 lines
Hi!
Quoted 8 lines
Quoted 8 lines
configure.ac AC_CHECK_HEADERS_ONCE([ \ · line 70
Quoted 6 lines
+++ b/configure.ac
configure.ac +1
-0@@ -67,6 +67,7 @@ AC_CHECK_HEADERS_ONCE([ \ linux/tls.h \ linux/tty.h \ linux/types.h \ + linux/uinput.h \Do we use this?
Quoted 5 lines
Quoted 1 line
Yes, see below.
Ritchie probably means the macro
HAVE_LINUX_UINPUT_Hthat is generated by this, and no we do not use that, we include <linux/uinput.h> unconditionally.
Ah, thank you. This is obviously missing.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
Hi!
Quoted 1 line
Ah, thank you. This is obviously missing.
I do not think that it's needed at all, the uinput header has been in there for more than decade.
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
Quoted 5 lines
Hi!
Quoted 1 line
Ah, thank you. This is obviously missing.
I do not think that it's needed at all, the uinput header has been in there for more than decade.
Thank you for spotting trivial error. I only checked up to UAPI introduction v3.7-rc1 (but we already raised the support to 3.10). More importantly include/linux/uinput.h existed since git history (2.6.12-rc2).
I'll remove check in v2.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
In reply to Petr VorelHello,
Quoted 24 lines · Petr Vorel
Hi Richie,
Quoted 8 lines
configure.ac AC_CHECK_HEADERS_ONCE([ \ · line 70
Quoted 6 lines
+++ b/configure.ac
configure.ac +1
-0@@ -67,6 +67,7 @@ AC_CHECK_HEADERS_ONCE([ \ linux/tls.h \ linux/tty.h \ linux/types.h \ + linux/uinput.h \Do we use this?
Yes, see below.
Quoted 12 lines
Quoted 12 lines
configure.ac +0
-0linux/userfaultfd.h \ netinet/sctp.h \ pthread.h \include/lapi/uinput.h new file +3
-0@@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* Copyright (c) 2023 Petr Vorel <[email protected]>
Quoted 8 lines
Quoted 6 lines
include/lapi/uinput.h line 9
Quoted 6 lines
include/lapi/uinput.h new file +6
-0+*/ + +#ifndef LAPI_UINPUT_H__ +#define LAPI_UINPUT_H__ + +#include <linux/uinput.h> Here. We have policy, that we first load the header and then check for a fallback.
But we don't check if the header exists with HAVE_LINUX_UINPUT_H before loading it?
Quoted 10 lines
Kind regards,
PetrQuoted 6 lines
Quoted 6 lines
include/lapi/uinput.h new file +6
-0+ +#ifndef UI_GET_SYSNAME +# define UI_GET_SYSNAME (len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 44, len) +#endif + +#endif /* LAPI_UINPUT_H__ */
Signature · 5 lines
Thank you, Richard. -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 2/2 input_helper: Fix compilation on CentOS 7
In reply to Petr VorelInclude lapi/uinput.h to fix compilation on CentOS 7
(the oldest distro in our CI). The actual functionality of the test was not tested.
--- testcases/kernel/input/input_helper.c | 1 + 1 file changed, 1 insertion(+)
testcases/kernel/input/input_helper.c +1 -0
@@ -25,6 +25,7 @@#include "test.h" #include "safe_macros.h" #include "input_helper.h" +#include "lapi/uinput.h" #define VIRTUAL_DEVICE "virtual-device-ltp"
Signature · 5 lines
2.42.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp