Skip to content

link time optimization (-lto) of AVR breaks inclusion of debug info in elf file #5539

Closed
@WestfW

Description

@WestfW
Contributor

In recent versions of avr-gcc, the -g option is needed during compile in order to get enough debug information into the final elf file for things like a combined source/disassemebly (avr-objdump -SC foo.elf) to work. Now that link time optimization has been implemented, the "link" command will need the -g option as well as the individual compiles...

(It's possible that some other compile-time options also need to be moved to the link statement as well, but "-g" is the one I noticed.)

Activity

facchinm

facchinm commented on Nov 2, 2016

@facchinm
Member

Hi @WestfW ,
does it impact the size of the final hex (once the debug sections have been removed of course)? If it doesn't, I believe we could simply add the -g flag everywhere. Otherwise we'll need to provide a way to override the commandline in order to produce a debuggable elf

matthijskooijman

matthijskooijman commented on Nov 3, 2016

@matthijskooijman
Collaborator

The .hex file is unaffected, so I would encourage adding -g.

added a commit that references this issue on Nov 23, 2016
35e45c9
added a commit that references this issue on Nov 27, 2016
added this to the Release 1.6.14 milestone on Dec 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @matthijskooijman@cmaglie@WestfW@facchinm

        Issue actions

          link time optimization (-lto) of AVR breaks inclusion of debug info in elf file · Issue #5539 · arduino/Arduino