Skip to content

Linker error with version 2.7.1 for STM32 Nucleo F446RE #2244

Description

@npalix

The error is

arm-none-eabi-g++: warning: {compiler.optimization_flags}: linker input file unused because linking not done
arm-none-eabi-g++: error: {compiler.optimization_flags}: linker input file not found: No such file or directory

The issue comes from the platform file.

compiler.optimization_flags={compiler.optimization_flags}

Setting the line to compiler.optimization_flags={build.flags.optimize} fixes the issue.

Activity

  1. fpistm commented on Jan 8, 2024

    @fpistm
    Member

    Hi @npalix
    First happy new year.

    There is no error on my side to build (and link) for the Nucleo F446RE. Moreover, the issue you point will simply impact all target which is not the case.
    So you probably have an issue on your environment but you do not provide any information as requested by the issue template.

  2. npalix commented on Jan 8, 2024

    @npalix
    Author

    Describe the bug
    While compiling for any board the Blink example, I got the following error :

    arm-none-eabi-g++: warning: {compiler.optimization_flags}: linker input file unused because linking not done
    arm-none-eabi-g++: error: {compiler.optimization_flags}: linker input file not found: No such file or directory
    
    

    The issue seems to come from the platform file.

    compiler.optimization_flags={compiler.optimization_flags}

    Setting the line to compiler.optimization_flags={build.flags.optimize} fixes the issue.

    To Reproduce

    1. Install following the instruction of https://github.com/stm32duino/Arduino_Core_STM32/wiki/Getting-Started
    2. Load the Blink example
    3. Compile

    Expected behavior
    Build binary for the current board

    Screenshots
    Screenshot from 2024-01-08 14-55-38

    Desktop (please complete the following information):

    • OS: Linux
    • Arduino IDE version: 1.8.19
    • STM32 core version: 2.7.1
    • Tools menu settings if not the default: default values

    Board (please complete the following information):

    • Name: Nucleo F449RE

    Additional context
    I tried to remove and reinstall STM32Core.

  3. fpistm commented on Jan 8, 2024

    @fpistm
    Member

    As stated not reproduced:
    Untitled

    Your logs seems weird because the arm none eabi binary has no full path.
    Unfortunately, I can't help on this, maybe an Arduino IDE issue, you should try to remove all cache files and start from fresh install.

  4. npalix commented on Jan 8, 2024

    @npalix
    Author

    The path is right with verbose mode (same place as in your screenshot). But it isn't prepended for warning/error messages (I guess g++ behavior).

    Can you provide information on how the flag is setup ?
    It sounds odd for me to define it by itself and there is an experimental warning the line before.
    compiler.optimization_flags={compiler.optimization_flags}

    My understanding is that the "{compiler.optimization_flags}" is not properly expanded and g++ interpretes it as a filename.

    Moreover, the "optimize" value (-Ox) doesn't show up in the compilation command.

  5. npalix commented on Jan 8, 2024

    @npalix
    Author

    Working fine with Arduino IDE 2.0.3.

  6. reopened this on Jan 8, 2024
  7. added
    bug 🐛Something isn't working
    and removed
    invalidThis doesn't seem right
    on Jan 9, 2024
  8. added a commit that references this issue on Jan 9, 2024
    9af0012
  9. fpistm commented on Jan 9, 2024

    @fpistm
    Member

    Can you provide information on how the flag is setup ?
    It sounds odd for me to define it by itself and there is an experimental warning the line before.
    compiler.optimization_flags={compiler.optimization_flags}

    @npalix You are right, the line is not correct. I've made a fix even if I can't reproduced (don't know why). This change make sense.
    Thanks for your support.If you are able to test.
    Note for the Arduino IDE 2.x, the impacted line is not used as only those one are used:
    https://github.com/stm32duino/Arduino_Core_STM32/blob/2c45eba88a36cf95299ec44efe91ecb215fe06e4/platform.txt#L23C1-L24C41

    depending of the Sketch -> Optimize for Debugging menu selection
    image

  10. added this to the 2.8.0 milestone on Jan 9, 2024
  11. added a commit that references this issue on Jan 9, 2024
    6e61906
  12. added a commit that references this issue on Apr 23, 2024
    850e7ac
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

    bug 🐛Something isn't working

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions