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
Arduino 1.8.5 Error compiling for board ATtiny13. #53
Comments
I suspect the problem is that you're using a compiler version that doesn't support LTO but you have Tools > Compiler LTO set to "Enabled (default). Try setting that option to "Disabled". If the problem goes away then you either need to leave it disabled (which is unfortunate because you need all the optimization you can get when working with such limited memory) or upgrade to a newer version of Arduino AVR Boards. |
Yes, you are right. Can it be autoconfigured to "Disabled" if compiled doesn't support it? |
No, the Arduino IDE doesn't offer that sort of powerful configuration option for hardware packages. MCUdude does have LTO disabled by default in the other packages but I think the idea is that it's very necessary in MicroCore and most users are going to have a recent version of Arduino AVR Boards anyway so it's better to have the improved optimization as default at the cost of causing some confusion for the few people who haven't updated. I think the best we could do is to make the error less confusing. To this end, my proposal is to add the following to MicroCore's Arduino.h: #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#if defined(COMPILER_LTO) && GCC_VERSION < 40902
#error Your compiler does not support LTO. Please either upgrade Arduino AVR Boards or select Tools > Compiler LTO > Disabled.
#endif //defined(COMPILER_LTO) && GCC_VERSION < 40902 Arduino AVR Boards was updated from avr-gcc 4.8.1 to 4.9.2 at the same time the LTO support was added so the GCC version should be a reasonable indicator of LTO support. I'm not aware of an LTO plugin specific macro. This must be an What do you think of that idea @MCUdude? |
I'm using debian sid with Arduino IDE 1.8.5.
What should I update? |
Well the question is whether that is the version of avr-gcc that is actually being used. Usually the Arduino IDE will use the tools that are included with the hardware package rather than whatever is already installed on your system. You could check this by:
After the compilation finishes, check the contents of the black console window at the bottom of the Arduino IDE window. You will need to scroll up to see it all. You should see the path to the compiler tools being used (e.g. avr-g++, avr-gcc). If the problem is that your avr-gcc 5.4.0 is being used but was not built with the LTO plugin then the solution is going to be more complex than just updating Arduino AVR Boards. My helpful error message will also fail in this case. As I indicated previously, the compiler version is not the best indicator since the same error will occur even with a new compiler that does not have the plugin. Are you running the official Arduino IDE downloaded from https://www.arduino.cc/en/Main/Software or some modified nightmare from a package manager? Which version is shown for Arduino AVR Boards when you open Tools > Board > Boards Manager? |
@per1234 I think it's a good idea to add the gcc error to Arduino.h. I'm kinda busy this week, but I'll merge it if you do a PR 👍 |
4.8.1 you are right! |
For reference ec76770 |
I'm closing this issue as I assume you figured this out |
Thank you! |
I have successfully burned bootloader but can't compile simple blink example:
The text was updated successfully, but these errors were encountered: