The line that fails is memcpy (lwpstat.pr_context.uc_mcontext.gregs,gregs, sizeof (lwpstat.pr_context.uc_mcontext.gregs)); The problem: On Linux mcontext_t is defined as follows /* Container for all general registers. */ typedef greg_t gregset_t[NGREG]; /* Context to describe whole processor state. */ typedef struct { gregset_t gregs; /* Due to Linux's history we have to use a pointer here. The SysV/i386 ABI requires a struct with the values. */ fpregset_t fpregs; unsigned long int oldmask; unsigned long int cr2; } mcontext_t; So gregs ends up being an array pointer. On Interix (and possibly other Unices if the comment is to be believed) #ifdef _M_ALPHA typedef struct { u_quad_t fpregs[32]; /* floating point registers */ u_quad_t gregs[32]; /* general registers */ u_quad_t fpcr; /* floating point control register */ u_quad_t softfpcr; /* software extension to FPCR */ u_quad_t fir; /* fault instruction continuation address */ unsigned int psr; /* processor status */ unsigned int reserved[5]; } gregset_t; #endif /* _M_ALPHA */ [...other architecture definitions follow] typedef union { gregset_t gregs; fpregset_t fpregs; } mcontext_t; I think the solution is memcpy (&lwpstat.pr_context.uc_mcontext.gregs,gregs, sizeof (lwpstat.pr_context.uc_mcontext.gregs)); which passes a pointer to memcpy instead. Reproducible: Always Steps to Reproduce: 1.emerge binutils or emerge gdb 2. 3. Actual Results: make[4]: Entering directory `/opt/gentoo/var/tmp/portage/sys-devel/gdb-7.0.1/work/gdb-7.0.1/bfd' sh ./libtool --tag=CC --mode=compile i586-pc-interix6.0-gcc -DHAVE_CONFIG_H -I. -DSTRICT_PE_FORMAT -I. -I. -I./../include -DBINDIR='"/opt/gentoo/usr/bin"' -D_ALL_SOURCE -D_REENTRANT -W -Wall -Wstrict-prototypes -Wmissing-prototypes -D_ALL_SOURCE -D_REENTRANT -MT elf.lo -MD -MP -MF .deps/elf.Tpo -c -o elf.lo elf.c libtool: compile: i586-pc-interix6.0-gcc -DHAVE_CONFIG_H -I. -DSTRICT_PE_FORMAT -I. -I. -I./../include -DBINDIR=\"/opt/gentoo/usr/bin\" -D_ALL_SOURCE -D_REENTRANT -W -Wall -Wstrict-prototypes -Wmissing-prototypes -D_ALL_SOURCE -D_REENTRANT -MT elf.lo -MD -MP -MF .deps/elf.Tpo -c elf.c -o elf.o elf.c: In function 'elfcore_write_lwpstatus': elf.c:8522: error: incompatible type for argument 1 of 'memcpy'
you should really forget about gdb... i tried to get this to work for quite some time, and had absolutely no success. reading the patches microsoft had for the 10 years old gdb doesn't help either, since all of gdb was completely revamped in the meantime. also, it would be helpfull to know which binutils version you're trying to build, and whats your emerge --info (did you set extra USE flags too?)...
Oops, this was caused by USE="multitarget". Perhaps this should be masked?
(In reply to comment #2) > Oops, this was caused by USE="multitarget". Perhaps this should be masked? > Ok, then don't close the bug such that no one will remember to look for it again ;)
Masked it for Interix