Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kai Tietz <ktietz@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org,
	Corinna Vinschen <vinschen@redhat.com>,
	       Nicholas Clifton <nickc@redhat.com>
Subject: Re: [patch 1/2] mingw: update gnulib: prepare the sources
Date: Tue, 23 Dec 2014 11:54:00 -0000	[thread overview]
Message-ID: <108241234.1319759.1419335690162.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20141222221229.GA30575@host2.jankratochvil.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]
> 


  reply	other threads:[~2014-12-23 11:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-22 22:12 Jan Kratochvil
2014-12-23 11:54 ` Kai Tietz [this message]
2014-12-24 22:20   ` Jan Kratochvil
2015-03-23 16:51     ` Pedro Alves
2015-03-23 17:08       ` Jan Kratochvil
2015-03-23 17:25         ` Pedro Alves
2015-03-23 17:32           ` Jan Kratochvil
2015-03-23 17:37           ` Eli Zaretskii
2015-03-23 17:57             ` Pedro Alves
2015-08-24 18:09               ` Pedro Alves
2015-03-23 19:17       ` Corinna Vinschen
2015-03-23 19:28         ` Pedro Alves
2015-03-23 19:47           ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=108241234.1319759.1419335690162.JavaMail.zimbra@redhat.com \
    --to=ktietz@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=nickc@redhat.com \
    --cc=vinschen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox