open-vm-tools icon indicating copy to clipboard operation
open-vm-tools copied to clipboard

services/plugins/dndcp/fakeMouseWayland: add time64 support

Open zv-io opened this issue 1 year ago • 7 comments

Linux Kernel commit 152194fe9c3f03232b9c0d0264793a7fa4af82f8 changed struct input_event on 32-bit systems.

See also: https://git.adelielinux.org/adelie/packages/-/issues/1210

zv-io avatar Jun 11 '24 15:06 zv-io

@zv-io, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

vmwclabot avatar Jun 11 '24 15:06 vmwclabot

@zv-io, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

vmwclabot avatar Jun 11 '24 15:06 vmwclabot

@zv-io, VMware has rejected your signed contributor license agreement. The merge can not proceed until the agreement has been resigned. Click here to resign the agreement. Reject reason:

Please complete all fields .e.g. address

vmwclabot avatar Jun 11 '24 23:06 vmwclabot

@zv-io, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

vmwclabot avatar Jun 14 '24 13:06 vmwclabot

@zv-io, I am curious. Which Linux release / version did you run into this issue?

johnwvmw avatar Jun 14 '24 14:06 johnwvmw

@johnwvmw we are Adélie Linux which is a lightweight Linux distro based on musl libc. In attempting to build open-vm-tools for our 32-bit x86 target, we encountered an error because of this Linux commit.

diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
index 8c5a0bf6ee3520..7288a7c573ccd9 100644
--- a/[include/uapi/linux/input.h](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/input.h?id=eca3be9b95ac7cf9442654a54962859d74f8e38a)
+++ b/[include/uapi/linux/input.h](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/input.h?id=152194fe9c3f03232b9c0d0264793a7fa4af82f8)
@@ -21,10 +21,21 @@
 
 /*
  * The event structure itself
+ * Note that __USE_TIME_BITS64 is defined by libc based on
+ * application's request to use 64 bit time_t.
  */
 
 struct input_event {
+#if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)) && !defined(__KERNEL)
 	struct timeval time;
+#define input_event_sec time.tv_sec
+#define input_event_usec time.tv_usec
+#else
+	__kernel_ulong_t __sec;
+	__kernel_ulong_t __usec;
+#define input_event_sec  __sec
+#define input_event_usec __usec
+#endif
 	__u16 type;
 	__u16 code;
 	__s32 value;

We define __USE_TIME_BITS64, so struct timeval time does not exist as a member of the struct input_event structure, hence the compilation failure.

We are using linux-headers-5.15.132 at the moment.

Please let me know if you need additional information or an environment to test in.

zv-io avatar Jun 14 '24 19:06 zv-io

@zv-io, VMware has approved your signed contributor license agreement.

vmwclabot avatar Sep 09 '24 19:09 vmwclabot