linux-mips
[Top] [All Lists]

Re: Include coherency problem, sigaction and otherwise

To: "Kevin D. Kissell" <kevink@mips.com>
Subject: Re: Include coherency problem, sigaction and otherwise
From: "William J. Earl" <wje@cthulhu.engr.sgi.com>
Date: Fri, 17 Mar 2000 10:02:56 -0800 (PST)
Cc: "SGI Linux Alias" <linux@cthulhu.engr.sgi.com>
In-reply-to: <00b801bf902c$ddb30140$0ceca8c0@satanas.mips.com>
References: <00b801bf902c$ddb30140$0ceca8c0@satanas.mips.com>
Sender: owner-linuxmips@oss.sgi.com
Kevin D. Kissell writes:
 > Invesitgating some non-fatal but odd behaviour, we
 > have traced it to the fact that the defintions of various
 > sigaction flags are defined for MIPS/Linux user code
 > in /usr/include/sigaction.h, but defined for the kernel in
 > /usr/include/asm/signal.h, and that the two definitions
 > are not consistent.  Does anyone know how this
 > came about?  
 > 
 > I have the impresson that the /usr/include stuff in the 
 > "Hard Hat" distribution for MIPS is keyed to a 2.0.x kernel, 
 > and that an update of /usr/include (as opposed to a downgrade 
 > of the kernel headers) may be in order.    Frankly, I don't like 
 > the fact that the user and kernel includes don't pull everything 
 > out of common files in include/linux and include/asm - I suppose 
 > it must have been to reduce the number of compilations
 > that depend on kernel includes - but I don't see that
 > we can do much about that from here in MIPS-land.

      As near as I can tell, at least for glibc-2.1.1-7, there
is not machine-dependent <bits/sigaction.h> for mips, so the
generic one is used, and the definitions are incompatible with the
MIPS ABI.  The Linux kernel, on the other hand, is compatible with the
MIPS ABI.  The cure is to supply a MIPS-specific <bits/sigaction.h>.
In particular, we need for mips:

/* Bits in `sa_flags'.  */
#if defined __USE_UNIX98 || defined __USE_MISC
# define SA_ONSTACK     0x0001  /* Take signal on signal stack.  */
# define SA_RESTART     0x0004  /* Restart syscall on signal return.  */
#endif
#define SA_NOCLDSTOP    0x20000 /* Don't send SIGCHLD when children stop.  */

instead of the generic:

/* Bits in `sa_flags'.  */
#if defined __USE_UNIX98 || defined __USE_MISC
# define SA_ONSTACK     0x0001  /* Take signal on signal stack.  */
# define SA_RESTART     0x0002  /* Restart syscall on signal return.  */
#endif
#define SA_NOCLDSTOP    0x0008  /* Don't send SIGCHLD when children stop.  */

This is just a symptom of the somewhat weak MIPS support in glibc and
binutils.

The generic source file is 

    glibc/sysdeps/generic/bits/sigaction.h

and the MIPS source file would be

    glibc/sysdeps/mips/bits/sigaction.h

THere are probably other incompatibilities to be weeded out.

<Prev in Thread] Current Thread [Next in Thread>