From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 169653857C62; Sun, 25 Oct 2020 22:56:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 169653857C62 From: "svnpenn at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97574] New: Allow for nul output with Windows Date: Sun, 25 Oct 2020 22:56:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: svnpenn 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 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2020 22:56:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97574 Bug ID: 97574 Summary: Allow for nul output with Windows Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: svnpenn at gmail dot com Target Milestone: --- Allow for nul output with Windows A project I am trying to compile has this command: cc -xc++ -o/dev/null -lc++ -shared However I am using PowerShell, which has no notion of `/dev/null`: PS C:\> cc -xc++ -o/dev/null -lc++ -shared C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../ x86_64-w64-mingw32/bin/ld.exe: cannot open output file /dev/null.exe: No such file or directory I tried using `-o$null`, but it just creates a file `$null.exe`. I also tri= ed this: PS C:\> cc -xc++ -o $null -lc++ -shared cc.exe: fatal error: no input files It appears the issue is specific to GCC. If I get Clang [1], the same comma= nd works with `nul` [2]: cc -xc++ -onul -lc++ -shared but if I try the same thing with GCC, I get this: C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../ x86_64-w64-mingw32/bin/ld.exe: nul.exe: final close failed: file trunca= ted Alternatively, if anyone knows a better way to check the availability of a library, I would be interested in that. [1] https://github.com/mstorsjo/llvm-mingw [2] https://support.microsoft.com/help/110930=