Skip to content

Parallel LTO builds might fail due to missing make.exe in release packages #12

@nmlgc

Description

@nmlgc

When linking with -flto=auto, lto-wrapper tries to parallelize the LTO step by creating a temporary .mk file and running it with the first make it can find on the PATH. Since mingw-lite doesn't bundle make.exe itself, this might end up running an incompatible Make that might cause the build to fail with an issue like

$ gcc -flto=auto empty_main.c
C:/path/to/mingw32_486-msvcrt_win98-15/bin/../lib/gcc/i686-w64-mingw32/15/../../../..//bin/ld.exe: cannot find C:\Windows\Temp\ccqFjR3S.ltrans0.ltrans.o: No such file or directory

The easy solution of just copying mingw32-make.exe to make.exe in the archives might create other problems because users might expect the regular make to behave in a non-MinGW way. Patching lto-wrapper to explicitly call mingw32-make instead of make is probably the better fix; the temporary .mk files use backslashed Windows paths and therefore already expect the MinGW Make behavior:

C:\Windows\Temp\cceuoulK.ltrans0.ltrans.o:
        @g++  '-xlto' '-c' '-fno-openmp' '-fno-openacc' '-fno-pie' '-fcf-protection=none' '-mtune=generic' '-march=i486' '-static-libgcc' '-mtune=generic' '-march=i486' '-dumpdir' 'a.' '-dumpbase' './a.ltrans0.ltrans' '-fltrans' '-o' 'C:\Windows\Temp\cceuoulK.ltrans0.ltrans.o' 'C:\Windows\Temp\cceuoulK.ltrans0.o' -truncate 'C:\Windows\Temp\cceuoulK.ltrans0.o'
.PHONY: all
all: \
        C:\Windows\Temp\cceuoulK.ltrans0.ltrans.o

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions