This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch 1/2] mingw: update gnulib: prepare the sources
- From: Kai Tietz <ktietz at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Corinna Vinschen <vinschen at redhat dot com>, Nicholas Clifton <nickc at redhat dot com>
- Date: Tue, 23 Dec 2014 06:54:50 -0500 (EST)
- Subject: Re: [patch 1/2] mingw: update gnulib: prepare the sources
- Authentication-results: sourceware.org; auth=none
- References: <20141222221229 dot GA30575 at host2 dot jankratochvil dot net>
Hi,
----- UrsprÃngliche Mail -----
...
> The whole problem is that the gnulib update (in [patch 2/2]) will cause
> (only)
> for build_win64 many errors like this one:
Only for win64? This is curious. As headers are shared between 32-bit and 64-bit, and most part of Win32 API too.
> x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
> -fexceptions --param=ssp-buffer-size=4 -D__USE_MINGW_ACCESS -I.
> -I../../gdb -I../../gdb/common -I../../gdb/config
> -DLOCALEDIR="\"/usr/x86_64-w64-mingw32/sys-root/mingw/share/locale\""
> -DHAVE_CONFIG_H -I../../gdb/../include/opcode -I../../gdb/../opcodes/..
> -I../../gdb/../readline/.. -I../bfd -I../../gdb/../bfd
> -I../../gdb/../include -I../libdecnumber -I../../gdb/../libdecnumber
> -I./../intl -I../../gdb/gnulib/import -Ibuild-gnulib/import -Wall
> -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused
> -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts
> -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body
> -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition
> -Wno-format -Werror -c -o ser-tcp.o -MT ser-tcp.o -MMD -MP -MF
> .deps/ser-tcp.Tpo ../../gdb/ser-tcp.c
> ../../gdb/ser-tcp.c: In function 'wait_for_connect':
> ../../gdb/ser-tcp.c:137:53: error: passing argument 5 of 'select' from
> incompatible pointer type [-Werror]
> n = select (scb->fd + 1, &rset, &wset, &eset, &t);
> ^
> In file included from ../../gdb/serial.h:23:0,
> from ../../gdb/ser-tcp.c:21:
> /usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock2.h:995:34: note:
> expected 'PTIMEVAL' but argument is of type 'struct rpl_timeval *'
> WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set
> *writefds,fd_set *exceptfds,const PTIMEVAL timeout);
> ^
> cc1: all warnings being treated as errors
> Makefile:1100: recipe for target 'ser-tcp.o' failed
>
> This IIUC comes from this mingw64 change:
> [Mingw-w64-public] [patch] Replace struct timeval usage with PTIMEVAL and
> define TIMEVAL differently on LP64
> http://sourceforge.net/p/mingw-w64/mailman/message/29610438/
>
> This is because occasional #include <sys/time.h> will then #include also
> MS-Windows headers and provide an incompatible definition of struct timeval.
> IIUC one should always #include <sys/time.h> to get all the struct timeval
> definitions in the codebase the same.
>
> But #including <sys/time.h> (and thus <windows.h>) is a problem as sourceware
> include/coff/ headers have duplicate/conflicting definitions with MS-Windows
> headers. So I have #ifndef-out their duplicate/conflicting parts during
> 64-bit
> MS-Windows builds.
>
> I have no idea what is the best way, my only goal was to make it buildable
> (not runtime tested as Wine does not work so well for gdb.exe).
Well, IMO the real issue here is to include windows.h instead of sys/time.h. Also a lot of changes done in second patch are strongly related to this include.
Sadly MS decided to pollute namespace with commonly used names in their platform-headers. So in the past we tried to avoid to include things like windows.h in bfd and related headers, and to isolate files, which actually need to include it (eg windows-unicode stuff in binutils/). To include it now leads to a general architectural change of binutils' bfd (and other parts). I am not in general oppose to it, but I am wondering if this is really wanted/needed.
Kai
>
> Thanks,
> Jan
>
>
> [Textdatei:use.patch]
>