public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/110710] New: LTO linker on Windows creates an invalid Makefile
@ 2023-07-18  6:14 cz.finn.cz at gmail dot com
  2023-07-18  6:18 ` [Bug lto/110710] " pinskia at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: cz.finn.cz at gmail dot com @ 2023-07-18  6:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110710

            Bug ID: 110710
           Summary: LTO linker on Windows creates an invalid Makefile
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cz.finn.cz at gmail dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

In MS/Windows, when linking an executable file in a single thread (-flto=1),
the linker issues a warning:

lto-wrapper.exe: warning: using serial compilation of 2 LTRANS jobs
lto-wrapper.exe: note: see the '-flto' option documentation for more
information

When linking using -flto=auto, a temporary makefile is created in a %TEMP%
directory. This makefile contains something like this:

C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans0.ltrans.o:
        @arm-none-eabi-gcc  '-xlto' '-c' '-fno-openmp' '-fno-openacc'
'-fno-pie' '-fcf-protection=none' '-mcpu=cortex-r5' '-mfloat-abi=hard'
'-mfpu=vfpv3-d16' '-mbig-endian' '-mthumb' '-mthumb-interwork'
'-mlibarch=armv7-r+fp+idiv' '-march=armv7-r+fp+idiv' '-O2' '-mcpu=cortex-r5'
'-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mbig-endian' '-mthumb'
'-mthumb-interwork' '-g' '-nostartfiles' '-gdwarf-2' '-O2'
'-falign-functions=8' '-mbe32' '-L' 'build/release' '-mlibarch=armv7-r+fp+idiv'
'-march=armv7-r+fp+idiv' '-dumpdir'
'dist/release/CA002734_2QC_1.0.0_20230714.elf.' '-dumpbase'
'dist/release/CA002734_2QC_1.0.0_20230714.elf.ltrans0.ltrans' '-fltrans' '-o'
'C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans0.ltrans.o'
'C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans0.o'
        @-touch -r C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans0.o
C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans0.o.tem > /dev/null 2>&1 &&
mv C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans0.o.tem
C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans0.o
C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans1.ltrans.o:
        @arm-none-eabi-gcc  '-xlto' '-c' '-fno-openmp' '-fno-openacc'
'-fno-pie' '-fcf-protection=none' '-mcpu=cortex-r5' '-mfloat-abi=hard'
'-mfpu=vfpv3-d16' '-mbig-endian' '-mthumb' '-mthumb-interwork'
'-mlibarch=armv7-r+fp+idiv' '-march=armv7-r+fp+idiv' '-O2' '-mcpu=cortex-r5'
'-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mbig-endian' '-mthumb'
'-mthumb-interwork' '-g' '-nostartfiles' '-gdwarf-2' '-O2'
'-falign-functions=8' '-mbe32' '-L' 'build/release' '-mlibarch=armv7-r+fp+idiv'
'-march=armv7-r+fp+idiv' '-dumpdir'
'dist/release/CA002734_2QC_1.0.0_20230714.elf.' '-dumpbase'
'dist/release/CA002734_2QC_1.0.0_20230714.elf.ltrans1.ltrans' '-fltrans' '-o'
'C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans1.ltrans.o'
'C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans1.o'
        @-touch -r C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans1.o
C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans1.o.tem > /dev/null 2>&1 &&
mv C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans1.o.tem
C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans1.o
.PHONY: all
all: \
        C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans0.ltrans.o \
        C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans1.ltrans.o

This file contains constructions, which obviously cannot work in Windows SHELL,
such as redirection to /dev/null, using of tools/commands, which generally may
not be available (mv, touch). As a result, the make execution fails, and the
top-level make issues errors, such as

The system cannot find the file specified.
make[2]: [C:\Users\K.GOTT\AppData\Local\Temp\1\ccxCkgV8.mk:6:
C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans1.ltrans.o] Error 1
(ignored)
The system cannot find the file specified.
make[2]: [C:\Users\K.GOTT\AppData\Local\Temp\1\ccxCkgV8.mk:3:
C:\Users\K.GOTT\AppData\Local\Temp\1\cc071ciG.ltrans0.ltrans.o] Error 1
(ignored)

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-05-02 10:43 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-18  6:14 [Bug lto/110710] New: LTO linker on Windows creates an invalid Makefile cz.finn.cz at gmail dot com
2023-07-18  6:18 ` [Bug lto/110710] " pinskia at gcc dot gnu.org
2023-07-18  6:22 ` pinskia at gcc dot gnu.org
2023-07-18  6:34 ` cz.finn.cz at gmail dot com
2023-07-18  6:39 ` pinskia at gcc dot gnu.org
2023-07-18  9:13 ` cz.finn.cz at gmail dot com
2024-02-13  2:16 ` amy at amyspark dot me
2024-03-14 16:13 ` peter0x44 at disroot dot org
2024-03-14 16:15 ` peter0x44 at disroot dot org
2024-03-14 16:15 ` peter0x44 at disroot dot org
2024-03-14 16:25 ` peter0x44 at disroot dot org
2024-03-15 14:49 ` peter0x44 at disroot dot org
2024-03-26 20:37 ` peter0x44 at disroot dot org
2024-03-26 22:45 ` peter0x44 at disroot dot org
2024-03-29 11:11 ` egallager at gcc dot gnu.org
2024-05-02 10:42 ` cvs-commit at gcc dot gnu.org
2024-05-02 10:43 ` cvs-commit at gcc dot gnu.org
2024-05-02 10:43 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).