linux/compat.h includes asm/signal.h causing problems
On some platforms, including sparc64, asm/signal.h needs compat_sigset_t, but this is defined in linux/compat.h after asm/signal.h is included.
Andrew, aren't you doing sparc64 cross builds these days? :-)
This came from 3f2e05e90e0846c42626e3d272454f26be34a1bc
[PATCH] BLOCK: Revert patch to hack around undeclared sigset_t in linux/compat.h
Revert Andrew Morton's patch to temporarily hack around the lack of a declaration of sigset_t in linux/compat.h to make the block-disablement patches build on IA64. This got accidentally pushed to Linus and should be fixed in a different manner.
Also make linux/compat.h #include asm/signal.h to gain a definition of sigset_t so that it can externally declare sigset_from_compat().
This has been compile-tested for i386, x86_64, ia64, mips, mips64, frv, ppc and ppc64 and run-tested on frv.
It figures that one of the platforms it wasn't compile tested on is the one that breaks :-)
Quoted 19 lines · On Mon, 02 Oct 2006 13:14:14 -0700 (PDT) David Miller <[email protected]>…
On some platforms, including sparc64,
asm/signal.hneedscompat_sigset_t, but this is defined inlinux/compat.hafterasm/signal.his included.Andrew, aren't you doing sparc64 cross builds these days? :-)
This came from
3f2e05e90e0846c42626e3d272454f26be34a1bc[PATCH] BLOCK: Revert patch to hack around undeclared
sigset_tinlinux/compat.hRevert Andrew Morton's patch to temporarily hack around the lack of a declaration of
sigset_tinlinux/compat.hto make the block-disablement patches build on IA64. This got accidentally pushed to Linus and should be fixed in a different manner.Also make
linux/compat.h#includeasm/signal.hto gain a definition ofsigset_tso that it can externally declaresigset_from_compat().
Quoted 8 lines
This has been compile-tested for i386,
x86_64, ia64, mips, mips64, frv, ppc and ppc64 and run-tested on frv.Signed-off-by David Howells <[email protected]>Signed-off-by Linus Torvalds <[email protected]>It figures that one of the platforms it wasn't compile tested on is the one that breaks :-)
not me, boss - I told 'em that using sigset_t in compat.h was a minefield. sparc64 built OK with my hack-shouldnt-be-merged patch applied, which is how it was tested in -mm.
I don't know what a good fix is, really. I guess one could put the declaration of sigset_from_compat() into its own header file and include that header from the right places.
From: Andrew Morton <[email protected]>
Date: Mon, 2 Oct 2006 13:50:36 -0700
Quoted 3 lines
I don't know what a good fix is, really. I guess one could put the declaration of
sigset_from_compat()into its own header file and include that header from the right places.
I'm working on a patch that puts the compat signal bits into include/asm-sparc64/compat_signal.h and adds the necessary includes to a few *.c files under arch/sparc64 when needed.
From: David Miller <[email protected]>
Date: Mon, 02 Oct 2006 14:04:37 -0700 (PDT)
Quoted 10 lines
From: Andrew Morton <[email protected]>
Date: Mon, 2 Oct 2006 13:50:36 -0700Quoted 3 lines
I don't know what a good fix is, really. I guess one could put the declaration of
sigset_from_compat()into its own header file and include that header from the right places.I'm working on a patch that puts the compat signal bits into
include/asm-sparc64/compat_signal.hand adds the necessary includes to a few *.c files underarch/sparc64when needed.
Ok, this seems to work and is what I'll sent to Linus.
commit 0c2d4569948a93fac01a17e191ede4f754607a4a
Author: David S. Miller <[email protected]> Date: Mon Oct 2 14:17:57 2006 -0700
[SPARC64]: Move signal compat bits to new header file.
Create asm-sparc64/compat_signal.h and stuff things there.
This avoids the "linux/compat.h includes asm/signal.h but asm/signal.h needs compat_sigset_t which isn't defined yet" problems introduced recently.
arch/sparc64/kernel/signal32.c +1 -0
@@ -29,6 +29,7 @@ #include <asm/pgtable.h>#include <asm/psrcompat.h> #include <asm/fpumacro.h> #include <asm/visasm.h> +#include <asm/compat_signal.h> #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
arch/sparc64/kernel/sys_sparc32.c +1 -0
@@ -61,6 +61,7 @@ #include <asm/fpumacro.h>#include <asm/semaphore.h> #include <asm/mmu_context.h> #include <asm/a.out.h> +#include <asm/compat_signal.h> asmlinkage long sys32_chown16 (const char __user * filename,u16 user,u16 group) {
arch/sparc64/kernel/sys_sunos32.c +1 -0
@@ -43,6 +43,7 @@ #include <asm/pconf.h>#include <asm/idprom.h> /* for gethostid() */ #include <asm/unistd.h> #include <asm/system.h> +#include <asm/compat_signal.h> /* For the nfs mount emulation */ #include <linux/socket.h>
include/asm-sparc64/compat_signal.h new file +30 -0
@@ -0,0 +1,30 @@ +#ifndef _COMPAT_SIGNAL_H +#define _COMPAT_SIGNAL_H + +#include <linux/config.h> +#include <linux/compat.h> +#include <asm/signal.h> + +#ifdef CONFIG_COMPAT +struct __new_sigaction32 { +unsigned sa_handler; +unsigned int sa_flags; +unsigned sa_restorer;/* not used by Linux/SPARC yet */ +compat_sigset_t sa_mask; +}; + +struct __old_sigaction32 { +unsigned sa_handler; +compat_old_sigset_t sa_mask; +unsigned int sa_flags; +unsigned sa_restorer;/* not used by Linux/SPARC yet */ +}; + +typedef struct sigaltstack32 { +u32 ss_sp; +int ss_flags; +compat_size_t ss_size; +}stack_t32 ; +#endif + +#endif /* !(_COMPAT_SIGNAL_H) */
include/asm-sparc64/signal.h +4 -37
59 lines not on this page · raw message
Quoted 5 lines · David Miller
Quoted 3 lines
I'm working on a patch that puts the compat signal bits into
include/asm-sparc64/compat_signal.hand adds the necessary includes to a few *.c files underarch/sparc64when needed.Ok, this seems to work and is what I'll sent to Linus.
Do you have an x86-hosted or an x86_64-hosted cross-compiler that targets sparc/sparc64?
David
Quoted 10 lines · David Howells
Quoted 5 lines · David Miller
Quoted 3 lines
I'm working on a patch that puts the compat signal bits into
include/asm-sparc64/compat_signal.hand adds the necessary includes to a few *.c files underarch/sparc64when needed.Ok, this seems to work and is what I'll sent to Linus.
Do you have an x86-hosted or an x86_64-hosted cross-compiler that targets sparc/sparc64?
I do, it's not a problem...
Quoted 1 line · Al Viro
I do, it's not a problem...
Actually, I was asking for myself. Can I grab a copy?
David
Quoted 6 lines · On Tue, 03 Oct 2006 13:21:19 +0100 David Howells <[email protected]> wrote:
Quoted 1 line · Al Viro
I do, it's not a problem...
Actually, I was asking for myself. Can I grab a copy?
x86 binaries:
http://userweb.kernel.org/~akpm/sparc-cross.tar.bz2
http://userweb.kernel.org/~akpm/sparc64-cross.tar.bz2
script to run them:
#!/bin/sh
if [ x$ARCH == x ]
then
echo '$ARCH' unset
exit 1
fi
if [ x$J == x ]
then
J=256
fi
if [ x"$DISTCC_HOSTS" != x ]
then
DISTCC="distcc"
fi
XARCH="$ARCH-unknown-linux-gnu"
I=vmlinux
[ $ARCH = alpha ] && CT=gcc-4.1.0-glibc-2.3.6
[ $ARCH = arm ] && CT=gcc-3.4.5-glibc-2.3.6
[ $ARCH = i386 ] && CT=gcc-4.1.0-glibc-2.3.6 && XARCH=i686-unknown-linux-gnu && I=bzImage
[ $ARCH = ia64 ] && CT=gcc-3.4.5-glibc-2.3.6
[ $ARCH = m68k ] && CT=gcc-4.1.0-glibc-2.3.6
[ $ARCH = mips ] && CT=gcc-3.4.5-glibc-2.3.6
[ $ARCH = powerpc ] && CT=gcc-4.1.0-glibc-2.3.6 && XARCH=powerpc-405-linux-gnu
[ $ARCH = s390 ] && CT=gcc-4.1.0-glibc-2.3.6
[ $ARCH = sh ] && CT=gcc-3.4.5-glibc-2.3.6 && XARCH=sh4-unknown-linux-gnu
[ $ARCH = sparc ] && CT=gcc-4.1.0-glibc-2.3.6
[ $ARCH = sparc64 ] && CT=gcc-3.4.5-glibc-2.3.6
[ $ARCH = x86_64 ] && CT=gcc-4.0.2-glibc-2.3.6 && I=bzImage
[ $ARCH = parisc ] && CT=gcc-4.0.2-glibc-2.3.6 && I=bzImage
if [ $# -eq 0 ]
then
WHAT="$I modules"
else
WHAT="$*"
fi
PATH=$PATH:/opt/crosstool/$CT/$XARCH/bin export PATH
export CROSS_COMPILE=/opt/crosstool/$CT/$XARCH/bin/$XARCH-
export CC="$DISTCC /opt/crosstool/$CT/$XARCH/bin/$XARCH-gcc"
if [ "$ECHO" != "" ]
then
echo CROSS_COMPILE=$CROSS_COMPILE CC=\"$CC\" make -j$J $* CC=\"$CC\" $WHAT else nice -20 make -j$J $* CC="$CC" $WHAT 2>/tmp/log-$ARCH || FAILED=1
fi
cat /tmp/log-$ARCH
[ "$FAILED" != "" ] && echo "**FAILED**"