[RFA] Allow binutils compilation for mingw64 with --enable-targets=all

Pierre Muller pierre.muller@ics-cnrs.unistra.fr
Fri Mar 25 21:51:00 GMT 2011


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);



More information about the Binutils mailing list