public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: lothar <lothar.felten@gmx.net>
To: bug-gcc@gcc.gnu.org,  geoffk@geoffk.org,  dje@watson.ibm.com
Subject: gcc rs6000 target without glibc
Date: Wed, 30 Mar 2005 20:22:00 -0000	[thread overview]
Message-ID: <424B0A82.1080803@gmx.net> (raw)


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


             reply	other threads:[~2005-03-30 20:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-30 20:22 lothar [this message]
2005-03-30 20:44 ` Andrew Pinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=424B0A82.1080803@gmx.net \
    --to=lothar.felten@gmx.net \
    --cc=bug-gcc@gcc.gnu.org \
    --cc=dje@watson.ibm.com \
    --cc=geoffk@geoffk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).