Skip to content
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

Added workaround for serial.c issue when LTO_ENABLE=yes for the Helix. #7558

Merged
merged 1 commit into from
Dec 8, 2019

Conversation

mtei
Copy link
Contributor

@mtei mtei commented Dec 7, 2019

Description

helix-serial.c is sensitive to execution timing and will not work as expected when compiled with the -flto option. As a result, if Helix is compiled with LTO_ENABLE = yes, the key input on the slave side will not be performed correctly.

In particular, helix:xulkal is always set to LTO_ENABLE = yes, so key input on the slave side is not possible.

To solve this problem, #7089 suggests a general way to specify the -fno-lto option, but it still doesn't merge after a month and a half.

This PR adds a temporary workaround to helix/rev2 and helix/pico until #7089 is merged.

What happens with this PR:

  • When LTO_ENABLE = no.
    All helix/rev2 and helix/pico keymap compilation results will not change. Therefore, there is no adverse effect.
  • When LTO_ENABLE = yes.
    This PR ensures that all helix/rev2 and helix/pico keymaps work correctly. All keymaps have been checked for operation.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@mtei mtei changed the title Added workaround for sirial.c issue when LTE_ENABLE=yes for the Helix. Added workaround for sirial.c issue when LTO_ENABLE=yes for the Helix. Dec 7, 2019
@mtei mtei changed the title Added workaround for sirial.c issue when LTO_ENABLE=yes for the Helix. Added workaround for serial.c issue when LTO_ENABLE=yes for the Helix. Dec 7, 2019
@zvecr zvecr added the keyboard label Dec 7, 2019
Copy link
Member

@zvecr zvecr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does SRC += local_drivers/serial.c not need to be removed?

I see the following when compiling:

Compiling: keyboards/helix/local_drivers/serial.c                                                   [OK]
...
Archiving: .build/obj_helix_pico_back_default/local_drivers/serial.o                                [OK]

doesnt seem to affect end results, so just a compile speed issue i guess.

@zvecr zvecr requested a review from a team December 7, 2019 13:21
@mtei
Copy link
Contributor Author

mtei commented Dec 7, 2019

Don't worry. There is no problem.

I didn't change SRC += local_drivers/serial.c because I didn't want to change the build result. This also means that you can simply delete LIB_SRC += local_drivers/serial.c when the workaround is no longer needed.

The addition of LIB_SRC += local_drivers/serial.c will take time to store serial.o in serial.a, but it is not a problem because it is very short. Also, since serial.c is compiled only once, it does not increase compilation time.

@drashna drashna merged commit 722c196 into qmk:master Dec 8, 2019
@mtei mtei deleted the helix_lto_probrem_workaround branch December 8, 2019 11:27
patrl pushed a commit to patrl/qmk_firmware that referenced this pull request Dec 29, 2019
zvecr pushed a commit that referenced this pull request Jan 12, 2020
This code is timing sensitive and seems to break with LTO enabled (at
least on avr-gcc 8.3.0... it worked on older gcc versions).

This is the same workaround as #7558 applied for the Helix.
calmh added a commit to calmh/qmk_firmware that referenced this pull request Jan 17, 2020
* upstream/master: (1960 commits)
  [Keyboard] Think6.5 Default Keymap Cleanup (qmk#7594)
  [Keyboard] update m12og keymap to readable version (qmk#7581)
  [Keyboard] Add cKeys Washington keyboard (qmk#7570)
  [Keyboard] Fix 2U backspace key in ansi_blocker layout for GrayStudio Space65 keyboard (qmk#7593)
  [Keyboard] Remove `PREVENT_STUCK_MODIFIERS` from config.h files (qmk#7592)
  [Keyboard] update default h87a keymap for fn functionality (qmk#7589)
  [Keymap] ergotravel updates (qmk#7588)
  [Keyboard] Adjust ColorLice to work with QMK configurator (qmk#7572)
  [Keyboard] Adding Navi10 macropad (qmk#7556)
  Enable bitbang ws2812 for f4 (qmk#7571)
  [Keyboard] add Matrix 8XV1.2 og ISO/ANSI keyboard (qmk#7567)
  Also fix flash
  Fix compiling json files
  Add JSON keymap to prereq list of C keymap
  [Keyboard] instant60: Enable bootmagic lite to make eeprom reset easier (qmk#7566)
  Updated slave encoder sync to reduce dropped pulses - v2 (qmk#7505)
  [Keyboard] rebuild info.json for ep tf_longeboye (qmk#7560)
  [Keyboard] Added workaround for serial.c/LTO issue for helix/rev2 and helix/pico. (qmk#7558)
  [Keyboard] EP96: fix info.json key sequence (qmk#7557)
  [Keymap] Added my customized 40% layout (qmk#7555)
  ...
HokieGeek pushed a commit to HokieGeek/qmk_firmware that referenced this pull request Feb 21, 2020
HokieGeek pushed a commit to HokieGeek/qmk_firmware that referenced this pull request Feb 21, 2020
This code is timing sensitive and seems to break with LTO enabled (at
least on avr-gcc 8.3.0... it worked on older gcc versions).

This is the same workaround as qmk#7558 applied for the Helix.
kylekuj pushed a commit to kylekuj/qmk_firmware that referenced this pull request Apr 21, 2020
This code is timing sensitive and seems to break with LTO enabled (at
least on avr-gcc 8.3.0... it worked on older gcc versions).

This is the same workaround as qmk#7558 applied for the Helix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants