* linux/compat.h includes asm/signal.h causing problems
@ 2006-10-02 20:14 David Miller
2006-10-02 20:50 ` Andrew Morton
0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2006-10-02 20:14 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel
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.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
It figures that one of the platforms it wasn't compile tested on is
the one that breaks :-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: linux/compat.h includes asm/signal.h causing problems
2006-10-02 20:14 linux/compat.h includes asm/signal.h causing problems David Miller
@ 2006-10-02 20:50 ` Andrew Morton
2006-10-02 21:04 ` David Miller
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2006-10-02 20:50 UTC (permalink / raw)
To: David Miller; +Cc: linux-kernel, David Howells, Jens Axboe
On Mon, 02 Oct 2006 13:14:14 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
>
> 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.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
>
> 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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: linux/compat.h includes asm/signal.h causing problems
2006-10-02 20:50 ` Andrew Morton
@ 2006-10-02 21:04 ` David Miller
2006-10-02 21:18 ` David Miller
2006-10-03 9:45 ` David Howells
0 siblings, 2 replies; 8+ messages in thread
From: David Miller @ 2006-10-02 21:04 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, dhowells, axboe
From: Andrew Morton <akpm@osdl.org>
Date: Mon, 2 Oct 2006 13:50:36 -0700
> 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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: linux/compat.h includes asm/signal.h causing problems
2006-10-02 21:04 ` David Miller
@ 2006-10-02 21:18 ` David Miller
2006-10-03 9:45 ` David Howells
1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2006-10-02 21:18 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, dhowells, axboe
From: David Miller <davem@davemloft.net>
Date: Mon, 02 Oct 2006 14:04:37 -0700 (PDT)
> From: Andrew Morton <akpm@osdl.org>
> Date: Mon, 2 Oct 2006 13:50:36 -0700
>
> > 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.
Ok, this seems to work and is what I'll sent to Linus.
commit 0c2d4569948a93fac01a17e191ede4f754607a4a
Author: David S. Miller <davem@sunset.davemloft.net>
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.
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
index 708ba9b..c45f21b 100644
--- a/arch/sparc64/kernel/signal32.c
+++ b/arch/sparc64/kernel/signal32.c
@@ -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)))
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 69444f2..7c6499c 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -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)
{
diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c
index 953296b..b21e8dd 100644
--- a/arch/sparc64/kernel/sys_sunos32.c
+++ b/arch/sparc64/kernel/sys_sunos32.c
@@ -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>
diff --git a/include/asm-sparc64/compat_signal.h b/include/asm-sparc64/compat_signal.h
new file mode 100644
index 0000000..7aefa30
--- /dev/null
+++ b/include/asm-sparc64/compat_signal.h
@@ -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) */
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
index 9968871..b695d08 100644
--- a/include/asm-sparc64/signal.h
+++ b/include/asm-sparc64/signal.h
@@ -167,23 +167,6 @@ struct __new_sigaction {
__new_sigset_t sa_mask;
};
-#ifdef __KERNEL__
-
-#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;
-};
-#endif
-
-struct k_sigaction {
- struct __new_sigaction sa;
- void __user *ka_restorer;
-};
-#endif
-
struct __old_sigaction {
__sighandler_t sa_handler;
__old_sigset_t sa_mask;
@@ -191,19 +174,6 @@ struct __old_sigaction {
void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
};
-#ifdef __KERNEL__
-
-#ifdef CONFIG_COMPAT
-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 */
-};
-#endif
-
-#endif
-
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
@@ -212,13 +182,10 @@ typedef struct sigaltstack {
#ifdef __KERNEL__
-#ifdef CONFIG_COMPAT
-typedef struct sigaltstack32 {
- u32 ss_sp;
- int ss_flags;
- compat_size_t ss_size;
-} stack_t32;
-#endif
+struct k_sigaction {
+ struct __new_sigaction sa;
+ void __user *ka_restorer;
+};
struct signal_deliver_cookie {
int restart_syscall;
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: linux/compat.h includes asm/signal.h causing problems
2006-10-02 21:04 ` David Miller
2006-10-02 21:18 ` David Miller
@ 2006-10-03 9:45 ` David Howells
2006-10-03 10:54 ` Al Viro
2006-10-03 12:21 ` David Howells
1 sibling, 2 replies; 8+ messages in thread
From: David Howells @ 2006-10-03 9:45 UTC (permalink / raw)
To: David Miller; +Cc: akpm, linux-kernel, dhowells, axboe
David Miller <davem@davemloft.net> wrote:
> > 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.
>
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: linux/compat.h includes asm/signal.h causing problems
2006-10-03 9:45 ` David Howells
@ 2006-10-03 10:54 ` Al Viro
2006-10-03 12:21 ` David Howells
1 sibling, 0 replies; 8+ messages in thread
From: Al Viro @ 2006-10-03 10:54 UTC (permalink / raw)
To: David Howells; +Cc: David Miller, akpm, linux-kernel, axboe
On Tue, Oct 03, 2006 at 10:45:25AM +0100, David Howells wrote:
> David Miller <davem@davemloft.net> wrote:
>
> > > 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.
> >
> > 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...
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: linux/compat.h includes asm/signal.h causing problems
2006-10-03 9:45 ` David Howells
2006-10-03 10:54 ` Al Viro
@ 2006-10-03 12:21 ` David Howells
2006-10-03 17:01 ` Andrew Morton
1 sibling, 1 reply; 8+ messages in thread
From: David Howells @ 2006-10-03 12:21 UTC (permalink / raw)
To: Al Viro; +Cc: David Howells, David Miller, akpm, linux-kernel, axboe
Al Viro <viro@ftp.linux.org.uk> wrote:
> I do, it's not a problem...
Actually, I was asking for myself. Can I grab a copy?
David
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: linux/compat.h includes asm/signal.h causing problems
2006-10-03 12:21 ` David Howells
@ 2006-10-03 17:01 ` Andrew Morton
0 siblings, 0 replies; 8+ messages in thread
From: Andrew Morton @ 2006-10-03 17:01 UTC (permalink / raw)
To: David Howells; +Cc: Al Viro, David Miller, linux-kernel, axboe
On Tue, 03 Oct 2006 13:21:19 +0100
David Howells <dhowells@redhat.com> wrote:
> Al Viro <viro@ftp.linux.org.uk> wrote:
>
> > 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**"
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-10-03 17:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-02 20:14 linux/compat.h includes asm/signal.h causing problems David Miller
2006-10-02 20:50 ` Andrew Morton
2006-10-02 21:04 ` David Miller
2006-10-02 21:18 ` David Miller
2006-10-03 9:45 ` David Howells
2006-10-03 10:54 ` Al Viro
2006-10-03 12:21 ` David Howells
2006-10-03 17:01 ` Andrew Morton
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 NNTP newsgroup(s).