This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc rs6000 target without glibc



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


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