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

Compiling split keyboards with LTO enabled does not work in MacOS #7857

Closed
ZNielsen opened this issue Jan 10, 2020 · 6 comments
Closed

Compiling split keyboards with LTO enabled does not work in MacOS #7857

ZNielsen opened this issue Jan 10, 2020 · 6 comments

Comments

@ZNielsen
Copy link
Contributor

ZNielsen commented Jan 10, 2020

I use a multitude of split keyboards (lily58, crkbd, and a custom hand wired split board). I recently picked up a Mac and I discovered that when compiling, all will go smoothly, but the programmed keyboard does not function properly; the non-usb half is unresponsive. Compiling the same code on Windows Subsystem for Linux (WSL) works just fine. A cursory google search didn't turn up anything.

Information about systems:

  • MacOS:
    • OS Version: 10.15.2 (Catalina)
    • avr-gcc version: 8.3.0
    • QMK Version: 0.7.106
  • Windows:
    • OS Version: Windows 10
    • avr-gcc version: 5.4.0
    • QMK Version: 0.7.106 (same commit as MacOS)

Some tests I did:

  • I transferred the .hex file from WSL to MacOS. Using the QMK_TOOLBOX to flash the WSL compiled hex on MacOS worked fine. This leads me to believe it is a compilation problem, not a flashing problem.
  • I compared the .hex files from WSL and MacOS. They are very different. I'm not sure if that's expected due to platform/compiler differences.
  • The problem exists over all the split boards I have. My custom board uses serial, while the lily58 uses I2C (I think?), so I think this problem exists with both communication methods.

Has this been encountered by anybody else? Any ideas on a fix?

Thanks!

@bcat
Copy link
Contributor

bcat commented Jan 11, 2020

I wonder if this is a more general problem with avr-gcc 8.3.0. I'm got a (more recent?) install of QMK on MSYS with that avr-gcc version, and after I just updated master and reflashed my Lily58, I have the same problem of the slave side not responding. I'll try and debug further.

@bcat
Copy link
Contributor

bcat commented Jan 11, 2020

Turning off LINK_TIME_OPTIMIZATION_ENABLE in my rules.mk seems to the fix the problem. Some combination of LTO and 8.3.0 seems to be making my Lily58 slave side nonfunctional. I wonder if your problem is the same, and Windows vs. Mac is a red herring.

@bcat
Copy link
Contributor

bcat commented Jan 11, 2020

@ZNielsen, are you perchange using LTO? If so, can you please patch in #7868 and see if it fixes this for you? (Though I'm not positive your problem is not unrelated, since you mentioned the crkbd, and that keeb seems to work for me with LTO enabled on latest master.)

@ZNielsen
Copy link
Contributor Author

I do believe I’m using link time optimization. I’ll give that a try on the boards I have at home. I can test the lily58 on Monday.

@ZNielsen
Copy link
Contributor Author

I was able to confirm that LTO was the problem. Compiling and flashing without LTO, the lily58 behaved as expected. Patching in 08cd99683 (#7868) fixed the problem with LTO enabled.

Should I change the title of this issue to make it more searchable?

@tzarc tzarc changed the title Compiling split keyboards does not work in MacOS Compiling split keyboards with LTO enabled does not work in MacOS Feb 24, 2020
@tzarc
Copy link
Member

tzarc commented Feb 24, 2020

Modified the title, closed it off as solved.

@tzarc tzarc closed this as completed Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants