2004-03-15 13:36:18

by Wojciech 'Sas' Cieciwa

[permalink] [raw]
Subject: [SPARC64][PPC] strange error ..

I try to build 2.6.4 + cset-20040314_2208
on SPARC64 and got error:

[...]
CHK include/linux/version.h
UPD include/linux/version.h
SYMLINK include/asm -> include/asm-sparc64
HOSTCC scripts/fixdep
HOSTCC scripts/split-include
HOSTCC scripts/conmakehash
HOSTCC scripts/docproc
HOSTCC scripts/kallsyms
CC scripts/empty.o
HOSTCC scripts/mk_elfconfig
MKELF scripts/elfconfig.h
HOSTCC scripts/file2alias.o
HOSTCC scripts/modpost.o
HOSTCC scripts/sumversion.o
HOSTLD scripts/modpost
HOSTCC scripts/pnmtologo
HOSTCC scripts/bin2c
make[2]: `scripts/fixdep' is up to date.
SHIPPED scripts/kconfig/zconf.tab.h
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/mconf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
HOSTCC -fPIC scripts/kconfig/zconf.tab.o
HOSTLLD -shared scripts/kconfig/libkconfig.so
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -s arch/sparc64/Kconfig
#
# using defaults found in .config
#
SPLIT include/linux/autoconf.h -> include/config/*
CC init/main.o
CHK include/linux/compile.h
UPD include/linux/compile.h
CC init/version.o
CC init/do_mounts.o
CC init/do_mounts_devfs.o
CC init/do_mounts_rd.o
CC init/do_mounts_initrd.o
In file included from include/linux/unistd.h:9,
from init/do_mounts_initrd.c:2:
include/asm/unistd.h:446: syntax error before "unsigned"
include/asm/unistd.h:451: syntax error before "long"
make[1]: *** [init/do_mounts_initrd.o] Error 1
make: *** [init] Error 2

line 446 is:
asmlinkage unsigned long sys_mmap(
unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long off);

line 451:
asmlinkage long sys_rt_sigaction(int sig,
const struct sigaction __user *act,
struct sigaction __user *oact,
void __user *restorer,
size_t sigsetsize);


When I add to init/do_mounts_initrd.c
#include <linux/linkage.h> before unistd.h
All looks like OK.
This is bug, or I miss something?

Thanx.
Sas.
--
{Wojciech 'Sas' Cieciwa} {Member of PLD Team }
{e-mail: [email protected], http://www2.zarz.agh.edu.pl/~cieciwa}


2004-03-15 18:37:21

by Wojciech 'Sas' Cieciwa

[permalink] [raw]
Subject: Re: [SPARC64][PPC] strange error ..

OK. here is trivial fix:

--- linux-2.6.4/init/do_mounts_initrd.c.org 2004-03-15 09:24:58.000000000 +0100
+++ linux-2.6.4/init/do_mounts_initrd.c 2004-03-15 19:35:50.186528400 +0100
@@ -1,6 +1,6 @@
#define __KERNEL_SYSCALLS__
-#include <linux/unistd.h>
#include <linux/kernel.h>
+#include <linux/unistd.h>
#include <linux/fs.h>
#include <linux/minix_fs.h>
#include <linux/ext2_fs.h>

--
{Wojciech 'Sas' Cieciwa} {Member of PLD Team }
{e-mail: [email protected], http://www2.zarz.agh.edu.pl/~cieciwa}

2004-03-15 19:00:44

by Tom Rini

[permalink] [raw]
Subject: Re: [SPARC64][PPC] strange error ..

On Mon, Mar 15, 2004 at 07:41:57PM +0100, Wojciech 'Sas' Cieciwa wrote:

> OK. here is trivial fix:
>
> --- linux-2.6.4/init/do_mounts_initrd.c.org 2004-03-15 09:24:58.000000000 +0100
> +++ linux-2.6.4/init/do_mounts_initrd.c 2004-03-15 19:35:50.186528400 +0100
> @@ -1,6 +1,6 @@
> #define __KERNEL_SYSCALLS__
> -#include <linux/unistd.h>
> #include <linux/kernel.h>
> +#include <linux/unistd.h>
> #include <linux/fs.h>
> #include <linux/minix_fs.h>
> #include <linux/ext2_fs.h>

That leaves the more general problem of <asm/unistd.h> uses 'asmlinkage'
on platforms where either (or both) of the following can be true:
- 'asmlinkage' is a meaningless term, and shouldn't be used.
- <asm/unistd.h> doesn't include <linux/linkage.h> so it's possible
another file down the line breaks.

--
Tom Rini
http://gate.crashing.org/~trini/

2004-03-15 20:40:06

by David Miller

[permalink] [raw]
Subject: Re: [SPARC64][PPC] strange error ..

On Mon, 15 Mar 2004 12:00:26 -0700
Tom Rini <[email protected]> wrote:

> That leaves the more general problem of <asm/unistd.h> uses 'asmlinkage'
> on platforms where either (or both) of the following can be true:
> - 'asmlinkage' is a meaningless term, and shouldn't be used.
> - <asm/unistd.h> doesn't include <linux/linkage.h> so it's possible
> another file down the line breaks.

I think the best fix is to include linux/linkage.h in asm/unistd.h as
you seem to be suggesting, and therefore that is the change I will
push off to Linus to fix this on sparc32 and sparc64.

2004-03-15 20:43:51

by Tom Rini

[permalink] [raw]
Subject: Re: [SPARC64][PPC] strange error ..

On Mon, Mar 15, 2004 at 12:39:53PM -0800, David S. Miller wrote:

> On Mon, 15 Mar 2004 12:00:26 -0700
> Tom Rini <[email protected]> wrote:
>
> > That leaves the more general problem of <asm/unistd.h> uses 'asmlinkage'
> > on platforms where either (or both) of the following can be true:
> > - 'asmlinkage' is a meaningless term, and shouldn't be used.
> > - <asm/unistd.h> doesn't include <linux/linkage.h> so it's possible
> > another file down the line breaks.
>
> I think the best fix is to include linux/linkage.h in asm/unistd.h as
> you seem to be suggesting, and therefore that is the change I will
> push off to Linus to fix this on sparc32 and sparc64.

Erm, if I read include/asm-sparc{,64}/linkage.h right, 'asmlinkage' ends
up being defined to ''. So why not just remove 'asmlinkage' from the
offending line in unistd.h ?

--
Tom Rini
http://gate.crashing.org/~trini/

2004-03-15 20:57:08

by Randy.Dunlap

[permalink] [raw]
Subject: Re: [SPARC64][PPC] strange error ..

On Mon, 15 Mar 2004 13:43:46 -0700 Tom Rini wrote:

| On Mon, Mar 15, 2004 at 12:39:53PM -0800, David S. Miller wrote:
|
| > On Mon, 15 Mar 2004 12:00:26 -0700
| > Tom Rini <[email protected]> wrote:
| >
| > > That leaves the more general problem of <asm/unistd.h> uses 'asmlinkage'
| > > on platforms where either (or both) of the following can be true:
| > > - 'asmlinkage' is a meaningless term, and shouldn't be used.
| > > - <asm/unistd.h> doesn't include <linux/linkage.h> so it's possible
| > > another file down the line breaks.
| >
| > I think the best fix is to include linux/linkage.h in asm/unistd.h as
| > you seem to be suggesting, and therefore that is the change I will
| > push off to Linus to fix this on sparc32 and sparc64.
|
| Erm, if I read include/asm-sparc{,64}/linkage.h right, 'asmlinkage' ends
| up being defined to ''. So why not just remove 'asmlinkage' from the
| offending line in unistd.h ?

For future-proofing: so that it will be like all other $arch/unistd.h,
so that when someone changes the meaning of it, it will just work...?

--
~Randy

2004-03-15 21:08:15

by Tom Rini

[permalink] [raw]
Subject: Re: [SPARC64][PPC] strange error ..

On Mon, Mar 15, 2004 at 12:54:17PM -0800, Randy.Dunlap wrote:
> On Mon, 15 Mar 2004 13:43:46 -0700 Tom Rini wrote:
> | On Mon, Mar 15, 2004 at 12:39:53PM -0800, David S. Miller wrote:
> |
> | > On Mon, 15 Mar 2004 12:00:26 -0700
> | > Tom Rini <[email protected]> wrote:
> | >
> | > > That leaves the more general problem of <asm/unistd.h> uses 'asmlinkage'
> | > > on platforms where either (or both) of the following can be true:
> | > > - 'asmlinkage' is a meaningless term, and shouldn't be used.
> | > > - <asm/unistd.h> doesn't include <linux/linkage.h> so it's possible
> | > > another file down the line breaks.
> | >
> | > I think the best fix is to include linux/linkage.h in asm/unistd.h as
> | > you seem to be suggesting, and therefore that is the change I will
> | > push off to Linus to fix this on sparc32 and sparc64.
> |
> | Erm, if I read include/asm-sparc{,64}/linkage.h right, 'asmlinkage' ends
> | up being defined to ''. So why not just remove 'asmlinkage' from the
> | offending line in unistd.h ?
>
> For future-proofing: so that it will be like all other $arch/unistd.h,

It's not nearly all other $arch/unistd.h, it's arm, arm26, i386, ia64,
ppc64, v850 and x86_64. Of which, only i386, ia64 and x86_64 arm* do
anything in <asm/linkage.h>.

So if we really do want to go down the future-proof <asm-*/unistd.h>
from the ia-centric folks (<grin>) road, we'd be better off with a patch
to fix everyone else's $arch/unistd.h.

> so that when someone changes the meaning of it, it will just work...?

The meaning of asmlinkage ?

--
Tom Rini
http://gate.crashing.org/~trini/

2004-03-15 21:17:22

by Randy.Dunlap

[permalink] [raw]
Subject: Re: [SPARC64][PPC] strange error ..

On Mon, 15 Mar 2004 14:08:07 -0700 Tom Rini wrote:

| On Mon, Mar 15, 2004 at 12:54:17PM -0800, Randy.Dunlap wrote:
| > On Mon, 15 Mar 2004 13:43:46 -0700 Tom Rini wrote:
| > | On Mon, Mar 15, 2004 at 12:39:53PM -0800, David S. Miller wrote:
| > |
| > | > On Mon, 15 Mar 2004 12:00:26 -0700
| > | > Tom Rini <[email protected]> wrote:
| > | >
| > | > > That leaves the more general problem of <asm/unistd.h> uses 'asmlinkage'
| > | > > on platforms where either (or both) of the following can be true:
| > | > > - 'asmlinkage' is a meaningless term, and shouldn't be used.
| > | > > - <asm/unistd.h> doesn't include <linux/linkage.h> so it's possible
| > | > > another file down the line breaks.
| > | >
| > | > I think the best fix is to include linux/linkage.h in asm/unistd.h as
| > | > you seem to be suggesting, and therefore that is the change I will
| > | > push off to Linus to fix this on sparc32 and sparc64.
| > |
| > | Erm, if I read include/asm-sparc{,64}/linkage.h right, 'asmlinkage' ends
| > | up being defined to ''. So why not just remove 'asmlinkage' from the
| > | offending line in unistd.h ?
| >
| > For future-proofing: so that it will be like all other $arch/unistd.h,
|
| It's not nearly all other $arch/unistd.h, it's arm, arm26, i386, ia64,
| ppc64, v850 and x86_64. Of which, only i386, ia64 and x86_64 arm* do
| anything in <asm/linkage.h>.
|
| So if we really do want to go down the future-proof <asm-*/unistd.h>
| from the ia-centric folks (<grin>) road, we'd be better off with a patch
| to fix everyone else's $arch/unistd.h.

OK. :)

| > so that when someone changes the meaning of it, it will just work...?
|
| The meaning of asmlinkage ?

Sure, it could mean something in the future, for any arch.

Your simple fix sounds good for 2.6.x.

--
~Randy

2004-03-15 21:33:24

by David Miller

[permalink] [raw]
Subject: Re: [SPARC64][PPC] strange error ..

On Mon, 15 Mar 2004 13:43:46 -0700
Tom Rini <[email protected]> wrote:

> Erm, if I read include/asm-sparc{,64}/linkage.h right, 'asmlinkage' ends
> up being defined to ''. So why not just remove 'asmlinkage' from the
> offending line in unistd.h ?

So that the declarations look consistent across platforms?

2004-03-15 22:04:10

by Colin Leroy

[permalink] [raw]
Subject: Re: [SPARC64][PPC] strange error ..

On 15 Mar 2004 at 12h03, David S. Miller wrote:

Hi,

> I think the best fix is to include linux/linkage.h in asm/unistd.h as
> you seem to be suggesting, and therefore that is the change I will
> push off to Linus to fix this on sparc32 and sparc64.

My first patch did that :)
See '[PATCH] 2.6.4-bk3 ppc32 compile fix' thread.
Re-attaching just in case.
--
Colin


Attachments:
2.6.4-bk3.compile.fix (273.00 B)

2004-03-16 15:26:10

by Tom Rini

[permalink] [raw]
Subject: Re: [SPARC64][PPC] strange error ..

On Tue, Mar 16, 2004 at 09:35:36AM +0100, Wojciech 'Sas' Cieciwa wrote:

>
> 2.6.5-rc1 released and problem still exist on PPC.

Andrew has submitted my preferred fix for PPC32 to Linus, so it should be
in -rc2.

--
Tom Rini
http://gate.crashing.org/~trini/