With binutils-2.38 in a cross to x86_64-w64-mingw32 I persistently see random breakage in dlltool during the build of mingw-w64's "crt".
Example 1:
...
x86_64-w64-mingw32-dlltool --as-flags=--64 -m i386:x86-64 -k --as=x86_64-w64-mingw32-as --output-lib lib64/libd3dcompiler_33.a --input-def /tmp/mingw-w64-v9.0.0/mingw-w64-crt/lib64/d3dcompiler_33.def
x86_64-w64-mingw32-dlltool --as-flags=--64 -m i386:x86-64 -k --as=x86_64-w64-mingw32-as --output-lib lib64/libd3dcompiler_34.a --input-def /tmp/mingw-w64-v9.0.0/mingw-w64-crt/lib64/d3dcompiler_34.def
x86_64-w64-mingw32-dlltool --as-flags=--64 -m i386:x86-64 -k --as=x86_64-w64-mingw32-as --output-lib lib64/libd3dcompiler_35.a --input-def /tmp/mingw-w64-v9.0.0/mingw-w64-crt/lib64/d3dcompiler_35.def
x86_64-w64-mingw32-dlltool --as-flags=--64 -m i386:x86-64 -k --as=x86_64-w64-mingw32-as --output-lib lib64/libd3dcompiler_36.a --input-def /tmp/mingw-w64-v9.0.0/mingw-w64-crt/lib64/d3dcompiler_36.def
Assembler messages:
Error: can't open D3DCompiler_dll_t.s for reading: No such file or directory
x86_64-w64-mingw32-dlltool --as-flags=--64 -m i386:x86-64 -k --as=x86_64-w64-mingw32-as --output-lib lib64/libd3dcompiler_37.a --input-def /tmp/mingw-w64-v9.0.0/mingw-w64-crt/lib64/d3dcompiler_37.def
x86_64-w64-mingw32-dlltool: x86_64-w64-mingw32-as exited with status 1
x86_64-w64-mingw32-dlltool: failed to open temporary tail file: D3DCompiler_dll_t.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00000.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00001.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00002.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00003.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00004.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00005.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00006.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00007.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00008.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00009.o: No such file or directory
make[1]: *** [Makefile:83854: lib64/libd3dcompiler_36.a] Error 1
make[1]: *** Waiting for unfinished jobs....
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00000.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00001.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00002.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00003.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00004.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00005.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00006.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00007.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00008.o: No such file or directory
x86_64-w64-mingw32-dlltool: cannot delete D3DCompiler_dll_s00009.o: No such file or directory
I've also seen it produce .a files that ar complained about containing invalid or truncated files.
These random failures occur persistently when using binutils-2.38 and parallel make (make -jN) for mingw-w64's crt. The failures disappear if I use non-parallel make, or revert to binutils-2.37.
A git bisect identified this late change in 2.38 development as the cause:
# first bad commit: [fdeee5d59dca41e3c70c399a939105e39a4b4282] Allow inferring tmp_prefix from the dll name from a def file
which makes sense since it touches dlltool.c.
Host: x86_64-pc-linux-gnu (Fedora 34)
Steps for building cross to mingw-w64 (each in a separate build dir):
/tmp/binutils-2.38/configure --target=x86_64-w64-mingw32 --enable-targets=x86_64-w64-mingw32,i686-w64-mingw32 --prefix=/tmp/cross-mingw64 --with-sysroot=/tmp/cross-mingw64 --disable-gdb --disable-gold --disable-nls --disable-plugins --disable-readline --disable-sim; make -j; make install
/tmp/mingw-w64-v9.0.0/mingw-w64-headers/configure --prefix=/tmp/cross-mingw64/x86_64-w64-mingw32 --host=x86_64-w64-mingw32; make install; ln -sf x86_64-w64-mingw32 /tmp/cross-mingw64/mingw
/tmp/gcc-11.2.0/configure --target=x86_64-w64-mingw32 --prefix=/tmp/cross-mingw64 --with-sysroot=/tmp/cross-mingw64 --disable-libatomic --disable-libgomp --disable-libitm --disable-libmpx --disable-libquadmath --disable-libsanitizer --disable-lto --disable-nls --disable-plugin --disable-shared --enable-checking=release --enable-multilib --enable-64bit --with-dwarf --enable-threads=win32 --enable-languages=c; make -j all-gcc; make install-gcc
/tmp/mingw-w64-v9.0.0/mingw-w64-crt/configure --prefix=/tmp/cross-mingw64/x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-lib32 --enable-lib64; make -j
(it's the last step above that fails in dlltool)
(to be followed by install of crt and rebuild of full gcc)
With binutils-2.38 in a cross to x86_64-w64-mingw32 I persistently see random breakage in dlltool during the build of mingw-w64's "crt".
Example 1: w64-mingw32- dlltool --as-flags=--64 -m i386:x86-64 -k --as=x86_ 64-w64- mingw32- as --output-lib lib64/libd3dcom piler_33. a --input-def /tmp/mingw- w64-v9. 0.0/mingw- w64-crt/ lib64/d3dcompil er_33.def w64-mingw32- dlltool --as-flags=--64 -m i386:x86-64 -k --as=x86_ 64-w64- mingw32- as --output-lib lib64/libd3dcom piler_34. a --input-def /tmp/mingw- w64-v9. 0.0/mingw- w64-crt/ lib64/d3dcompil er_34.def w64-mingw32- dlltool --as-flags=--64 -m i386:x86-64 -k --as=x86_ 64-w64- mingw32- as --output-lib lib64/libd3dcom piler_35. a --input-def /tmp/mingw- w64-v9. 0.0/mingw- w64-crt/ lib64/d3dcompil er_35.def w64-mingw32- dlltool --as-flags=--64 -m i386:x86-64 -k --as=x86_ 64-w64- mingw32- as --output-lib lib64/libd3dcom piler_36. a --input-def /tmp/mingw- w64-v9. 0.0/mingw- w64-crt/ lib64/d3dcompil er_36.def w64-mingw32- dlltool --as-flags=--64 -m i386:x86-64 -k --as=x86_ 64-w64- mingw32- as --output-lib lib64/libd3dcom piler_37. a --input-def /tmp/mingw- w64-v9. 0.0/mingw- w64-crt/ lib64/d3dcompil er_37.def w64-mingw32- dlltool: x86_64- w64-mingw32- as exited with status 1 w64-mingw32- dlltool: failed to open temporary tail file: D3DCompiler_ dll_t.o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00000. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00001. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00002. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00003. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00004. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00005. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00006. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00007. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00008. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00009. o: No such file or directory piler_36. a] Error 1 w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00000. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00001. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00002. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00003. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00004. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00005. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00006. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00007. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00008. o: No such file or directory w64-mingw32- dlltool: cannot delete D3DCompiler_ dll_s00009. o: No such file or directory
...
x86_64-
x86_64-
x86_64-
x86_64-
Assembler messages:
Error: can't open D3DCompiler_dll_t.s for reading: No such file or directory
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
make[1]: *** [Makefile:83854: lib64/libd3dcom
make[1]: *** Waiting for unfinished jobs....
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
x86_64-
Example 2: w64-mingw32- dlltool --as-flags=--64 -m i386:x86-64 -k --as=x86_ 64-w64- mingw32- as --output-lib lib64/libd3dx9.a --input-def /tmp/mingw- w64-v9. 0.0/mingw- w64-crt/ lib64/d3dx9_ 43.def w64-mingw32- dlltool --as-flags=--64 -m i386:x86-64 -k --as=x86_ 64-w64- mingw32- as --output-lib lib64/libd3dx10.a --input-def /tmp/mingw- w64-v9. 0.0/mingw- w64-crt/ lib64/d3dx10_ 43.def w64-mingw32- dlltool: lib32/libd3dx9.a: error reading d3dx9_43_dll_h.o: file truncated w64-mingw32- dlltool: lib64/libd3dx9.a: error reading d3dx9_43_dll_t.o: No such file or directory
...
x86_64-
x86_64-
x86_64-
make[1]: *** [Makefile:83819: lib32/libd3dx9.a] Error 1
make[1]: *** Waiting for unfinished jobs....
x86_64-
I've also seen it produce .a files that ar complained about containing invalid or truncated files.
These random failures occur persistently when using binutils-2.38 and parallel make (make -jN) for mingw-w64's crt. The failures disappear if I use non-parallel make, or revert to binutils-2.37.
A git bisect identified this late change in 2.38 development as the cause:
# first bad commit: [fdeee5d59dca41 e3c70c399a93910 5e39a4b4282] Allow inferring tmp_prefix from the dll name from a def file
which makes sense since it touches dlltool.c.
Host: x86_64-pc-linux-gnu (Fedora 34)
Steps for building cross to mingw-w64 (each in a separate build dir):
/tmp/binutils- 2.38/configure --target= x86_64- w64-mingw32 --enable- targets= x86_64- w64-mingw32, i686-w64- mingw32 --prefix= /tmp/cross- mingw64 --with- sysroot= /tmp/cross- mingw64 --disable-gdb --disable-gold --disable-nls --disable-plugins --disable-readline --disable-sim; make -j; make install w64-v9. 0.0/mingw- w64-headers/ configure --prefix= /tmp/cross- mingw64/ x86_64- w64-mingw32 --host= x86_64- w64-mingw32; make install; ln -sf x86_64-w64-mingw32 /tmp/cross- mingw64/ mingw 11.2.0/ configure --target= x86_64- w64-mingw32 --prefix= /tmp/cross- mingw64 --with- sysroot= /tmp/cross- mingw64 --disable-libatomic --disable-libgomp --disable-libitm --disable-libmpx --disable- libquadmath --disable- libsanitizer --disable-lto --disable-nls --disable-plugin --disable-shared --enable- checking= release --enable-multilib --enable-64bit --with-dwarf --enable- threads= win32 --enable- languages= c; make -j all-gcc; make install-gcc w64-v9. 0.0/mingw- w64-crt/ configure --prefix= /tmp/cross- mingw64/ x86_64- w64-mingw32 --host= x86_64- w64-mingw32 --enable-lib32 --enable-lib64; make -j
/tmp/mingw-
/tmp/gcc-
/tmp/mingw-
(it's the last step above that fails in dlltool)
(to be followed by install of crt and rebuild of full gcc)