This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: i386 -> powerpc cross-compiler


James Piechota wrote:
> 
> For a little while now I've been trying to build a i386-redhat-linux to
> powerpc-motorola-eabi gcc cross-compiler.
[snip]
> Unfortunately, for the purposes of future uses I must use gcc-2.8.1 and
> gdb-4.17 (ironically gdb-4.18 built smoothly).

Why is this ironic? It's probably for the good reason that someone has made
GDB more portable.

> The error message I got while trying to make gdb is this:
> 
> in file included from /usr/include/sys/ioctl.h:30
>                 from /usr/include/sys/mount.h:27
>                 from ../../../gdb-4.17/sim/ppc/emul_unix.c:113:
> /usr/include/ioctl-types.h:37: redefinition of 'struct termios'
> 
> Part of the problem is that newlib did not have the file 'mount.h' so the
> compiler went looking in /usr/include.

No, emul_unix.c is meant to be compiled on your host system, not your
cross-compiler. If you look you'll see it's compiled by gcc, not
powerpc-motorola-eabi-gcc.

The solution is this trivial patch, which is what's in GDB 4.18:

Index: emul_unix.c
===================================================================
RCS file: /cvs/cvsfiles/devo/sim/ppc/emul_unix.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -5 -p -r1.10 -r1.11
--- emul_unix.c 1998/03/13 01:30:42     1.10
+++ emul_unix.c 1998/06/26 18:22:48     1.11
@@ -107,14 +107,10 @@
 #ifdef HAVE_GETRUSAGE
 #include <sys/resource.h>
 int getrusage();
 #endif
 
-#if HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
-
 #if HAVE_DIRENT_H
 # include <dirent.h>
 # define NAMLEN(dirent) strlen((dirent)->d_name)
 #else
 # define dirent direct


Jifl
-- 
Cygnus Solutions, 35 Cambridge Place, Cambridge, UK.  Tel: +44 (1223) 728762
"I used to have an open mind but || Get yer free open source RTOS's here...
 my brains kept falling out."    || http://sourceware.cygnus.com/ecos
Help fight spam! http://spam.abuse.net/  These opinions are all my own fault
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]