On Fri, Feb 14, 2020 at 10:44 AM Gerald Pfeifer gerald@pfeifer.com wrote:
Even after patches by Michael Cronenworth and me, cf. https://www.winehq.org/pipermail/wine-devel/2020-January/157945.html https://www.winehq.org/pipermail/wine-devel/2020-January/158454.html Wine still fails to build with GCC 10 development snapshots.
This is due to a change of defaults in GCC, from -fcommon to -fno-common, cf. the following from http://gcc.gnu.org/gcc-10/porting_to.html :
A common mistake in C is omitting extern when declaring a global variable in a header file. If the header is included by several files it results in multiple definitions of the same variable. In previous GCC versions this error is ignored. GCC 10 defaults to -fno-common, which means a linker error will now be reported. To fix this, use extern in header files when declaring global variables, and ensure each global is defined in exactly one C file. As a workaround, legacy C code can be compiled with -fcommon.
The failure left is
gmake[1]: Entering directory '/home/gerald/wine/dlls/schedsvc/tests' ../../../tools/winegcc/winegcc -o schedsvc_test-stripped.exe.so --wine-objdir ../../.. -fno-PIC -fasynchronous-unwind-tables \ -s -Wb,-F,schedsvc_test.exe -mno-cygwin atsvcapi.o rpcapi.o atsvc_c.o schrpc_c.o testlist.o \ -lrpcrt4 -lole32 -L/home/gerald/11-i386/lib schrpc_c.o:(.bss+0x0): multiple definition of `rpc_handle' atsvc_c.o:(.bss+0x0): first defined here winebuild: /home/gerald/11-i386/bin/ld failed with status 1 winegcc: ../../../tools/winebuild/winebuild failed gmake[1]: *** [Makefile:367: schedsvc_test-stripped.exe.so] Error 2 gmake[1]: Leaving directory '/home/gerald/wine/dlls/schedsvc/tests' gmake: *** [Makefile:8961: dlls/schedsvc/tests] Error 2
You can probably try to use different names for variables defined with implicit_handle() attribute.
atsvc_c.c and schrpc_c.c are auto-generated from atsvc.idl and schrpc.idl, so I'm not sure how to tackle this.
Anyone who can help and take this?
Thank you, Gerald