-
Notifications
You must be signed in to change notification settings - Fork 81
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
Link Time Optimisation 6.2.0 #46
Comments
@tuna-f1sh: can you show a minimal example of the compile/link rules in your Makefile? In particular, do you use ld for linking or gcc? Note to self: I'm not sure what causes this, because |
I have the same issue. Did not notice it before as i was overriding the flags. |
@tuna-f1sh Just looked at Arduino-mk: disregard my question. |
Appears to be a bug in the compiler. The Arch package had the same problem. There is a work around but seems to be fixed in the latest avr-libc? An issue in the Arduino repository too. |
that's super interesting! :) maybe using avr-gcc 6.3.0 and Binutils 2.26.1 will fix the issue? |
The underlying issue seems to be this (arduino/Arduino#660 (comment)):
I would argue that this is a gcc bug - whatever it does, it should not segfault. Can you try compiling with In any case, this should probably be reported to gcc and it looks as if the best we can do right now is to suggest workarounds - and removing Have you got time to prepare a minimal reproduction case? |
@ladislas yes, good idea. But we need a reproducible test case |
Just tried and it doesn't work... here is my test case: https://github.com/ladislas/Bare-Arduino-Project/tree/lto-bug on branch |
@tuna-f1sh this is being discussed here: sudar/Arduino-Makefile#486 updating arduino-mk should fix the issue. |
I use homebrew-avr with Arduino-mk and have been for a while. Updating to the latest formula, I suffered a segmentation fault at the linking stage.
Doing some digging, this is due to the
-flto
flag, set by default for Arduino-mk (and presumably arduino builds) but missing from the 6.2.0 homebrew build. I'm not that well versed with the gcc compiler but Link Time Optimization (lto) seems to be merged into the latest branch and was working in the previous homebrew formulae - is there a reason it's missing from the homebrew build?One can workaround it be manually setting the C++ flags - excluding
-flto
- but it would be nice to have it working by default.Thanks.
The text was updated successfully, but these errors were encountered: