https://bugs.winehq.org/show_bug.cgi?id=54263
Bug ID: 54263 Summary: Build of 7.22 fails with mingw-w64 10.0 (multiple symbol redefinitions) Product: Wine Version: 7.22 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: ilg@livius.net Distribution: ---
I have severl build scripts that I use to create the wine-xpack distribution (https://github.com/xpack-dev-tools/wine-xpack/), and I successfully compiled 6.17, 6.23 and 7.22 with gcc 11.3 & mingw-w64 9.0.
When I tried to build 7.22 with the latest gcc 12.2 & mingw-w64 10.0, I got multiple redefinition errors, for symbols from the sprintf family.
For example:
/home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/dlls/ntdll/printf.c:56:11: error: redefinition of '_vsnprintf' 56 | int CDECL _vsnprintf( char *str, size_t len, const char *format, va_list args ) | ^~~~~~~~~~ In file included from /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/dlls/ntdll/printf.c:27: /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:174:27: note: previous definition of '_vsnprintf' with type 'int(char *, size_t, const char *, char *)' {aka 'int(char *, long long unsigned int, const char *, char *)'} 174 | static inline int __cdecl _vsnprintf(char *buffer, size_t size, const char *format, va_list args) | ^~~~~~~~~~ /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/dlls/ntdll/printf.c:69:11: error: redefinition of '_vsnwprintf' 69 | int CDECL _vsnwprintf( WCHAR *str, size_t len, const WCHAR *format, va_list args ) | ^~~~~~~~~~~ In file included from /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:11: /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/corecrt_wstdio.h:99:27: note: previous definition of '_vsnwprintf' with type 'int(wchar_t *, size_t, const wchar_t *, char *)' {aka 'int(short unsigned int *, long long unsigned int, const short unsigned int *, char *)'} 99 | static inline int __cdecl _vsnwprintf(wchar_t *buffer, size_t size, const wchar_t *format, va_list args) | ^~~~~~~~~~~ /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/dlls/ntdll/printf.c:82:11: error: redefinition of '_vscprintf' 82 | int CDECL _vscprintf( const char *format, va_list valist ) | ^~~~~~~~~~ /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:201:27: note: previous definition of '_vscprintf' with type 'int(const char *, char *)' 201 | static inline int __cdecl _vscprintf(const char *format, va_list args) | ^~~~~~~~~~ /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/dlls/ntdll/printf.c:91:11: error: redefinition of '_vscwprintf' 91 | int CDECL _vscwprintf( const wchar_t *format, va_list args ) | ^~~~~~~~~~~ /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/corecrt_wstdio.h:195:27: note: previous definition of '_vscwprintf' with type 'int(const wchar_t *, char *)' {aka 'int(const short unsigned int *, char *)'} 195 | static inline int __cdecl _vscwprintf(const wchar_t *format, va_list args) | ^~~~~~~~~~~ /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/dlls/ntdll/printf.c:115:13: error: redefinition of '_snwprintf' 115 | int WINAPIV _snwprintf( WCHAR *str, size_t len, const WCHAR *format, ... ) | ^~~~~~~~~~
I patched ntdll/printf.c to omit the new definitions and the builds advanced, but later failed in string.c with other set of multiple definitions, later in wcstring.c, and so on.
I gave up and returned to the older toolchain.
Am I missing something when configuring the build, or the wine sources are not yet updated for mingw-w64 10.0?
https://bugs.winehq.org/show_bug.cgi?id=54263
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
https://bugs.winehq.org/show_bug.cgi?id=54263
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@gmail.com
--- Comment #1 from Eric Pouech eric.pouech@gmail.com --- can you post the command line used for compilation? and which parameters have been used to configure wine?
looks it's missing some defines? (the inlined definitions in msvcrt/stdio.h are not supposed to be used here... normally this should end up with '-D_MSVCR_VER_=0' argument to compiler)
https://bugs.winehq.org/show_bug.cgi?id=54263
--- Comment #2 from Liviu Ionescu ilg@livius.net --- Hi Eric, thank you for your reply.
I'm a bit embarrassed, I did a clean rerun with exactly the scripts I used for the previous release, and now the build fails with a different error:
x86_64-w64-mingw32-gcc -c -o dlls/advapi32/x86_64-windows/advapi.o /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/dlls/advapi32/advapi.c \ -Idlls/advapi32 -I/home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/dlls/advapi32 \ -Iinclude -I/home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include \
-I/home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt -D_MSVCR_VER=0 \ -D__WINESRC__ -D_ADVAPI32_ -D__WINE_PE_BUILD -Wall -fno-strict-aliasing \ -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Winit-self \ -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \ -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op -Wabsolute-value \ -Wno-format -Wformat-overflow -Wnonnull -mcx16 -gdwarf-4 -Wformat \
-I/home/ilg/Work/wine-xpack.git/build/linux-x64/x86_64-pc-linux-gnu/install/include \ -g -O2
...
tools/winegcc/winegcc -o dlls/advapi32/x86_64-windows/advapi32.dll --wine-objdir . -b x86_64-w64-mingw32 -Wl,--wine-builtin -shared \
/home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/dlls/advapi32/advapi32.spec \ dlls/advapi32/x86_64-windows/advapi.o dlls/advapi32/x86_64-windows/cred.o \ dlls/advapi32/x86_64-windows/crypt.o dlls/advapi32/x86_64-windows/crypt_arc4.o \ dlls/advapi32/x86_64-windows/crypt_des.o dlls/advapi32/x86_64-windows/crypt_lmhash.o \ dlls/advapi32/x86_64-windows/eventlog.o dlls/advapi32/x86_64-windows/lsa.o \ dlls/advapi32/x86_64-windows/registry.o dlls/advapi32/x86_64-windows/security.o \ dlls/advapi32/x86_64-windows/service.o dlls/advapi32/x86_64-windows/wmi.o \ dlls/advapi32/version.res dlls/kernelbase/x86_64-windows/libkernelbase.a \ dlls/sechost/x86_64-windows/libsechost.a dlls/rpcrt4/x86_64-windows/librpcrt4.delay.a \ dlls/winecrt0/x86_64-windows/libwinecrt0.a dlls/msvcrt/x86_64-windows/libmsvcrt.a \ dlls/kernel32/x86_64-windows/libkernel32.a dlls/ntdll/x86_64-windows/libntdll.a /home/ilg/.local/xPacks/@xpack-dev-tools/mingw-w64-gcc/12.2.0-1.1/.content/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: dlls/advapi32/x86_64-windows/advapi.o: in function `vsnprintf': /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:168: undefined reference to `__imp___stdio_common_vsprintf' /home/ilg/.local/xPacks/@xpack-dev-tools/mingw-w64-gcc/12.2.0-1.1/.content/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:168: undefined reference to `__imp___stdio_common_vsprintf' /home/ilg/.local/xPacks/@xpack-dev-tools/mingw-w64-gcc/12.2.0-1.1/.content/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: dlls/advapi32/x86_64-windows/cred.o: in function `vsnprintf': /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:168: undefined reference to `__imp___stdio_common_vsprintf' /home/ilg/.local/xPacks/@xpack-dev-tools/mingw-w64-gcc/12.2.0-1.1/.content/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:168: undefined reference to `__imp___stdio_common_vsprintf' /home/ilg/.local/xPacks/@xpack-dev-tools/mingw-w64-gcc/12.2.0-1.1/.content/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: dlls/advapi32/x86_64-windows/crypt.o: in function `vsnprintf': /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:168: undefined reference to `__imp___stdio_common_vsprintf' /home/ilg/.local/xPacks/@xpack-dev-tools/mingw-w64-gcc/12.2.0-1.1/.content/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: dlls/advapi32/x86_64-windows/crypt.o: in function `swprintf': /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/corecrt_wstdio.h:145: undefined reference to `__imp___stdio_common_vswprintf' /home/ilg/.local/xPacks/@xpack-dev-tools/mingw-w64-gcc/12.2.0-1.1/.content/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: dlls/advapi32/x86_64-windows/crypt.o: in function `vsnprintf': /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:168: undefined reference to `__imp___stdio_common_vsprintf' /home/ilg/.local/xPacks/@xpack-dev-tools/mingw-w64-gcc/12.2.0-1.1/.content/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: dlls/advapi32/x86_64-windows/eventlog.o: in function `vsnprintf': /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:168: undefined reference to `__imp___stdio_common_vsprintf' /home/ilg/.local/xPacks/@xpack-dev-tools/mingw-w64-gcc/12.2.0-1.1/.content/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:168: undefined reference to `__imp___stdio_common_vsprintf' /home/ilg/.local/xPacks/@xpack-dev-tools/mingw-w64-gcc/12.2.0-1.1/.content/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: dlls/advapi32/x86_64-windows/lsa.o: in function `vsnprintf': /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:168: undefined reference to `__imp___stdio_common_vsprintf' /home/ilg/.local/xPacks/@xpack-dev-tools/mingw-w64-gcc/12.2.0-1.1/.content/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:168: undefined reference to `__imp___stdio_common_vsprintf' /home/ilg/.local/xPacks/@xpack-dev-tools/mingw-w64-gcc/12.2.0-1.1/.content/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: dlls/advapi32/x86_64-windows/registry.o:/home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/include/msvcrt/stdio.h:168: more undefined references to `__imp___stdio_common_vsprintf' follow collect2: error: ld returned 1 exit status winegcc: /home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/x86_64-w64-mingw32-gcc failed Makefile:5711: recipe for target 'dlls/advapi32/x86_64-windows/advapi32.dll' failed make: *** [dlls/advapi32/x86_64-windows/advapi32.dll] Error 2
The configure line was:
[bash /home/ilg/Work/wine-xpack.git/build/linux-x64/sources/wine-7.22/configure --prefix=/home/ilg/Work/wine-xpack.git/build/linux-x64/application --mandir=/home/ilg/Work/wine-xpack.git/build/linux-x64/x86_64-pc-linux-gnu/install/share/man --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-mingw --with-pthread --with-unwind --without-alsa --without-capi --without-cms --without-coreaudio --without-cups --without-dbus --without-faudio --without-fontconfig --without-freetype --without-gettext --without-gettextpo --without-gphoto --without-gnutls --without-gsm --without-gssapi --without-gstreamer --without-hal --without-inotify --without-jpeg --without-jxrlib --without-krb5 --without-ldap --without-mpg123 --without-netapi --without-openal --without-opengl --without-osmesa --without-oss --without-pcap --with-png --without-pulse --without-quicktime --without-sane --without-sdl --without-tiff --without-udev --without-usb --without-v4l2 --without-vkd3d --without-vulkan --without-xcomposite --without-xcursor --without-xfixes --without-xinerama --without-xinput --without-xinput2 --without-xml --without-xrandr --without-xrender --without-xshape --without-xshm --without-xslt --without-xxf86vm --without-x --enable-win64 --disable-tests --disable-win16]
and the environment:
AR=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/gcc-ar AS=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/as CC=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/gcc CFLAGS=-ffunction-sections -fdata-sections -pipe -O2 -w CI=false CONFIG_SHELL=/bin/bash CPPFLAGS=-I/home/ilg/Work/wine-xpack.git/build/linux-x64/x86_64-pc-linux-gnu/install/include CXX=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/g++ CXXFLAGS=-ffunction-sections -fdata-sections -pipe -O2 -w FORCE_UNSAFE_CONFIGURE=1 HOME=/home/ilg HOSTNAME=docker INSTALL=/usr/bin/install LANG=C LD=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/ld LDFLAGS=-L/home/ilg/Work/wine-xpack.git/build/linux-x64/x86_64-pc-linux-gnu/install/lib -O2 -v -Wl,--gc-sections -Wl,-rpath,/home/ilg/Work/wine-xpack.git/build/linux-x64/x86_64-pc-linux-gnu/install/lib:/home/ilg/.local/xPacks/@xpack-dev-tools/gcc/12.2.0-2.1/.content/lib64 LD_LIBRARY_PATH=/home/ilg/Work/wine-xpack.git/build/linux-x64/x86_64-pc-linux-gnu/install/lib:/home/ilg/.local/xPacks/@xpack-dev-tools/gcc/12.2.0-2.1/.content/lib64 M4=/usr/bin/m4 NM=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/gcc-nm NODE_ENV=production NODE_VERSION=16.18.0 OBJCOPY=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/objcopy OBJDUMP=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/objdump OLDPWD=/home/ilg/Work/wine-xpack.git/build/linux-x64/sources PATH=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin:/home/ilg/Work/wine-xpack.git/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PKG_CONFIG=/home/ilg/Work/wine-xpack.git/build/linux-x64/x86_64-pc-linux-gnu/install/bin/pkg-config-verbose PKG_CONFIG_LIBDIR= PKG_CONFIG_PATH=/home/ilg/Work/wine-xpack.git/build/linux-x64/x86_64-pc-linux-gnu/install/lib/pkgconfig: PWD=/home/ilg/Work/wine-xpack.git/build/linux-x64/x86_64-pc-linux-gnu/build/wine-7.22-64 PYTHON=/usr/bin/python RANLIB=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/gcc-ranlib READELF=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/readelf SED=/bin/sed SHELL=/bin/bash SHLVL=1 SIZE=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/size STRIP=/home/ilg/Work/wine-xpack.git/build/linux-x64/xpacks/.bin/strip TZ=UTC YARN_VERSION=1.22.19
Sorry for the confusion with the error messages, the problem seems different.
If the wine build is known to work with mingw 10, any idea what might be wrong in this configuration?
https://bugs.winehq.org/show_bug.cgi?id=54263
Liviu Ionescu ilg@livius.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Build of 7.22 fails with |Build of 7.22 fails with |mingw-w64 10.0 (multiple |mingw-w64 10.0 |symbol redefinitions) |
https://bugs.winehq.org/show_bug.cgi?id=54263
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #3 from Zeb Figura z.figura12@gmail.com --- Somehow it's picking up the ucrtbase definitions of stdio methods despite _UCRT not being defined?
https://bugs.winehq.org/show_bug.cgi?id=54263
--- Comment #4 from Liviu Ionescu ilg@livius.net ---
despite _UCRT not being defined?
Where should this be defined?
The mingw-w64 10.0 in the toolchain is configured to use UCRT, not MSVCRT.
But the mingw-w64 9.0 in the toolchain that builds fine was also configured with UCRT, so the difference must be more subtle.
https://bugs.winehq.org/show_bug.cgi?id=54263
--- Comment #5 from Zeb Figura z.figura12@gmail.com --- (In reply to Liviu Ionescu from comment #4)
despite _UCRT not being defined?
Where should this be defined?
It shouldn't be defined, for advapi32. It's done by our build system for other modules; we don't use mingw-w64 headers / CRT for that.
https://bugs.winehq.org/show_bug.cgi?id=54263
Jacek Caban jacek@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jacek@codeweavers.com
--- Comment #6 from Jacek Caban jacek@codeweavers.com --- Created attachment 73832 --> https://bugs.winehq.org/attachment.cgi?id=73832 patch
I've seen something similar in the past and it was due to mingw-w64 stdarg.h pulling _mingw.h. Does it work better with the attached patch?
https://bugs.winehq.org/show_bug.cgi?id=54263
--- Comment #7 from Liviu Ionescu ilg@livius.net --- I confirm that with the proposed patch, a full clean build passed with the toolchain including mingw-w64 10.0.
So, from my point of view, the solution is acceptable, and the patch can be included in next release.
https://bugs.winehq.org/show_bug.cgi?id=54263
Jacek Caban jacek@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |4d8091cccc46053c605e68eccd2 | |7b94ec297f28e Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #8 from Jacek Caban jacek@codeweavers.com --- Fixed in git: https://gitlab.winehq.org/wine/wine/-/merge_requests/1921/diffs?commit_id=4d...
https://bugs.winehq.org/show_bug.cgi?id=54263
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.0-rc4.
https://bugs.winehq.org/show_bug.cgi?id=54263
--- Comment #10 from Liviu Ionescu ilg@livius.net --- Thank you!