* [RFA] Allow binutils compilation for mingw64 with --enable-targets=all
@ 2011-03-25 21:51 Pierre Muller
2011-03-28 10:27 ` Alan Modra
2011-03-29 2:06 ` [RFA] Allow binutils compilation for mingw64 with --enable-targets=all Alan Modra
0 siblings, 2 replies; 8+ messages in thread
From: Pierre Muller @ 2011-03-25 21:51 UTC (permalink / raw)
To: 'Binutils'
Trying to compile Binutils with --enable-targets=all
for mingw64 leads to this error:
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../src/binutils -I.
-I../../src
/binutils -I../bfd -I../../src/binutils/../bfd
-I../../src/binutils/../include -
I./../intl -DLOCALEDIR="\"/usr/local/share/locale\""
-Dbin_dummy_emulation=bin_v
anilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow
-Wn
o-format -Werror -gstabs+ -O0 -D__USE_MINGW_ACCESS -MT coffdump.o -MD -MP
-MF .d
eps/coffdump.Tpo -c -o coffdump.o ../../src/binutils/coffdump.c
cc1: warnings being treated as errors
../../src/binutils/coffdump.c: In function 'dump_coff_scope':
../../src/binutils/coffdump.c:368:37: error: cast from pointer to integer of
dif
ferent size
make[2]: *** [coffdump.o] Error 1
The patch below fixes that compilation error.
Pierre Muller
GDB pascal language maintainer
2011-03-25 Pierre Muller <muller@ics.u-strasbg.fr>
* coffdump.c (dump_coff_scope): Use double typecast for pointer P
to allow compilation for all targets.
Index: coffdump.c
===================================================================
RCS file: /cvs/src/src/binutils/coffdump.c,v
retrieving revision 1.18
diff -u -p -r1.18 coffdump.c
--- coffdump.c 5 Jul 2007 16:54:45 -0000 1.18
+++ coffdump.c 25 Mar 2011 21:34:07 -0000
@@ -365,7 +365,7 @@ dump_coff_scope (struct coff_scope *p)
if (p)
{
tab (1);
- printf ("List of blocks %lx ",(unsigned long) p);
+ printf ("List of blocks %" BFD_VMA_FMT "x ",(bfd_vma) (uintptr_t) p);
if (p->sec)
printf( " %s %x..%x", p->sec->name,p->offset, p->offset + p->size
-1);
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Allow binutils compilation for mingw64 with --enable-targets=all
2011-03-25 21:51 [RFA] Allow binutils compilation for mingw64 with --enable-targets=all Pierre Muller
@ 2011-03-28 10:27 ` Alan Modra
2011-03-28 12:10 ` [RFA] Minor fixes to coffdump.c source Pierre Muller
2011-03-29 2:06 ` [RFA] Allow binutils compilation for mingw64 with --enable-targets=all Alan Modra
1 sibling, 1 reply; 8+ messages in thread
From: Alan Modra @ 2011-03-28 10:27 UTC (permalink / raw)
To: Pierre Muller; +Cc: 'Binutils'
On Fri, Mar 25, 2011 at 10:51:35PM +0100, Pierre Muller wrote:
> * coffdump.c (dump_coff_scope): Use double typecast for pointer P
> to allow compilation for all targets.
OK, thanks!
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 8+ messages in thread
* [RFA] Minor fixes to coffdump.c source
2011-03-28 10:27 ` Alan Modra
@ 2011-03-28 12:10 ` Pierre Muller
2011-03-28 15:05 ` Alan Modra
0 siblings, 1 reply; 8+ messages in thread
From: Pierre Muller @ 2011-03-28 12:10 UTC (permalink / raw)
To: 'Alan Modra'; +Cc: 'Binutils'
> -----Message d'origine-----
> De : binutils-owner@sourceware.org [mailto:binutils-owner@sourceware.org]
De
> la part de Alan Modra
> Envoyé : lundi 28 mars 2011 12:27
> À : Pierre Muller
> Cc : 'Binutils'
> Objet : Re: [RFA] Allow binutils compilation for mingw64 with --enable-
> targets=all
>
> On Fri, Mar 25, 2011 at 10:51:35PM +0100, Pierre Muller wrote:
> > * coffdump.c (dump_coff_scope): Use double typecast for pointer P
> > to allow compilation for all targets.
>
> OK, thanks!
Thanks for the approval,
patch committed.
While doing this, I noticed two mistakes:
May I commit those also?
Pierre
2011-03-28 Pierre Muller <muller@ics.u-strasbg.fr>
* coffdump.c (coff_dump): Correct spelling error.
(show_usage): Replace SYSROFF by COFF.
Index: coffdump.c
===================================================================
RCS file: /cvs/src/src/binutils/coffdump.c,v
retrieving revision 1.19
diff -u -p -r1.19 coffdump.c
--- coffdump.c 28 Mar 2011 11:58:18 -0000 1.19
+++ coffdump.c 28 Mar 2011 12:06:19 -0000
@@ -444,7 +444,7 @@ coff_dump (struct coff_ofile *ptr)
printf ("Coff dump");
nl ();
- printf ("#souces %d", ptr->nsources);
+ printf ("#sources %d", ptr->nsources);
nl ();
dump_coff_sfile (ptr->source_head);
@@ -458,7 +458,7 @@ static void
show_usage (FILE *file, int status)
{
fprintf (file, _("Usage: %s [option(s)] in-file\n"), program_name);
- fprintf (file, _(" Print a human readable interpretation of a SYSROFF
object file\n"));
+ fprintf (file, _(" Print a human readable interpretation of a COFF object
file\n"));
fprintf (file, _(" The options are:\n\
@<file> Read options from <file>\n\
-h --help Display this information\n\
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Minor fixes to coffdump.c source
2011-03-28 12:10 ` [RFA] Minor fixes to coffdump.c source Pierre Muller
@ 2011-03-28 15:05 ` Alan Modra
2011-03-28 15:24 ` Pierre Muller
0 siblings, 1 reply; 8+ messages in thread
From: Alan Modra @ 2011-03-28 15:05 UTC (permalink / raw)
To: Pierre Muller; +Cc: 'Binutils'
On Mon, Mar 28, 2011 at 02:10:07PM +0200, Pierre Muller wrote:
> * coffdump.c (coff_dump): Correct spelling error.
> (show_usage): Replace SYSROFF by COFF.
Please commit.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [RFA] Minor fixes to coffdump.c source
2011-03-28 15:05 ` Alan Modra
@ 2011-03-28 15:24 ` Pierre Muller
0 siblings, 0 replies; 8+ messages in thread
From: Pierre Muller @ 2011-03-28 15:24 UTC (permalink / raw)
To: 'Alan Modra'; +Cc: 'Binutils'
> -----Message d'origine-----
> De : Alan Modra [mailto:amodra@gmail.com]
> Envoyé : lundi 28 mars 2011 17:06
> À : Pierre Muller
> Cc : 'Binutils'
> Objet : Re: [RFA] Minor fixes to coffdump.c source
>
> On Mon, Mar 28, 2011 at 02:10:07PM +0200, Pierre Muller wrote:
> > * coffdump.c (coff_dump): Correct spelling error.
> > (show_usage): Replace SYSROFF by COFF.
>
> Please commit.
Thank you for the approval.
Patch cheked in.
Pierre Muller
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Allow binutils compilation for mingw64 with --enable-targets=all
2011-03-25 21:51 [RFA] Allow binutils compilation for mingw64 with --enable-targets=all Pierre Muller
2011-03-28 10:27 ` Alan Modra
@ 2011-03-29 2:06 ` Alan Modra
1 sibling, 0 replies; 8+ messages in thread
From: Alan Modra @ 2011-03-29 2:06 UTC (permalink / raw)
To: Pierre Muller; +Cc: 'Binutils'
On Fri, Mar 25, 2011 at 10:51:35PM +0100, Pierre Muller wrote:
> * coffdump.c (dump_coff_scope): Use double typecast for pointer P
> to allow compilation for all targets.
I missed this when reviewing. For systems that don't have uintptr_t.
* coffdump.c: Include bfd_stdint.h
Index: binutils/coffdump.c
===================================================================
RCS file: /cvs/src/src/binutils/coffdump.c,v
retrieving revision 1.20
diff -u -p -r1.20 coffdump.c
--- binutils/coffdump.c 28 Mar 2011 15:24:02 -0000 1.20
+++ binutils/coffdump.c 29 Mar 2011 02:05:02 -0000
@@ -1,6 +1,6 @@
/* Coff file dumper.
- Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007,
+ 2011 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -27,6 +27,7 @@
#include "sysdep.h"
#include "bfd.h"
+#include "bfd_stdint.h"
#include "libiberty.h"
#include "bucomm.h"
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [RFA] Allow binutils compilation for mingw64 with --enable-targets=all
2011-03-26 8:48 ` Kai Tietz
@ 2011-03-26 9:57 ` Pierre Muller
0 siblings, 0 replies; 8+ messages in thread
From: Pierre Muller @ 2011-03-26 9:57 UTC (permalink / raw)
To: 'Binutils'
> > - printf ("List of blocks %lx ",(unsigned long) p);
> > + printf ("List of blocks %" BFD_VMA_FMT "x ",(bfd_vma) (uintptr_t)
> p);
> I can't approve this. Yes, thanks for catching this. But is it really
> necessary to do the uintptr_t cast before the final bfd_vma cast?
> bfd_vma should be always >= sizeof (void *), isn't it?
I think that you get a warning as soon as the
size is different, and typically on a 32-bit system
with 64-bit bfd enabled, bfd_vma will be
a 64-bit integer and p a 32-bit pointer, which will generate
a warning that is suppressed by this double typecast.
Pierre Muller
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Allow binutils compilation for mingw64 with --enable-targets=all
[not found] <940251302432625851@unknownmsgid>
@ 2011-03-26 8:48 ` Kai Tietz
2011-03-26 9:57 ` Pierre Muller
0 siblings, 1 reply; 8+ messages in thread
From: Kai Tietz @ 2011-03-26 8:48 UTC (permalink / raw)
To: Pierre Muller; +Cc: Binutils
2011/3/25 Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>:
> Trying to compile Binutils with --enable-targets=all
> for mingw64 leads to this error:
> x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../src/binutils -I.
> -I../../src
> /binutils -I../bfd -I../../src/binutils/../bfd
> -I../../src/binutils/../include -
> I./../intl -DLOCALEDIR="\"/usr/local/share/locale\""
> -Dbin_dummy_emulation=bin_v
> anilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow
> -Wn
> o-format -Werror -gstabs+ -O0 -D__USE_MINGW_ACCESS -MT coffdump.o -MD -MP
> -MF .d
> eps/coffdump.Tpo -c -o coffdump.o ../../src/binutils/coffdump.c
> cc1: warnings being treated as errors
> ../../src/binutils/coffdump.c: In function 'dump_coff_scope':
> ../../src/binutils/coffdump.c:368:37: error: cast from pointer to integer of
> dif
> ferent size
> make[2]: *** [coffdump.o] Error 1
>
>
> The patch below fixes that compilation error.
>
>
>
> Pierre Muller
> GDB pascal language maintainer
>
> 2011-03-25 Pierre Muller <muller@ics.u-strasbg.fr>
>
> * coffdump.c (dump_coff_scope): Use double typecast for pointer P
> to allow compilation for all targets.
>
> Index: coffdump.c
> ===================================================================
> RCS file: /cvs/src/src/binutils/coffdump.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 coffdump.c
> --- coffdump.c 5 Jul 2007 16:54:45 -0000 1.18
> +++ coffdump.c 25 Mar 2011 21:34:07 -0000
> @@ -365,7 +365,7 @@ dump_coff_scope (struct coff_scope *p)
> if (p)
> {
> tab (1);
> - printf ("List of blocks %lx ",(unsigned long) p);
> + printf ("List of blocks %" BFD_VMA_FMT "x ",(bfd_vma) (uintptr_t) p);
>
> if (p->sec)
> printf( " %s %x..%x", p->sec->name,p->offset, p->offset + p->size
> -1);
>
>
I can't approve this. Yes, thanks for catching this. But is it really
necessary to do the uintptr_t cast before the final bfd_vma cast?
bfd_vma should be always >= sizeof (void *), isn't it?
Kai
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-03-29 2:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-25 21:51 [RFA] Allow binutils compilation for mingw64 with --enable-targets=all Pierre Muller
2011-03-28 10:27 ` Alan Modra
2011-03-28 12:10 ` [RFA] Minor fixes to coffdump.c source Pierre Muller
2011-03-28 15:05 ` Alan Modra
2011-03-28 15:24 ` Pierre Muller
2011-03-29 2:06 ` [RFA] Allow binutils compilation for mingw64 with --enable-targets=all Alan Modra
[not found] <940251302432625851@unknownmsgid>
2011-03-26 8:48 ` Kai Tietz
2011-03-26 9:57 ` Pierre Muller
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).