Coder Social home page Coder Social logo

Comments (9)

tuna-f1sh avatar tuna-f1sh commented on July 27, 2024 2

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.

ladislas avatar ladislas commented on July 27, 2024 1

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.

ladislas avatar ladislas commented on July 27, 2024 1

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.

larsimmisch avatar larsimmisch commented on July 27, 2024

@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.

ladislas avatar ladislas commented on July 27, 2024

I have the same issue. Did not notice it before as i was overriding the flags.

from homebrew-avr.

larsimmisch avatar larsimmisch commented on July 27, 2024

@tuna-f1sh Just looked at Arduino-mk: disregard my question. $(CC) is invoked as the linker

from homebrew-avr.

larsimmisch avatar larsimmisch commented on July 27, 2024

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.

larsimmisch avatar larsimmisch commented on July 27, 2024

@ladislas yes, good idea. But we need a reproducible test case

from homebrew-avr.

ladislas avatar ladislas commented on July 27, 2024

@tuna-f1sh this is being discussed here: sudar/Arduino-Makefile#486

updating arduino-mk should fix the issue.

from homebrew-avr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.