* [PATCH] build powerpc sim for mingw host
@ 2008-02-08 23:05 Dave Murphy
2008-02-13 23:39 ` Joel Brobecker
2008-02-14 0:42 ` Daniel Jacobowitz
0 siblings, 2 replies; 4+ messages in thread
From: Dave Murphy @ 2008-02-08 23:05 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 166 bytes --]
Just a quick fix to allow building a powerpc gdb for mingw host.
I have an FSF assignment for gdb [MURPHY RT 338278] on file but this is
just a small change.
Dave
[-- Attachment #2: table.c.patch --]
[-- Type: text/plain, Size: 656 bytes --]
2008-02-07 Dave Murphy <davem@devkitpro.org>
* table.c (table_push) : correct file read under mingw as well as cygwin
Index: sim/ppc/table.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/table.c,v
retrieving revision 1.2
diff -u -r1.2 table.c
--- sim/ppc/table.c 12 Jan 2002 10:21:12 -0000 1.2
+++ sim/ppc/table.c 6 Feb 2008 05:07:41 -0000
@@ -128,7 +128,7 @@
file->pos = file->buffer;
/* read it in */
-#ifdef __CYGWIN32__
+#ifdef __WIN32__
if ((file->size) && ((nr = read(fd, file->buffer, file->size)) <= 0)) {
#else
if ((nr = read(fd, file->buffer, file->size)) < file->size) {
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] build powerpc sim for mingw host
2008-02-08 23:05 [PATCH] build powerpc sim for mingw host Dave Murphy
@ 2008-02-13 23:39 ` Joel Brobecker
2008-02-13 23:48 ` Brian Dessent
2008-02-14 0:42 ` Daniel Jacobowitz
1 sibling, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2008-02-13 23:39 UTC (permalink / raw)
To: Dave Murphy; +Cc: gdb-patches
Hi Dave,
I'm not a simulator maintainer, so I can't actually approve your patch,
but I took a look.
> @@ -128,7 +128,7 @@
> file->pos = file->buffer;
>
> /* read it in */
> -#ifdef __CYGWIN32__
> +#ifdef __WIN32__
> if ((file->size) && ((nr = read(fd, file->buffer, file->size)) <= 0)) {
> #else
> if ((nr = read(fd, file->buffer, file->size)) < file->size) {
I don't think this is right. It looks like you are breaking the simulator
on cygwin, or at least changing the behavior, because the cygwin GCC
doesn't define __WIN32__ (I just tried it on a windows machine).
The current usage in GDB suggests that you want to use:
#if defined(_WIN32) || defined (__CYGWIN32__)
Question to the Windows specialists:
In the GDB sources, we exclusively use the __CYGWIN__ macro, whereas
in the simulator sources, we use __CYGWIN32__. The name of the latter
macro suggests that this macro is going to be defined only on 32bit
processors whereas the code above might be general to all cygwin
versions, regardless of the CPU type. Should the above be changed to:
#if defined(_WIN32) || defined (__CYGWIN__)
?
There is another file (sim/common/dv-sockser.c) where the inclusion
of <netinet/tcp.h> is conditional on __CYGWIN32__.
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] build powerpc sim for mingw host
2008-02-13 23:39 ` Joel Brobecker
@ 2008-02-13 23:48 ` Brian Dessent
0 siblings, 0 replies; 4+ messages in thread
From: Brian Dessent @ 2008-02-13 23:48 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Dave Murphy, gdb-patches
Joel Brobecker wrote:
> In the GDB sources, we exclusively use the __CYGWIN__ macro, whereas
> in the simulator sources, we use __CYGWIN32__. The name of the latter
AFAIK, __CYGWIN32__ is deprecated and should not be used; all instances
of it should be changed to simply __CYGWIN__.
Brian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] build powerpc sim for mingw host
2008-02-08 23:05 [PATCH] build powerpc sim for mingw host Dave Murphy
2008-02-13 23:39 ` Joel Brobecker
@ 2008-02-14 0:42 ` Daniel Jacobowitz
1 sibling, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2008-02-14 0:42 UTC (permalink / raw)
To: Dave Murphy; +Cc: gdb-patches
On Fri, Feb 08, 2008 at 11:05:24PM +0000, Dave Murphy wrote:
> -#ifdef __CYGWIN32__
> +#ifdef __WIN32__
> if ((file->size) && ((nr = read(fd, file->buffer, file->size)) <= 0)) {
> #else
> if ((nr = read(fd, file->buffer, file->size)) < file->size) {
What the heck does this accomplish, anyway? For either Cygwin or mingw32.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-02-14 0:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-08 23:05 [PATCH] build powerpc sim for mingw host Dave Murphy
2008-02-13 23:39 ` Joel Brobecker
2008-02-13 23:48 ` Brian Dessent
2008-02-14 0:42 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox