linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: kbuild tree build failure
@ 2009-05-05  1:17 Stephen Rothwell
  2009-05-05  6:35 ` Jan Beulich
  2009-05-05 11:11 ` [PATCH] nfs: fix build error in nfsroot with initconst Sam Ravnborg
  0 siblings, 2 replies; 10+ messages in thread
From: Stephen Rothwell @ 2009-05-05  1:17 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-next, Jan Beulich, Steven Whitehouse

[-- Attachment #1: Type: text/plain, Size: 1311 bytes --]

Hi Sam,

Today's linux-next build (powerpc ppc64_defconfig) failed like this:

fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict
fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict

We get these occasionally on powerpc builds - Usually from
EXPORT_SYMBOLS.  Though I was hoping that using a newer compiler would
fix that (I am now compiling with gcc 4.4.0).

Direct cause is commit efbe795f5f63b74ed642e196518907355aa94bd7
("initconst adjustments").

OK, looking at the preprocessor output, I see we have a previous variable
(static match_table_t __initconst tokens) with __attribute__ ((__section__
(".init.rodata"))) but it is not const ... (This came from commit
a447c0932445f92ce6f4c1bd020f62c5097a7842 "vfs: Use const for kernel
parser table" which changed "tokens" from __initdata to __initconst.  Not
using "const" seems deliberate, but the changelog does not include enough
information as to why.)

So, I will revert the above commit for today to allow it to be "improved"
by also fixing the tokens variable definition above.  Of course there may
be other places where such mixed definitions exist.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next: kbuild tree build failure
  2009-05-05  1:17 linux-next: kbuild tree build failure Stephen Rothwell
@ 2009-05-05  6:35 ` Jan Beulich
  2009-05-05  6:43   ` Sam Ravnborg
  2009-05-05 11:11 ` [PATCH] nfs: fix build error in nfsroot with initconst Sam Ravnborg
  1 sibling, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2009-05-05  6:35 UTC (permalink / raw)
  To: Stephen Rothwell, Sam Ravnborg; +Cc: StevenWhitehouse, linux-next

>>> Stephen Rothwell <sfr@canb.auug.org.au> 05.05.09 03:17 >>>
>OK, looking at the preprocessor output, I see we have a previous variable
>(static match_table_t __initconst tokens) with __attribute__ ((__section__
>(".init.rodata"))) but it is not const ... (This came from commit
>a447c0932445f92ce6f4c1bd020f62c5097a7842 "vfs: Use const for kernel
>parser table" which changed "tokens" from __initdata to __initconst.  Not
>using "const" seems deliberate, but the changelog does not include enough
>information as to why.)
>
>So, I will revert the above commit for today to allow it to be "improved"
>by also fixing the tokens variable definition above.  Of course there may
>be other places where such mixed definitions exist.

That is the downside of not folding the 'const' modifier into the __initconst
annotation. It is *always* an error to annotate something __initconst but
not also make it const.

Jan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next: kbuild tree build failure
  2009-05-05  6:35 ` Jan Beulich
@ 2009-05-05  6:43   ` Sam Ravnborg
  2009-05-05  7:04     ` Jan Beulich
  0 siblings, 1 reply; 10+ messages in thread
From: Sam Ravnborg @ 2009-05-05  6:43 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Stephen Rothwell, StevenWhitehouse, linux-next

On Tue, May 05, 2009 at 07:35:02AM +0100, Jan Beulich wrote:
> >>> Stephen Rothwell <sfr@canb.auug.org.au> 05.05.09 03:17 >>>
> >OK, looking at the preprocessor output, I see we have a previous variable
> >(static match_table_t __initconst tokens) with __attribute__ ((__section__
> >(".init.rodata"))) but it is not const ... (This came from commit
> >a447c0932445f92ce6f4c1bd020f62c5097a7842 "vfs: Use const for kernel
> >parser table" which changed "tokens" from __initdata to __initconst.  Not
> >using "const" seems deliberate, but the changelog does not include enough
> >information as to why.)
> >
> >So, I will revert the above commit for today to allow it to be "improved"
> >by also fixing the tokens variable definition above.  Of course there may
> >be other places where such mixed definitions exist.
> 
> That is the downside of not folding the 'const' modifier into the __initconst
> annotation. It is *always* an error to annotate something __initconst but
> not also make it const.

But if we folded const in __initconst would this be correct:

drivers/net/eql.c:static const char version[] __initconst =

?

It is now:
static const char version[] = ...

And will become:
static char version[] const =

gcc does not like the latter:
$ cat jan.c:
static const char version[]  = "oldstuff";
static char version2[] const = "newstuff";

void foo(const char bar[])
{
}

void baz()
{
        foo(version);
        foo(version2);
}
$ gcc jan.c:
jan.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'const'
jan.c: In function 'baz':
jan.c:11: error: 'version2' undeclared (first use in this function)
jan.c:11: error: (Each undeclared identifier is reported only once
jan.c:11: error: for each function it appears in.)

	Sam

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next: kbuild tree build failure
  2009-05-05  6:43   ` Sam Ravnborg
@ 2009-05-05  7:04     ` Jan Beulich
  0 siblings, 0 replies; 10+ messages in thread
From: Jan Beulich @ 2009-05-05  7:04 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Stephen Rothwell, StevenWhitehouse, linux-next

>>> Sam Ravnborg <sam@ravnborg.org> 05.05.09 08:43 >>>
>On Tue, May 05, 2009 at 07:35:02AM +0100, Jan Beulich wrote:
>> That is the downside of not folding the 'const' modifier into the __initconst
>> annotation. It is *always* an error to annotate something __initconst but
>> not also make it const.
>
>But if we folded const in __initconst would this be correct:
>
>drivers/net/eql.c:static const char version[] __initconst =

No, of course not. __initconst would need to go in the place where const
is now. My original patch (from really long ago) did this, but you didn't like
that combination. Changing to such a model now (where we already have
quite a number of uses of __initconst) is certainly going to be painful, so
I'm not sure it's worth it. And if you would think now we should
nevertheless convert, we'd have to first check whether declarations of
more than one variable with a single declaration works with all supported
gcc versions (since there are a number of caveats with how __attribute__()
annotations are handled depending on their placement) - it may well be
that there would need to be a one-variable-per-declaration constraint on
users of __initconst & Co.

Jan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] nfs: fix build error in nfsroot with initconst
  2009-05-05  1:17 linux-next: kbuild tree build failure Stephen Rothwell
  2009-05-05  6:35 ` Jan Beulich
@ 2009-05-05 11:11 ` Sam Ravnborg
  2009-05-05 12:48   ` Jan Beulich
  2009-05-06  3:32   ` Stephen Rothwell
  1 sibling, 2 replies; 10+ messages in thread
From: Sam Ravnborg @ 2009-05-05 11:11 UTC (permalink / raw)
  To: Stephen Rothwell, Trond Myklebust
  Cc: linux-next, Jan Beulich, Steven Whitehouse

fix build error with latest kbuild adjustments to initconst.

The commit a447c0932445f92ce6f4c1bd020f62c5097a7842 ("vfs: Use
const for kernel parser table") changed:

    static match_table_t __initdata tokens = {
to
    static match_table_t __initconst tokens = {

But the missing const causes popwerpc to fail with latest
updates to __initconst like this:

fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict
fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict

The bug is only present with kbuild-next.
Following patch has been build tested.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
---

Please apply this either to your -next tree or preferably upstream.

	Sam


diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index d9ef602..e3ed590 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -129,7 +129,7 @@ enum {
 	Opt_err
 };
 
-static match_table_t __initconst tokens = {
+static const match_table_t tokens __initconst = {
 	{Opt_port, "port=%u"},
 	{Opt_rsize, "rsize=%u"},
 	{Opt_wsize, "wsize=%u"},

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] nfs: fix build error in nfsroot with initconst
  2009-05-05 11:11 ` [PATCH] nfs: fix build error in nfsroot with initconst Sam Ravnborg
@ 2009-05-05 12:48   ` Jan Beulich
  2009-05-06  3:32   ` Stephen Rothwell
  1 sibling, 0 replies; 10+ messages in thread
From: Jan Beulich @ 2009-05-05 12:48 UTC (permalink / raw)
  To: Stephen Rothwell, Trond Myklebust, Sam Ravnborg
  Cc: Steven Whitehouse, linux-next

Acked-by: Jan Beulich <jbeulich@novell.com>

>>> Sam Ravnborg <sam@ravnborg.org> 05.05.09 13:11 >>>
fix build error with latest kbuild adjustments to initconst.

The commit a447c0932445f92ce6f4c1bd020f62c5097a7842 ("vfs: Use
const for kernel parser table") changed:

    static match_table_t __initdata tokens = {
to
    static match_table_t __initconst tokens = {

But the missing const causes popwerpc to fail with latest
updates to __initconst like this:

fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict
fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict

The bug is only present with kbuild-next.
Following patch has been build tested.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
---

Please apply this either to your -next tree or preferably upstream.

	Sam


diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index d9ef602..e3ed590 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -129,7 +129,7 @@ enum {
 	Opt_err
 };
 
-static match_table_t __initconst tokens = {
+static const match_table_t tokens __initconst = {
 	{Opt_port, "port=%u"},
 	{Opt_rsize, "rsize=%u"},
 	{Opt_wsize, "wsize=%u"},

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] nfs: fix build error in nfsroot with initconst
  2009-05-05 11:11 ` [PATCH] nfs: fix build error in nfsroot with initconst Sam Ravnborg
  2009-05-05 12:48   ` Jan Beulich
@ 2009-05-06  3:32   ` Stephen Rothwell
  2009-05-06  4:40     ` Sam Ravnborg
  2009-05-20  1:30     ` Stephen Rothwell
  1 sibling, 2 replies; 10+ messages in thread
From: Stephen Rothwell @ 2009-05-06  3:32 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Trond Myklebust, linux-next, Jan Beulich, Steven Whitehouse

[-- Attachment #1: Type: text/plain, Size: 1466 bytes --]

Hi Sam,

On Tue, 5 May 2009 13:11:14 +0200 Sam Ravnborg <sam@ravnborg.org> wrote:
>
> fix build error with latest kbuild adjustments to initconst.
> 
> The commit a447c0932445f92ce6f4c1bd020f62c5097a7842 ("vfs: Use
> const for kernel parser table") changed:
> 
>     static match_table_t __initdata tokens = {
> to
>     static match_table_t __initconst tokens = {
> 
> But the missing const causes popwerpc to fail with latest
> updates to __initconst like this:
> 
> fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict
> fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict
> 
> The bug is only present with kbuild-next.
> Following patch has been build tested.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Steven Whitehouse <swhiteho@redhat.com>
> Cc: Stephen Rothwell <sfr@canb.auug.org.au>

I build tested this with the offending compilers, so

Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>

I also build tested with the updates to __initconst as well.

> Please apply this either to your -next tree or preferably upstream.

If you want to keep the __initconst changes in your tree, then you need
the above in your tree as well ... (preferably before the __initconst
changes).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nfs: fix build error in nfsroot with initconst
  2009-05-06  3:32   ` Stephen Rothwell
@ 2009-05-06  4:40     ` Sam Ravnborg
  2009-05-06 13:45       ` Trond Myklebust
  2009-05-20  1:30     ` Stephen Rothwell
  1 sibling, 1 reply; 10+ messages in thread
From: Sam Ravnborg @ 2009-05-06  4:40 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Trond Myklebust, linux-next, Jan Beulich, Steven Whitehouse

On Wed, May 06, 2009 at 01:32:53PM +1000, Stephen Rothwell wrote:
> Hi Sam,
> 
> On Tue, 5 May 2009 13:11:14 +0200 Sam Ravnborg <sam@ravnborg.org> wrote:
> >
> > fix build error with latest kbuild adjustments to initconst.
> > 
> > The commit a447c0932445f92ce6f4c1bd020f62c5097a7842 ("vfs: Use
> > const for kernel parser table") changed:
> > 
> >     static match_table_t __initdata tokens = {
> > to
> >     static match_table_t __initconst tokens = {
> > 
> > But the missing const causes popwerpc to fail with latest
> > updates to __initconst like this:
> > 
> > fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict
> > fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict
> > 
> > The bug is only present with kbuild-next.
> > Following patch has been build tested.
> > 
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Steven Whitehouse <swhiteho@redhat.com>
> > Cc: Stephen Rothwell <sfr@canb.auug.org.au>
> 
> I build tested this with the offending compilers, so
> 
> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
> 
> I also build tested with the updates to __initconst as well.
> 
> > Please apply this either to your -next tree or preferably upstream.
> 
> If you want to keep the __initconst changes in your tree, then you need
> the above in your tree as well ... (preferably before the __initconst
> changes).
I hope that Trond would pull it into his tree and get it
upstream.

But if this does not happen within a few days (or Trond says I should do so),
I will add it to the kbuild-next.git.

	Sam

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nfs: fix build error in nfsroot with initconst
  2009-05-06  4:40     ` Sam Ravnborg
@ 2009-05-06 13:45       ` Trond Myklebust
  0 siblings, 0 replies; 10+ messages in thread
From: Trond Myklebust @ 2009-05-06 13:45 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Stephen Rothwell, linux-next, Jan Beulich, Steven Whitehouse

On Wed, 2009-05-06 at 06:40 +0200, Sam Ravnborg wrote:
> On Wed, May 06, 2009 at 01:32:53PM +1000, Stephen Rothwell wrote:
> > Hi Sam,
> > 
> > On Tue, 5 May 2009 13:11:14 +0200 Sam Ravnborg <sam@ravnborg.org> wrote:
> > >
> > > fix build error with latest kbuild adjustments to initconst.
> > > 
> > > The commit a447c0932445f92ce6f4c1bd020f62c5097a7842 ("vfs: Use
> > > const for kernel parser table") changed:
> > > 
> > >     static match_table_t __initdata tokens = {
> > > to
> > >     static match_table_t __initconst tokens = {
> > > 
> > > But the missing const causes popwerpc to fail with latest
> > > updates to __initconst like this:
> > > 
> > > fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict
> > > fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict
> > > 
> > > The bug is only present with kbuild-next.
> > > Following patch has been build tested.
> > > 
> > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > > Cc: Steven Whitehouse <swhiteho@redhat.com>
> > > Cc: Stephen Rothwell <sfr@canb.auug.org.au>
> > 
> > I build tested this with the offending compilers, so
> > 
> > Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > 
> > I also build tested with the updates to __initconst as well.
> > 
> > > Please apply this either to your -next tree or preferably upstream.
> > 
> > If you want to keep the __initconst changes in your tree, then you need
> > the above in your tree as well ... (preferably before the __initconst
> > changes).
> I hope that Trond would pull it into his tree and get it
> upstream.
> 
> But if this does not happen within a few days (or Trond says I should do so),
> I will add it to the kbuild-next.git.
> 
> 	Sam


I've got some stuff from Chuck that I need to send upstream too, so I
expect to send it in the next couple of days...

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nfs: fix build error in nfsroot with initconst
  2009-05-06  3:32   ` Stephen Rothwell
  2009-05-06  4:40     ` Sam Ravnborg
@ 2009-05-20  1:30     ` Stephen Rothwell
  1 sibling, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2009-05-20  1:30 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Sam Ravnborg, linux-next, Jan Beulich, Steven Whitehouse

[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]

Hi Trond,

On Wed, 6 May 2009 13:32:53 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Tue, 5 May 2009 13:11:14 +0200 Sam Ravnborg <sam@ravnborg.org> wrote:
> >
> > fix build error with latest kbuild adjustments to initconst.
> > 
> > The commit a447c0932445f92ce6f4c1bd020f62c5097a7842 ("vfs: Use
> > const for kernel parser table") changed:
> > 
> >     static match_table_t __initdata tokens = {
> > to
> >     static match_table_t __initconst tokens = {
> > 
> > But the missing const causes popwerpc to fail with latest
> > updates to __initconst like this:
> > 
> > fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict
> > fs/nfs/nfsroot.c:400: error: __setup_str_nfs_root_setup causes a section type conflict
> > 
> > The bug is only present with kbuild-next.
> > Following patch has been build tested.
> > 
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Steven Whitehouse <swhiteho@redhat.com>
> > Cc: Stephen Rothwell <sfr@canb.auug.org.au>
> 
> I build tested this with the offending compilers, so
> 
> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>

Any reason this has not appeared in the nfs (or Linus') tree yet?

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-05-20  1:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-05  1:17 linux-next: kbuild tree build failure Stephen Rothwell
2009-05-05  6:35 ` Jan Beulich
2009-05-05  6:43   ` Sam Ravnborg
2009-05-05  7:04     ` Jan Beulich
2009-05-05 11:11 ` [PATCH] nfs: fix build error in nfsroot with initconst Sam Ravnborg
2009-05-05 12:48   ` Jan Beulich
2009-05-06  3:32   ` Stephen Rothwell
2009-05-06  4:40     ` Sam Ravnborg
2009-05-06 13:45       ` Trond Myklebust
2009-05-20  1:30     ` Stephen Rothwell

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).