https://bugs.winehq.org/show_bug.cgi?id=49785
Bug ID: 49785 Summary: Linking of d3dx10_43 fails with 32-bit Wine, -pipe flag and MinGW enabled Product: Wine Version: 5.13 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: sashok.olen@gmail.com CC: zhui@codeweavers.com Regression SHA1: 99aa8b5ddc1b81ee4f7b3dd6d13dd9ae46e08ff7 Distribution: ArchLinux
How to reproduce: 1) Export CFLAGS="-pipe -O2 -ftree-vectorize" and CROSSCFLAGS="-pipe -O2 -ftree-vectorize" compilation flags. 1) Compile 32-bit Wine 5.13 or newer with MinGW enabled. During compilation, linking will frequently fail (the issue is intermittent):
i686-w64-mingw32-gcc -c -o testlist.cross.o testlist.c -I. -I../../../include -I../../../include/msvcrt -D__WINESRC__ \ -D_MSVCR_VER=0 -DWINE_CROSS_PE -Wall -fno-strict-aliasing -Wdeclaration-after-statement \ -Wempty-body -Wignored-qualifiers -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes \ -Wtype-limits -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op \ -Wabsolute-value -fno-omit-frame-pointer -pipe -O2 -ftree-vectorize /usr/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: d3dx10_43_main.cross.o:d3dx10_43_main.c:(.text+0x12f0): undefined reference to `IID_IWICDdsDecoder' /usr/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: d3dx10_43_main.cross.o:d3dx10_43_main.c:(.rdata+0x9e0): undefined reference to `GUID_ContainerFormatBmp' /usr/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: d3dx10_43_main.cross.o:d3dx10_43_main.c:(.rdata+0x9e8): undefined reference to `GUID_ContainerFormatJpeg' /usr/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: d3dx10_43_main.cross.o:d3dx10_43_main.c:(.rdata+0x9f0): undefined reference to `GUID_ContainerFormatPng' /usr/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: d3dx10_43_main.cross.o:d3dx10_43_main.c:(.rdata+0x9f8): undefined reference to `GUID_ContainerFormatDds' /usr/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: d3dx10_43_main.cross.o:d3dx10_43_main.c:(.rdata+0xa00): undefined reference to `GUID_ContainerFormatTiff' /usr/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: d3dx10_43_main.cross.o:d3dx10_43_main.c:(.rdata+0xa08): undefined reference to `GUID_ContainerFormatGif' /usr/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: d3dx10_43_main.cross.o:d3dx10_43_main.c:(.rdata+0xa10): undefined reference to `GUID_ContainerFormatWmp' collect2: error: ld returned 1 exit status winegcc: /usr/bin/i686-w64-mingw32-gcc failed make[1]: *** [Makefile:275: d3dx10_43.dll] Error 2 make[1]: Leaving directory '/home/alex/git_projects/winehq/dlls/d3dx10_43' make: *** [Makefile:9808: dlls/d3dx10_43] Error 2
However, I've found that if I revert commit 99aa8b5ddc1b81ee4f7b3dd6d13dd9ae46e08ff7, or try to compile Wine versions before 5.13, the issue never happens (at least it hasn't happened so far). The problem also doesn't occur (so far) if I don't specify the -pipe flag for CFLAGS and CROSSCFLAGS. To compile Wine, I use GCC 10.2 and Mingw-Gcc 10.2 provided by Arch Linux Repository, however, I've seen reports that this is an issue with version 9.3 of gcc and mingw-gcc as well. I understand that it's highly unlikely that this is an actual Wine bug, but I thought it was important to share this information.