From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 633723858D20; Tue, 18 Jul 2023 06:14:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 633723858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689660843; bh=kl2lRlgTY+TISA9s7acqHGZLe45/3psAMIqRrC4dI60=; h=From:To:Subject:Date:From; b=QKgkDowuCnsH/YKzHm89vzKMFCKZrP5St4v8JW/j33qtZhmw+cv1hgsZ828vtEOci 8BfHYDSalhuE675uas5uBihGlz8ApFsGZb0vPXIwxpC+oNiYHdY48mexHLn9Dt2gQK 44bEied9jsZ5er8fawGGJXC2QjnEm1TjOlATvrC8= From: "cz.finn.cz at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/110710] New: LTO linker on Windows creates an invalid Makefile Date: Tue, 18 Jul 2023 06:14:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cz.finn.cz at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110710 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=3D= 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=3Dauto, 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=3Dnone' '-mcpu=3Dcortex-r5' '-mfloat-abi=3Dhard' '-mfpu=3Dvfpv3-d16' '-mbig-endian' '-mthumb' '-mthumb-interwork' '-mlibarch=3Darmv7-r+fp+idiv' '-march=3Darmv7-r+fp+idiv' '-O2' '-mcpu=3Dcor= tex-r5' '-mfloat-abi=3Dhard' '-mfpu=3Dvfpv3-d16' '-mbig-endian' '-mthumb' '-mthumb-interwork' '-g' '-nostartfiles' '-gdwarf-2' '-O2' '-falign-functions=3D8' '-mbe32' '-L' 'build/release' '-mlibarch=3Darmv7-r+= fp+idiv' '-march=3Darmv7-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=3Dnone' '-mcpu=3Dcortex-r5' '-mfloat-abi=3Dhard' '-mfpu=3Dvfpv3-d16' '-mbig-endian' '-mthumb' '-mthumb-interwork' '-mlibarch=3Darmv7-r+fp+idiv' '-march=3Darmv7-r+fp+idiv' '-O2' '-mcpu=3Dcor= tex-r5' '-mfloat-abi=3Dhard' '-mfpu=3Dvfpv3-d16' '-mbig-endian' '-mthumb' '-mthumb-interwork' '-g' '-nostartfiles' '-gdwarf-2' '-O2' '-falign-functions=3D8' '-mbe32' '-L' 'build/release' '-mlibarch=3Darmv7-r+= fp+idiv' '-march=3Darmv7-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 SH= ELL, 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)=