Comments (9)
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.
from homebrew-avr.
that's super interesting! :)
maybe using avr-gcc 6.3.0 and Binutils 2.26.1 will fix the issue?
https://gcc.gnu.org/gcc-6/changes.html
from homebrew-avr.
Just tried and it doesn't work...
here is my test case: https://github.com/ladislas/Bare-Arduino-Project/tree/lto-bug
on branch lto-bug
in ./src/BarProject
just run make
on OSX.
from homebrew-avr.
@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 -enable-lto
is the default according to https://gcc.gnu.org/install/configure.html. But there are some mentions that LTO is a linker plugin, so we may have to make sure the gcc lto plugin is picked up by binutils.
from homebrew-avr.
I have the same issue. Did not notice it before as i was overriding the flags.
from homebrew-avr.
@tuna-f1sh Just looked at Arduino-mk: disregard my question. $(CC)
is invoked as the linker
from homebrew-avr.
The underlying issue seems to be this (arduino/Arduino#660 (comment)):
Small update: lto build on 6.1 segfaults on libraries using virtual inheritance. Hence, adding -fno-devirtualize to c and cpp extra flags solves the segfault.
I would argue that this is a gcc bug - whatever it does, it should not segfault. Can you try compiling with -fno-devirtualize
and -flto
?
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 -flto
does work for you.
Have you got time to prepare a minimal reproduction case?
from homebrew-avr.
@ladislas yes, good idea. But we need a reproducible test case
from homebrew-avr.
@tuna-f1sh this is being discussed here: sudar/Arduino-Makefile#486
updating arduino-mk should fix the issue.
from homebrew-avr.
Related Issues (20)
- Linking with stl HOT 8
- cc1: internal compiler error: Illegal instruction: 4 HOT 3
- Default `avr-gcc` version HOT 4
- avr-gcc@9 Cannot flash on macOS Monterrey HOT 3
- Dutifully reporting error I have no understanding of HOT 2
- Support for newer MCUs HOT 4
- Push avr168pb patch to avr-libc HOT 5
- Catalina bottles not being built HOT 6
- macOS 13 HOT 3
- avr-gcc@11 fails to build HOT 10
- Error installing in MacOS 12.6
- avr-gdb fails to build on Ventura due to missing makeinfo
- Fails to find gmp during building HOT 1
- avr-gcc@12 make BOOT_LDFLAGS HOT 3
- Support for tinyAVR 1-series, megaAVR 0-series and AVR-Dx series MCUs HOT 1
- simavr1.6 Makefile bug checking for avr-gcc installation HOT 4
- Abort trap: 6 signal terminated program cc1 HOT 3
- Installation of avr-gcc@5 fails. HOT 1
- Install fails due to deps HOT 1
- Installation fails due to C++ error (?) HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebrew-avr.