public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blackfin / h8300 build error fix
@ 2008-07-30 15:58 Yoshinori Sato
  2008-07-30 16:11 ` Mike Frysinger
  0 siblings, 1 reply; 10+ messages in thread
From: Yoshinori Sato @ 2008-07-30 15:58 UTC (permalink / raw)
  To: lkml

init/main.c:781: undefined reference to `___early_initcall_end'

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>

---
 include/asm-generic/vmlinux.lds.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 6d88a92..07b2784 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -362,7 +362,7 @@
 
 #define INITCALLS							\
 	*(.initcallearly.init)						\
-	__early_initcall_end = .;					\
+	VMLINUX_SYMBOL(__early_initcall_end) = .;			\
   	*(.initcall0.init)						\
   	*(.initcall0s.init)						\
   	*(.initcall1.init)						\
-- 
1.5.6.3

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

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

* Re: [PATCH] blackfin / h8300 build error fix
  2008-07-30 15:58 [PATCH] blackfin / h8300 build error fix Yoshinori Sato
@ 2008-07-30 16:11 ` Mike Frysinger
  2008-07-30 19:22   ` Yoshinori Sato
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2008-07-30 16:11 UTC (permalink / raw)
  To: Yoshinori Sato; +Cc: lkml

On Wed, Jul 30, 2008 at 11:58 AM, Yoshinori Sato wrote:
> init/main.c:781: undefined reference to `___early_initcall_end'
>
> Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
>
> ---
>  include/asm-generic/vmlinux.lds.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 6d88a92..07b2784 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -362,7 +362,7 @@
>
>  #define INITCALLS                                                      \
>        *(.initcallearly.init)                                          \
> -       __early_initcall_end = .;                                       \
> +       VMLINUX_SYMBOL(__early_initcall_end) = .;                       \
>        *(.initcall0.init)                                              \
>        *(.initcall0s.init)                                             \
>        *(.initcall1.init)                                              \
> --
> 1.5.6.3

nice catch, thanks ... looks like BUG_TABLE, TRACEDATA, and PERCPU are
also broken, but blackfin/etc... arent using those which is why we
havent noticed yet ...
-mike

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

* Re: [PATCH] blackfin / h8300 build error fix
  2008-07-30 16:11 ` Mike Frysinger
@ 2008-07-30 19:22   ` Yoshinori Sato
  2008-07-30 20:01     ` Andrew Morton
  0 siblings, 1 reply; 10+ messages in thread
From: Yoshinori Sato @ 2008-07-30 19:22 UTC (permalink / raw)
  To: Mike Frysinger, Andrew Morton; +Cc: lkml

At Wed, 30 Jul 2008 12:11:37 -0400,
Mike Frysinger wrote:
> 
> On Wed, Jul 30, 2008 at 11:58 AM, Yoshinori Sato wrote:
> > init/main.c:781: undefined reference to `___early_initcall_end'
> >
> > Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> >
> > ---
> >  include/asm-generic/vmlinux.lds.h |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> > index 6d88a92..07b2784 100644
> > --- a/include/asm-generic/vmlinux.lds.h
> > +++ b/include/asm-generic/vmlinux.lds.h
> > @@ -362,7 +362,7 @@
> >
> >  #define INITCALLS                                                      \
> >        *(.initcallearly.init)                                          \
> > -       __early_initcall_end = .;                                       \
> > +       VMLINUX_SYMBOL(__early_initcall_end) = .;                       \
> >        *(.initcall0.init)                                              \
> >        *(.initcall0s.init)                                             \
> >        *(.initcall1.init)                                              \
> > --
> > 1.5.6.3
> 
> nice catch, thanks ... looks like BUG_TABLE, TRACEDATA, and PERCPU are
> also broken, but blackfin/etc... arent using those which is why we
> havent noticed yet ...
> -mike

Thanks.
I fixed same.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>

 include/asm-generic/vmlinux.lds.h |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 6d88a92..04cae96 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -333,9 +333,9 @@
 #define BUG_TABLE							\
 	. = ALIGN(8);							\
 	__bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) {		\
-		__start___bug_table = .;				\
+		VMLINUX_SYMBOL(__start___bug_table) = .;		\
 		*(__bug_table)						\
-		__stop___bug_table = .;					\
+		VMLINUX_SYMBOL(__stop___bug_table) = .;			\
 	}
 #else
 #define BUG_TABLE
@@ -345,9 +345,9 @@
 #define TRACEDATA							\
 	. = ALIGN(4);							\
 	.tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {		\
-	  	__tracedata_start = .;					\
+	  	VMLINUX_SYMBOL(__tracedata_start) = .;			\
 		*(.tracedata)						\
-	  	__tracedata_end = .;					\
+	  	VMLINUX_SYMBOL(__tracedata_end) = .;			\
 	}
 #else
 #define TRACEDATA
@@ -362,7 +362,7 @@
 
 #define INITCALLS							\
 	*(.initcallearly.init)						\
-	__early_initcall_end = .;					\
+	VMLINUX_SYMBOL(__early_initcall_end) = .;			\
   	*(.initcall0.init)						\
   	*(.initcall0s.init)						\
   	*(.initcall1.init)						\
@@ -383,9 +383,9 @@
 
 #define PERCPU(align)							\
 	. = ALIGN(align);						\
-	__per_cpu_start = .;						\
+	VMLINUX_SYMBOL(__per_cpu_start) = .;				\
 	.data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) {		\
 		*(.data.percpu)						\
 		*(.data.percpu.shared_aligned)				\
 	}								\
-	__per_cpu_end = .;
+	VMLINUX_SYMBOL(__per_cpu_end) = .;
-- 
1.5.6.3

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

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

* Re: [PATCH] blackfin / h8300 build error fix
  2008-07-30 19:22   ` Yoshinori Sato
@ 2008-07-30 20:01     ` Andrew Morton
  2008-07-31  0:26       ` [PATCH] Missing symbol prefix on vmlinux.lds.h Yoshinori Sato
  2008-07-31  3:26       ` [PATCH] blackfin / h8300 build error fix Mike Frysinger
  0 siblings, 2 replies; 10+ messages in thread
From: Andrew Morton @ 2008-07-30 20:01 UTC (permalink / raw)
  To: Yoshinori Sato; +Cc: vapier.adi, linux-kernel

On Wed, 30 Jul 2008 15:22:38 -0400
Yoshinori Sato <ysato@users.sourceforge.jp> wrote:

> At Wed, 30 Jul 2008 12:11:37 -0400,
> Mike Frysinger wrote:
> > 
> > On Wed, Jul 30, 2008 at 11:58 AM, Yoshinori Sato wrote:
> > > init/main.c:781: undefined reference to `___early_initcall_end'
> > >
> > > Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> > >
> > > ---
> > >  include/asm-generic/vmlinux.lds.h |    2 +-
> > >  1 files changed, 1 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> > > index 6d88a92..07b2784 100644
> > > --- a/include/asm-generic/vmlinux.lds.h
> > > +++ b/include/asm-generic/vmlinux.lds.h
> > > @@ -362,7 +362,7 @@
> > >
> > >  #define INITCALLS                                                      \
> > >        *(.initcallearly.init)                                          \
> > > -       __early_initcall_end = .;                                       \
> > > +       VMLINUX_SYMBOL(__early_initcall_end) = .;                       \
> > >        *(.initcall0.init)                                              \
> > >        *(.initcall0s.init)                                             \
> > >        *(.initcall1.init)                                              \
> > > --
> > > 1.5.6.3
> > 
> > nice catch, thanks ... looks like BUG_TABLE, TRACEDATA, and PERCPU are
> > also broken, but blackfin/etc... arent using those which is why we
> > havent noticed yet ...
> > -mike
> 
> Thanks.
> I fixed same.
> 
> Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> 
>  include/asm-generic/vmlinux.lds.h |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 6d88a92..04cae96 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -333,9 +333,9 @@
>  #define BUG_TABLE							\
>  	. = ALIGN(8);							\
>  	__bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) {		\
> -		__start___bug_table = .;				\
> +		VMLINUX_SYMBOL(__start___bug_table) = .;		\
>  		*(__bug_table)						\
> -		__stop___bug_table = .;					\
> +		VMLINUX_SYMBOL(__stop___bug_table) = .;			\
>  	}

Sorry, but I haven't been following this topic very well and I rather
dislike plucking unchangelogged patches out of the middle of email
discussions.

If there's some patch which I should be applying then please resend it,
with a meaningful title, a description of what it does, etc.

Thanks.

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

* Re: [PATCH] Missing symbol prefix on vmlinux.lds.h
  2008-07-30 20:01     ` Andrew Morton
@ 2008-07-31  0:26       ` Yoshinori Sato
  2008-07-31  2:06         ` Andrew Morton
  2008-07-31  3:26       ` [PATCH] blackfin / h8300 build error fix Mike Frysinger
  1 sibling, 1 reply; 10+ messages in thread
From: Yoshinori Sato @ 2008-07-31  0:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: vapier.adi, linux-kernel

Sorry.

I got error ARCH=h8300.
init/main.c:781: undefined reference to `___early_initcall_end'

Same problem have
__start___bug_table
__stop___bug_table
__tracedata_start
__tracedata_end
__per_cpu_start
__per_cpu_end

If define symbol in vmlinux.lds, Use VMLINUX_SYMBOL macro.
VMLINUX_SYMBOL is add prefix charactor.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>

---
 include/asm-generic/vmlinux.lds.h |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 6d88a92..04cae96 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -333,9 +333,9 @@
 #define BUG_TABLE							\
 	. = ALIGN(8);							\
 	__bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) {		\
-		__start___bug_table = .;				\
+		VMLINUX_SYMBOL(__start___bug_table) = .;		\
 		*(__bug_table)						\
-		__stop___bug_table = .;					\
+		VMLINUX_SYMBOL(__stop___bug_table) = .;			\
 	}
 #else
 #define BUG_TABLE
@@ -345,9 +345,9 @@
 #define TRACEDATA							\
 	. = ALIGN(4);							\
 	.tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {		\
-	  	__tracedata_start = .;					\
+	  	VMLINUX_SYMBOL(__tracedata_start) = .;			\
 		*(.tracedata)						\
-	  	__tracedata_end = .;					\
+	  	VMLINUX_SYMBOL(__tracedata_end) = .;			\
 	}
 #else
 #define TRACEDATA
@@ -362,7 +362,7 @@
 
 #define INITCALLS							\
 	*(.initcallearly.init)						\
-	__early_initcall_end = .;					\
+	VMLINUX_SYMBOL(__early_initcall_end) = .;			\
   	*(.initcall0.init)						\
   	*(.initcall0s.init)						\
   	*(.initcall1.init)						\
@@ -383,9 +383,9 @@
 
 #define PERCPU(align)							\
 	. = ALIGN(align);						\
-	__per_cpu_start = .;						\
+	VMLINUX_SYMBOL(__per_cpu_start) = .;				\
 	.data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) {		\
 		*(.data.percpu)						\
 		*(.data.percpu.shared_aligned)				\
 	}								\
-	__per_cpu_end = .;
+	VMLINUX_SYMBOL(__per_cpu_end) = .;
-- 
1.5.6.3

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

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

* Re: [PATCH] Missing symbol prefix on vmlinux.lds.h
  2008-07-31  0:26       ` [PATCH] Missing symbol prefix on vmlinux.lds.h Yoshinori Sato
@ 2008-07-31  2:06         ` Andrew Morton
  2008-07-31  3:20           ` Yoshinori Sato
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Morton @ 2008-07-31  2:06 UTC (permalink / raw)
  To: Yoshinori Sato; +Cc: vapier.adi, linux-kernel, Jeremy Fitzhardinge

On Wed, 30 Jul 2008 20:26:24 -0400 Yoshinori Sato <ysato@users.sourceforge.jp> wrote:

> Sorry.
> 
> I got error ARCH=h8300.
> init/main.c:781: undefined reference to `___early_initcall_end'
> 
> Same problem have
> __start___bug_table
> __stop___bug_table
> __tracedata_start
> __tracedata_end
> __per_cpu_start
> __per_cpu_end
> 
> If define symbol in vmlinux.lds, Use VMLINUX_SYMBOL macro.
> VMLINUX_SYMBOL is add prefix charactor.
> 
> Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> 
> ---
>  include/asm-generic/vmlinux.lds.h |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 6d88a92..04cae96 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -333,9 +333,9 @@
>  #define BUG_TABLE							\
>  	. = ALIGN(8);							\
>  	__bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) {		\
> -		__start___bug_table = .;				\
> +		VMLINUX_SYMBOL(__start___bug_table) = .;		\
>  		*(__bug_table)						\
> -		__stop___bug_table = .;					\
> +		VMLINUX_SYMBOL(__stop___bug_table) = .;			\
>  	}
>  #else
>  #define BUG_TABLE

Strange.  The code you're fixing there was added by

  commit 7664c5a1da4711bb6383117f51b94c8dc8f3f1cd
  Author: Jeremy Fitzhardinge <jeremy@goop.org>
  Date:   Fri Dec 8 02:36:19 2006 -0800

     [PATCH] Generic BUG implementation
    

over a year ago.  I doubt if h8300 has been broken for that long, so
something else must have triggered this failure.

Do you know what it was?

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

* Re: [PATCH] Missing symbol prefix on vmlinux.lds.h
  2008-07-31  2:06         ` Andrew Morton
@ 2008-07-31  3:20           ` Yoshinori Sato
  0 siblings, 0 replies; 10+ messages in thread
From: Yoshinori Sato @ 2008-07-31  3:20 UTC (permalink / raw)
  To: Andrew Morton; +Cc: vapier.adi, linux-kernel, Jeremy Fitzhardinge

At Wed, 30 Jul 2008 19:06:59 -0700,
Andrew Morton wrote:
> 
> On Wed, 30 Jul 2008 20:26:24 -0400 Yoshinori Sato <ysato@users.sourceforge.jp> wrote:
> 
> > Sorry.
> > 
> > I got error ARCH=h8300.
> > init/main.c:781: undefined reference to `___early_initcall_end'
> > 
> > Same problem have
> > __start___bug_table
> > __stop___bug_table
> > __tracedata_start
> > __tracedata_end
> > __per_cpu_start
> > __per_cpu_end
> > 
> > If define symbol in vmlinux.lds, Use VMLINUX_SYMBOL macro.
> > VMLINUX_SYMBOL is add prefix charactor.
> > 
> > Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> > 
> > ---
> >  include/asm-generic/vmlinux.lds.h |   14 +++++++-------
> >  1 files changed, 7 insertions(+), 7 deletions(-)
> > 
> > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> > index 6d88a92..04cae96 100644
> > --- a/include/asm-generic/vmlinux.lds.h
> > +++ b/include/asm-generic/vmlinux.lds.h
> > @@ -333,9 +333,9 @@
> >  #define BUG_TABLE							\
> >  	. = ALIGN(8);							\
> >  	__bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) {		\
> > -		__start___bug_table = .;				\
> > +		VMLINUX_SYMBOL(__start___bug_table) = .;		\
> >  		*(__bug_table)						\
> > -		__stop___bug_table = .;					\
> > +		VMLINUX_SYMBOL(__stop___bug_table) = .;			\
> >  	}
> >  #else
> >  #define BUG_TABLE
> 
> Strange.  The code you're fixing there was added by
> 
>   commit 7664c5a1da4711bb6383117f51b94c8dc8f3f1cd
>   Author: Jeremy Fitzhardinge <jeremy@goop.org>
>   Date:   Fri Dec 8 02:36:19 2006 -0800
> 
>      [PATCH] Generic BUG implementation
>     
> 
> over a year ago.  I doubt if h8300 has been broken for that long, so
> something else must have triggered this failure.
> 
> Do you know what it was?

I don't know.
Check it.

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

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

* Re: [PATCH] blackfin / h8300 build error fix
  2008-07-30 20:01     ` Andrew Morton
  2008-07-31  0:26       ` [PATCH] Missing symbol prefix on vmlinux.lds.h Yoshinori Sato
@ 2008-07-31  3:26       ` Mike Frysinger
  2008-07-31  3:37         ` Andrew Morton
  1 sibling, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2008-07-31  3:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Yoshinori Sato, linux-kernel

On Wed, Jul 30, 2008 at 4:01 PM, Andrew Morton wrote:
> On Wed, 30 Jul 2008 15:22:38 -0400 Yoshinori Sato wrote:
>> At Wed, 30 Jul 2008 12:11:37 -0400 Mike Frysinger wrote:
>> > On Wed, Jul 30, 2008 at 11:58 AM, Yoshinori Sato wrote:
>> > > init/main.c:781: undefined reference to `___early_initcall_end'
>> > >
>> > > Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
>> > >
>> > > ---
>> > >  include/asm-generic/vmlinux.lds.h |    2 +-
>> > >  1 files changed, 1 insertions(+), 1 deletions(-)
>> > >
>> > > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
>> > > index 6d88a92..07b2784 100644
>> > > --- a/include/asm-generic/vmlinux.lds.h
>> > > +++ b/include/asm-generic/vmlinux.lds.h
>> > > @@ -362,7 +362,7 @@
>> > >
>> > >  #define INITCALLS                                                      \
>> > >        *(.initcallearly.init)                                          \
>> > > -       __early_initcall_end = .;                                       \
>> > > +       VMLINUX_SYMBOL(__early_initcall_end) = .;                       \
>> > >        *(.initcall0.init)                                              \
>> > >        *(.initcall0s.init)                                             \
>> > >        *(.initcall1.init)                                              \
>> > > --
>> > > 1.5.6.3
>> >
>> > nice catch, thanks ... looks like BUG_TABLE, TRACEDATA, and PERCPU are
>> > also broken, but blackfin/etc... arent using those which is why we
>> > havent noticed yet ...
>> > -mike
>>
>> Thanks.
>> I fixed same.
>>
>> Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
>>
>>  include/asm-generic/vmlinux.lds.h |   14 +++++++-------
>>  1 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
>> index 6d88a92..04cae96 100644
>> --- a/include/asm-generic/vmlinux.lds.h
>> +++ b/include/asm-generic/vmlinux.lds.h
>> @@ -333,9 +333,9 @@
>>  #define BUG_TABLE                                                    \
>>       . = ALIGN(8);                                                   \
>>       __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) {             \
>> -             __start___bug_table = .;                                \
>> +             VMLINUX_SYMBOL(__start___bug_table) = .;                \
>>               *(__bug_table)                                          \
>> -             __stop___bug_table = .;                                 \
>> +             VMLINUX_SYMBOL(__stop___bug_table) = .;                 \
>>       }
>
> Sorry, but I haven't been following this topic very well and I rather
> dislike plucking unchangelogged patches out of the middle of email
> discussions.
>
> If there's some patch which I should be applying then please resend it,
> with a meaningful title, a description of what it does, etc.

i thought the fix was self-evident ;)

you cant just use straight symbol names in common header files as they
dont take into consideration weird arch-specific ABI conventions.  in
the case of Blackfin/h8300, the ABI dictates that any C-visible
symbols have an underscore prefixed to them.  thus all symbols in
vmlinux.lds.h need to be wrapped in VMLINUX_SYMBOL() so that each arch
can put hide this magic in their own files.
-mike

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

* Re: [PATCH] blackfin / h8300 build error fix
  2008-07-31  3:26       ` [PATCH] blackfin / h8300 build error fix Mike Frysinger
@ 2008-07-31  3:37         ` Andrew Morton
  2008-07-31  3:51           ` Mike Frysinger
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Morton @ 2008-07-31  3:37 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Yoshinori Sato, linux-kernel

On Wed, 30 Jul 2008 23:26:47 -0400 "Mike Frysinger" <vapier.adi@gmail.com> wrote:

> you cant just use straight symbol names in common header files as they
> dont take into consideration weird arch-specific ABI conventions.  in
> the case of Blackfin/h8300, the ABI dictates that any C-visible
> symbols have an underscore prefixed to them.  thus all symbols in
> vmlinux.lds.h need to be wrapped in VMLINUX_SYMBOL() so that each arch
> can put hide this magic in their own files.

ooh, a changelog.

This seems to be a pretty common failing.  I just had to fix the same
problem in a linux-next patch:

diff -puN include/asm-generic/vmlinux.lds.h~zero-based-percpu-use-vmlinux_symbol-in-include-asm-generic-vmlinuxldsh include/asm-generic/vmlinux.lds.h
--- a/include/asm-generic/vmlinux.lds.h~zero-based-percpu-use-vmlinux_symbol-in-include-asm-generic-vmlinuxldsh
+++ a/include/asm-generic/vmlinux.lds.h
@@ -385,15 +385,15 @@
 #define PERCPU(align)							\
 	. = ALIGN(align);						\
 	percpu : { } :percpu						\
-	__per_cpu_load = .;						\
-	.data.percpu 0 : AT(__per_cpu_load - LOAD_OFFSET) {		\
+	VMLINUX_SYMBOL(__per_cpu_load) = .;				\
+	.data.percpu 0 : AT(VMLINUX_SYMBOL(__per_cpu_load) - LOAD_OFFSET) { \
 		*(.data.percpu.first)					\
 		*(.data.percpu.shared_aligned)				\
 		*(.data.percpu)						\
 		*(.data.percpu.page_aligned)				\
-		____per_cpu_size = .;					\
+		VMLINUX_SYMBOL(____per_cpu_size) = .;			\
 	}								\
-	. = __per_cpu_load + ____per_cpu_size;				\
+	. = VMLINUX_SYMBOL(__per_cpu_load) + VMLINUX_SYMBOL(____per_cpu_size); \
 	data : { } :data
 #else
 #define PERCPU(align)							\
_

(haven't tested it yet).

It's going to keep happening too, unless we find some way of making x86
break when people forget to use VMLINUX_SYMBOL().

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

* Re: [PATCH] blackfin / h8300 build error fix
  2008-07-31  3:37         ` Andrew Morton
@ 2008-07-31  3:51           ` Mike Frysinger
  0 siblings, 0 replies; 10+ messages in thread
From: Mike Frysinger @ 2008-07-31  3:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Yoshinori Sato, linux-kernel

On Wed, Jul 30, 2008 at 11:37 PM, Andrew Morton wrote:
> On Wed, 30 Jul 2008 23:26:47 -0400 "Mike Frysinger" wrote:
>> you cant just use straight symbol names in common header files as they
>> dont take into consideration weird arch-specific ABI conventions.  in
>> the case of Blackfin/h8300, the ABI dictates that any C-visible
>> symbols have an underscore prefixed to them.  thus all symbols in
>> vmlinux.lds.h need to be wrapped in VMLINUX_SYMBOL() so that each arch
>> can put hide this magic in their own files.
>
> ooh, a changelog.
>
> This seems to be a pretty common failing.  I just had to fix the same
> problem in a linux-next patch:

PERCPU is broken in mainline currently as well ... but it looks like
there's extended stuff in linux-next now

> It's going to keep happening too, unless we find some way of making x86
> break when people forget to use VMLINUX_SYMBOL().

i pondered it briefly when i saw Yoshinori's original e-mail, but
nothing pretty came to mind
-mike

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

end of thread, other threads:[~2008-07-31  3:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-30 15:58 [PATCH] blackfin / h8300 build error fix Yoshinori Sato
2008-07-30 16:11 ` Mike Frysinger
2008-07-30 19:22   ` Yoshinori Sato
2008-07-30 20:01     ` Andrew Morton
2008-07-31  0:26       ` [PATCH] Missing symbol prefix on vmlinux.lds.h Yoshinori Sato
2008-07-31  2:06         ` Andrew Morton
2008-07-31  3:20           ` Yoshinori Sato
2008-07-31  3:26       ` [PATCH] blackfin / h8300 build error fix Mike Frysinger
2008-07-31  3:37         ` Andrew Morton
2008-07-31  3:51           ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox