public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97574] New: Allow for nul output with Windows
@ 2020-10-25 22:56 svnpenn at gmail dot com
  2020-10-26  9:48 ` [Bug driver/97574] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: svnpenn at gmail dot com @ 2020-10-25 22:56 UTC (permalink / raw)
  To: gcc-bugs

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

            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 tried
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 command
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 truncated

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

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

end of thread, other threads:[~2023-01-18 13:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-25 22:56 [Bug c++/97574] New: Allow for nul output with Windows svnpenn at gmail dot com
2020-10-26  9:48 ` [Bug driver/97574] " redi at gcc dot gnu.org
2020-10-26  9:54 ` tnfchris at gcc dot gnu.org
2020-10-26 10:09 ` redi at gcc dot gnu.org
2020-10-27 22:04 ` tnfchris at gcc dot gnu.org
2020-11-17 10:15 ` cvs-commit at gcc dot gnu.org
2023-01-18 13:40 ` tnfchris 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).