public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* gcc rs6000 target without glibc
@ 2005-03-30 20:22 lothar
  2005-03-30 20:44 ` Andrew Pinski
  0 siblings, 1 reply; 2+ messages in thread
From: lothar @ 2005-03-30 20:22 UTC (permalink / raw)
  To: bug-gcc, geoffk, dje


Hello,

Michael Meissner redirected me to this list, I contacted him because his 
emailaddress was in rs6000/linux.h. I don't know who currently maintains 
this file

I ran into trouble when trying to build a cross compiler for the RS6000 
(target=ppc-linux).

In gcc-3.4.0/gcc/config/rs6000/linux.h there is in line 100:
[--code--]
#include <signal.h>

/* During the 2.5 kernel series the kernel ucontext was changed, but
 the new layout is compatible with the old one, so we just define
 and use the old one here for simplicity and compatibility.  */

struct kernel_old_ucontext {
unsigned long     uc_flags;
struct ucontext  *uc_link;
stack_t           uc_stack;
struct sigcontext_struct uc_mcontext;
sigset_t          uc_sigmask;
};
[--code--]

since there are several signal.h files (glibc, linux-headers) I tried to 
figure out wichone was needed, I tried to use asm/signal.h which, after 
a few changes to rs6000/linux.h is ok. It shouldn't be any signal.h from 
the glibc, because I configured with the option --without-headers. 
size_t wasn't defined (no glibc), so I added this on too. Maybe this 
should be defined somewhere else...

How I configured:
../gcc-3.4.0/configure --prefix=/home/cross/workspace/cross/out/ 
--target=ppc-linux --enable-languages=c  --disable-nls --disable-shared 
--disable-threads --without-headers --with-newlib

How my rs6000/linux.h looks now:
[--code--]
#ifdef IN_LIBGCC2
#include <linux/types.h> /*defines size_t for asm/signal.h*/
#include <asm/signal.h>
#include <asm/siginfo.h> /*defines struct siginfo */

#ifndef sigcontext_struct
/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
*    we need sigcontext.  */
# define sigcontext_struct sigcontext
#include <asm/sigcontext.h>
#endif
#include <asm/ucontext.h>

/* During the 2.5 kernel series the kernel ucontext was changed, but
 the new layout is compatible with the old one, so we just define
 and use the old one here for simplicity and compatibility.  */

struct kernel_old_ucontext {
unsigned long     uc_flags;
struct ucontext*  uc_link;
stack_t           uc_stack;
struct sigcontext_struct uc_mcontext;
sigset_t          uc_sigmask;
};

[--code--]

Maybe someone can take a look at it, I don't know too much about gcc.

Lothar


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gcc rs6000 target without glibc
  2005-03-30 20:22 gcc rs6000 target without glibc lothar
@ 2005-03-30 20:44 ` Andrew Pinski
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Pinski @ 2005-03-30 20:44 UTC (permalink / raw)
  To: lothar; +Cc: bug-gcc, geoffk, dje


On Mar 30, 2005, at 3:22 PM, lothar wrote:

>
> Hello,
>
> Michael Meissner redirected me to this list, I contacted him because 
> his emailaddress was in rs6000/linux.h. I don't know who currently 
> maintains this file
>
> I ran into trouble when trying to build a cross compiler for the 
> RS6000 (target=ppc-linux).
>

Try using cross tools, they help a lot with building a cross compiler 
for
powerpc-linux-gnu (and other linux-gnu targets).

-- Pinski


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-30 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-30 20:22 gcc rs6000 target without glibc lothar
2005-03-30 20:44 ` Andrew Pinski

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