-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] ChibiOS fix O3 and LTO breakage of extra keys and joystick #12819
[Core] ChibiOS fix O3 and LTO breakage of extra keys and joystick #12819
Conversation
Empty extra key reports where send form the keyboard when O3 optimizations with LTO where enabled on GCC 10.2 (RISC-V). The root cause should be the pointer to an stack allocated report object which is invalid by the time the report is send. The fix is simple enough, the reports are allocated with a static lifetime, so pointers to them are never invalid. Joystick reports got the same treatment as the pattern is exactly the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also need to be done for LUFA & V-USB?
I'm not sure as I don't have hardware to test the changes, but giving the reports a static lifetime shouldn't hurt, so I'm applying those as well. |
What about mousekeys? |
Mouse keys worked without any problem. |
Thanks! |
Description
Empty extra key reports where send (observed with Wireshark) form the keyboard when O3 optimizations with LTO where enabled on GCC 10.2 (RISC-V). The root cause should be the pointer to an stack allocated report object which is invalid by the time the report is send. The fix is simple enough, the reports are allocated with a static lifetime, so pointers to them are never invalid. Joystick reports got the same treatment as the pattern is exactly the same.
Types of Changes
Issues Fixed or Closed by This PR
Checklist