public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/18131] New: cannot cross compile gdbserver for x86_64-w64-mingw32
@ 2015-03-16  9:55 lukeallardyce at yahoo dot co.uk
  2015-03-16 14:27 ` [Bug gdb/18131] " palves at redhat dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: lukeallardyce at yahoo dot co.uk @ 2015-03-16  9:55 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18131

            Bug ID: 18131
           Summary: cannot cross compile gdbserver for x86_64-w64-mingw32
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: lukeallardyce at yahoo dot co.uk

commit 791c005 seems to have broken gdbserver when cross compiling for
x86_64-w64-mingw32


../../../../../binutils-gdb/gdb/gdbserver/../common/common-remote-fileio.c:88:1:
error: conflicting types for 'remote_fileio_to_fio_stat'
 remote_fileio_to_fio_stat (struct stat *st, struct fio_stat *fst)
 ^
In file included from
../../../../../binutils-gdb/gdb/gdbserver/../common/common-remote-fileio.c:21:0:
../../../../../binutils-gdb/gdb/gdbserver/../common/common-remote-fileio.h:58:13:
note: previous declaration of 'remote_fileio_to_fio_stat' was here
 extern void remote_fileio_to_fio_stat (struct stat *st,


For some reason the forward declaration of stat in common-remote-fileio.h seems
to conflict with its definition in sys/stat.h, I worked around it for now as
follows


diff --git a/gdb/common/common-remote-fileio.c
b/gdb/common/common-remote-fileio.c
index f78b3f7..4d5b897 100644
--- a/gdb/common/common-remote-fileio.c
+++ b/gdb/common/common-remote-fileio.c
@@ -19,7 +19,6 @@

 #include "common-defs.h"
 #include "common-remote-fileio.h"
-#include <sys/stat.h>

 /* Convert a host-format mode_t into a bitmask of File-I/O flags.  */

diff --git a/gdb/common/common-remote-fileio.h
b/gdb/common/common-remote-fileio.h
index b838186..27bc585 100644
--- a/gdb/common/common-remote-fileio.h
+++ b/gdb/common/common-remote-fileio.h
@@ -21,8 +21,7 @@
 #define COMMON_REMOTE_FILEIO_H

 #include "gdb/fileio.h"
-
-struct stat;
+#include <sys/stat.h>

 /* Pack a host-format integer into a byte buffer in big-endian format
    ready for transmission over the remote protocol.  BYTES specifies

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/18131] cannot cross compile gdbserver for x86_64-w64-mingw32
  2015-03-16  9:55 [Bug gdb/18131] New: cannot cross compile gdbserver for x86_64-w64-mingw32 lukeallardyce at yahoo dot co.uk
@ 2015-03-16 14:27 ` palves at redhat dot com
  2015-03-16 23:09 ` gbenson at redhat dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: palves at redhat dot com @ 2015-03-16 14:27 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18131

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gbenson at redhat dot com,
                   |                            |palves at redhat dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/18131] cannot cross compile gdbserver for x86_64-w64-mingw32
  2015-03-16  9:55 [Bug gdb/18131] New: cannot cross compile gdbserver for x86_64-w64-mingw32 lukeallardyce at yahoo dot co.uk
  2015-03-16 14:27 ` [Bug gdb/18131] " palves at redhat dot com
@ 2015-03-16 23:09 ` gbenson at redhat dot com
  2015-03-17  8:58 ` lukeallardyce at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gbenson at redhat dot com @ 2015-03-16 23:09 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18131

--- Comment #1 from Gary Benson <gbenson at redhat dot com> ---
I can't see why the forward declaration should break this, but I'm happy to
include sys/stat.h in common-remote-fileio.h.  It doesn't need to be in
common-remote-fileio.c as well.  Are you able to push a fix for this or would
you like me to?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/18131] cannot cross compile gdbserver for x86_64-w64-mingw32
  2015-03-16  9:55 [Bug gdb/18131] New: cannot cross compile gdbserver for x86_64-w64-mingw32 lukeallardyce at yahoo dot co.uk
  2015-03-16 14:27 ` [Bug gdb/18131] " palves at redhat dot com
  2015-03-16 23:09 ` gbenson at redhat dot com
@ 2015-03-17  8:58 ` lukeallardyce at gmail dot com
  2015-03-17  9:59 ` palves at redhat dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: lukeallardyce at gmail dot com @ 2015-03-17  8:58 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18131

--- Comment #2 from Luke Allardyce <lukeallardyce at gmail dot com> ---
I haven't looked too deeply into it but I was surprised too, I have no idea why
the forward declaration would conflict. For what it's worth it cross compiles
fine as-is for i686-w64-mingw32, perhaps this is a gcc bug?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/18131] cannot cross compile gdbserver for x86_64-w64-mingw32
  2015-03-16  9:55 [Bug gdb/18131] New: cannot cross compile gdbserver for x86_64-w64-mingw32 lukeallardyce at yahoo dot co.uk
                   ` (2 preceding siblings ...)
  2015-03-17  8:58 ` lukeallardyce at gmail dot com
@ 2015-03-17  9:59 ` palves at redhat dot com
  2015-03-17 11:18 ` lukeallardyce at gmail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: palves at redhat dot com @ 2015-03-17  9:59 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18131

--- Comment #3 from Pedro Alves <palves at redhat dot com> ---
Most likely because "stat" is a define to something like "stat64".

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/18131] cannot cross compile gdbserver for x86_64-w64-mingw32
  2015-03-16  9:55 [Bug gdb/18131] New: cannot cross compile gdbserver for x86_64-w64-mingw32 lukeallardyce at yahoo dot co.uk
                   ` (3 preceding siblings ...)
  2015-03-17  9:59 ` palves at redhat dot com
@ 2015-03-17 11:18 ` lukeallardyce at gmail dot com
  2015-03-17 11:28 ` gbenson at redhat dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: lukeallardyce at gmail dot com @ 2015-03-17 11:18 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18131

--- Comment #4 from Luke Allardyce <lukeallardyce at gmail dot com> ---
You're absolutely right

Using the preprocessor output, the function definition on x86_64 is outputted
as 

void remote_fileio_to_fio_stat (struct _stat64 *st, struct fio_stat *fst)

in i686 it's

void remote_fileio_to_fio_stat (struct _stati64 *st, struct fio_stat *fst)

I was wrong about i686, it fails too, I don't know why I thought it had
compiled.

To push this should I just send it to gdb-patches?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/18131] cannot cross compile gdbserver for x86_64-w64-mingw32
  2015-03-16  9:55 [Bug gdb/18131] New: cannot cross compile gdbserver for x86_64-w64-mingw32 lukeallardyce at yahoo dot co.uk
                   ` (4 preceding siblings ...)
  2015-03-17 11:18 ` lukeallardyce at gmail dot com
@ 2015-03-17 11:28 ` gbenson at redhat dot com
  2015-03-17 11:31 ` cvs-commit at gcc dot gnu.org
  2015-03-17 16:30 ` gbenson at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: gbenson at redhat dot com @ 2015-03-17 11:28 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18131

--- Comment #5 from Gary Benson <gbenson at redhat dot com> ---
Ah, I didn't know if you had write access, I'll push a fix now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/18131] cannot cross compile gdbserver for x86_64-w64-mingw32
  2015-03-16  9:55 [Bug gdb/18131] New: cannot cross compile gdbserver for x86_64-w64-mingw32 lukeallardyce at yahoo dot co.uk
                   ` (5 preceding siblings ...)
  2015-03-17 11:28 ` gbenson at redhat dot com
@ 2015-03-17 11:31 ` cvs-commit at gcc dot gnu.org
  2015-03-17 16:30 ` gbenson at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-17 11:31 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18131

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gary Benson <gary@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7f3647e2ba4517be59ce531ec2297918b998fe3e

commit 7f3647e2ba4517be59ce531ec2297918b998fe3e
Author: Gary Benson <gbenson@redhat.com>
Date:   Tue Mar 17 11:26:09 2015 +0000

    Remove forward declaration of struct stat

    Forward declarations of struct stat break the Windows build.
    This commit removes a forward declaration of struct stat and
    includes sys/stat.h directly instead.

    gdb/ChangeLog:

        PR gdb/18131
        * common/common-remote-fileio.h (sys/stat.h): New include.
        (stuct stat): Remove forward declaration.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/18131] cannot cross compile gdbserver for x86_64-w64-mingw32
  2015-03-16  9:55 [Bug gdb/18131] New: cannot cross compile gdbserver for x86_64-w64-mingw32 lukeallardyce at yahoo dot co.uk
                   ` (6 preceding siblings ...)
  2015-03-17 11:31 ` cvs-commit at gcc dot gnu.org
@ 2015-03-17 16:30 ` gbenson at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: gbenson at redhat dot com @ 2015-03-17 16:30 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18131

Gary Benson <gbenson at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Gary Benson <gbenson at redhat dot com> ---
Fix pushed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-03-17 11:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16  9:55 [Bug gdb/18131] New: cannot cross compile gdbserver for x86_64-w64-mingw32 lukeallardyce at yahoo dot co.uk
2015-03-16 14:27 ` [Bug gdb/18131] " palves at redhat dot com
2015-03-16 23:09 ` gbenson at redhat dot com
2015-03-17  8:58 ` lukeallardyce at gmail dot com
2015-03-17  9:59 ` palves at redhat dot com
2015-03-17 11:18 ` lukeallardyce at gmail dot com
2015-03-17 11:28 ` gbenson at redhat dot com
2015-03-17 11:31 ` cvs-commit at gcc dot gnu.org
2015-03-17 16:30 ` gbenson at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).