[Bug c++/106728] New: Cannot Compile EXE on Shared Network Drive (Windows, MinGW)

johntravolski1 at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Aug 24 06:09:47 GMT 2022


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

            Bug ID: 106728
           Summary: Cannot Compile EXE on Shared Network Drive (Windows,
                    MinGW)
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johntravolski1 at gmail dot com
  Target Milestone: ---

If I compile with:

g++ -std=c++11 iterate.cpp -o "\\machine_name\d\performance testing\out.exe"

I get this output and no .exe file:

c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
cannot open output file \\machine_name\d\performance testing\out.exe: Invalid
argument collect2.exe: error: ld returned 1 exit status

If I change the output path to a system drive rather than one on the network,
it compiles fine. It gives the same error if I use a local, rather than
absolute, path as well (and have the working directory on the network drive [my
working directory can be a UNC path in PowerShell]).

Unfortunately, mapping to a drive letter also does not work:

g++ -std=c++11 iterate.cpp -o "Z:\28sec\out.exe"

gives

c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
cannot open output file Z:\28sec\out.exe: No such file or directory
collect2.exe: error: ld returned 1 exit status

I am not sure if this is relevant, but I have a much older version of MinGW
from Winbuilds (I installed from win-builds-1.5.0.exe sometime back in 2018),
and it is able to output the compiled exe directly to network drives just fine.

Here's the gcc version info of the version with the issue:

gcc.exe -v
Using built-in specs.
COLLECT_GCC=C:\MinGW64_cpp17\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw64_cpp17/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-w64-mingw32
Configured with: ../configure
--prefix=/r/winlibs64_stage/11532.gcc/inst_gcc-12.2.0/share/gcc
--build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32
--enable-offload-targets=nvptx-none --with-pkgversion='MinGW-W64
x86_64-msvcrt-posix-seh, built by Brecht Sanders' --with-tune=generic
--enable-checking=release --enable-threads=posix --disable-sjlj-exceptions
--disable-libunwind-exceptions --disable-serial-configure --disable-bootstrap
--enable-host-shared --enable-plugin --disable-default-ssp --disable-rpath
--disable-libstdcxx-debug --disable-version-specific-runtime-libs --with-stabs
--disable-symvers --enable-languages=c,c++,fortran,lto,objc,obj-c++,jit
--disable-gold --disable-nls --disable-stage1-checking --disable-win32-registry
--disable-multilib --enable-ld --enable-libquadmath --enable-libada
--enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string
--enable-libgomp --enable-graphite --enable-mingw-wildcard
--enable-libstdcxx-time --disable-libstdcxx-pch
--with-mpc=/d/Prog/winlibs64_stage/custombuilt
--with-mpfr=/d/Prog/winlibs64_stage/custombuilt
--with-gmp=/d/Prog/winlibs64_stage/custombuilt
--with-isl=/d/Prog/winlibs64_stage/custombuilt --enable-libstdcxx-backtrace
--enable-install-libiberty --enable-__cxa_atexit --without-included-gettext
--with-diagnostics-color=auto --enable-clocale=generic --with-libiconv
--with-system-zlib
--with-build-sysroot=/r/winlibs64_stage/11532.gcc/gcc-12.2.0/build_mingw/mingw-w64
CFLAGS='-I/d/Prog/winlibs64_stage/custombuilt/include/libdl-win32
-D__USE_MINGW_ACCESS' CXXFLAGS=-D__USE_MINGW_ACCESS
LDFLAGS='-Wl,--disable-nxcompat -Wl,--disable-high-entropy-va
-Wl,--disable-dynamicbase'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (MinGW-W64 x86_64-msvcrt-posix-seh, built by Brecht Sanders)

Here's the old build from 2018 where this isn't an issue:

gcc.exe -v
Reading specs from c:/mingw/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/specs
COLLECT_GCC=C:\MingW\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/4.8.3/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-4.8.3/configure --prefix=/opt/windows_64
--with-sysroot=/opt/windows_64 --libdir=/opt/windows_64/lib64
--mandir=/opt/windows_64/man --infodir=/opt/windows_64/info --enable-shared
--disable-bootstrap --disable-multilib --enable-threads=posix
--enable-languages=c,c++ --enable-checking=release --enable-libgomp
--with-system-zlib --with-python-dir=/lib64/python2.7/site-packages
--disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp
--with-gnu-ld --verbose --enable-java-home
--with-java-home=/opt/windows_64/lib64/jvm/jre
--with-jvm-root-dir=/opt/windows_64/lib64/jvm
--with-jvm-jar-dir=/opt/windows_64/lib64/jvm/jvm-exports
--with-arch-directory=amd64
--with-antlr-jar='/home/adrien/projects/win-builds-1.5/slackware64-current/d/gcc/antlr-*.jar'
--disable-java-awt --disable-gtktest --build=x86_64-slackware-linux
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
Thread model: posix
gcc version 4.8.3 (GCC)


More information about the Gcc-bugs mailing list