Skip to content

Windows builds fail with LTO in some (slow) machines #1038

@carlescufi

Description

@carlescufi

We are seeing the following:

west build -b nrf54l15dk/nrf54l15/cpuapp samples\hello_world -- -DCONFIG_LTO=y -DCONFIG_ISR_TABLES_LOCAL_DECLARATION=y
[snip]
zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: cannot find C:\Users\...\AppData\Local\Temp\ccqKSDAR.ltrans0.ltrans.o: No such file or directory
zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: cannot find C:\Users\...\AppData\Local\Temp\ccqKSDAR.ltrans1.ltrans.o: No such file or directory

Changing all instances of -flto=auto to -flto=1 fixes the issue, so this is clearly a multithreading issue.
Also, this does not happen with GNU Arm Embedded, so perhaps we should take a look at how things are compiled there.

There's some precedent here:
Nuitka/Nuitka#1768 (comment)

@stephanosio I see that there's a difference between building the toolchain with win32-threads or posix-threads, which one do we use currently?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions