linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [s390] next Feb 18: defconfig build break
       [not found] <20090218191640.0b023029.sfr@canb.auug.org.au>
@ 2009-02-18 10:29 ` Sachin P. Sant
  2009-02-18 11:45   ` Stephen Rothwell
  0 siblings, 1 reply; 13+ messages in thread
From: Sachin P. Sant @ 2009-02-18 10:29 UTC (permalink / raw)
  To: linux-s390
  Cc: Stephen Rothwell, linux-next, LKML, schwidefsky, heiko.carstens

Next Feb 18 defconfig build on s390 fails with following error.

  CC      arch/s390/lib/string.o
In file included from include/linux/bitmap.h:8,
                 from include/linux/cpumask.h:142,
                 from include/linux/smp.h:12,
                 from /usr/local/autobench/var/tmp/build/linux/arch/s390/include/asm/spinlock.h:14,
                 from include/linux/spinlock.h:88,
                 from include/linux/seqlock.h:29,
                 from include/linux/time.h:8,
                 from include/linux/stat.h:60,
                 from include/linux/module.h:10,
                 from arch/s390/lib/string.c:13:
include/linux/string.h: In function 'strstarts':
include/linux/string.h:124: error: implicit declaration of function 'strlen'
include/linux/string.h:124: warning: incompatible implicit declaration of built-in function 'strlen'
make[1]: *** [arch/s390/lib/string.o] Error 1
make: *** [arch/s390/lib] Error 2

Thanks
-Sachin

-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

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

* Re: [s390] next Feb 18: defconfig build break
  2009-02-18 10:29 ` [s390] next Feb 18: defconfig build break Sachin P. Sant
@ 2009-02-18 11:45   ` Stephen Rothwell
  2009-02-18 17:10     ` Mike Frysinger
  0 siblings, 1 reply; 13+ messages in thread
From: Stephen Rothwell @ 2009-02-18 11:45 UTC (permalink / raw)
  To: Sachin P. Sant
  Cc: Rusty Russell, linux-s390, linux-next, LKML, schwidefsky,
	heiko.carstens

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

Hi Sachin,

On Wed, 18 Feb 2009 15:59:20 +0530 "Sachin P. Sant" <sachinp@in.ibm.com> wrote:
>
> Next Feb 18 defconfig build on s390 fails with following error.
> 
>   CC      arch/s390/lib/string.o
> In file included from include/linux/bitmap.h:8,
>                  from include/linux/cpumask.h:142,
>                  from include/linux/smp.h:12,
>                  from /usr/local/autobench/var/tmp/build/linux/arch/s390/include/asm/spinlock.h:14,
>                  from include/linux/spinlock.h:88,
>                  from include/linux/seqlock.h:29,
>                  from include/linux/time.h:8,
>                  from include/linux/stat.h:60,
>                  from include/linux/module.h:10,
>                  from arch/s390/lib/string.c:13:
> include/linux/string.h: In function 'strstarts':
> include/linux/string.h:124: error: implicit declaration of function 'strlen'
> include/linux/string.h:124: warning: incompatible implicit declaration of built-in function 'strlen'
> make[1]: *** [arch/s390/lib/string.o] Error 1
> make: *** [arch/s390/lib] Error 2

That would be a side effect of commit 43a47c6ca0e0b5479ae316e188a28b7e625d41e5 ("misc:strstarts") from the rr tree.  Rusty cc'd.

-- 
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] 13+ messages in thread

* Re: [s390] next Feb 18: defconfig build break
  2009-02-18 11:45   ` Stephen Rothwell
@ 2009-02-18 17:10     ` Mike Frysinger
  2009-02-18 22:43       ` Rusty Russell
                         ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-02-18 17:10 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Sachin P. Sant, Rusty Russell, linux-s390, linux-next, LKML,
	schwidefsky, heiko.carstens

On Wed, Feb 18, 2009 at 06:45, Stephen Rothwell wrote:
> On Wed, 18 Feb 2009 15:59:20 +0530 "Sachin P. Sant" wrote:
>> Next Feb 18 defconfig build on s390 fails with following error.
>>
>>   CC      arch/s390/lib/string.o
>> In file included from include/linux/bitmap.h:8,
>>                  from include/linux/cpumask.h:142,
>>                  from include/linux/smp.h:12,
>>                  from /usr/local/autobench/var/tmp/build/linux/arch/s390/include/asm/spinlock.h:14,
>>                  from include/linux/spinlock.h:88,
>>                  from include/linux/seqlock.h:29,
>>                  from include/linux/time.h:8,
>>                  from include/linux/stat.h:60,
>>                  from include/linux/module.h:10,
>>                  from arch/s390/lib/string.c:13:
>> include/linux/string.h: In function 'strstarts':
>> include/linux/string.h:124: error: implicit declaration of function 'strlen'
>> include/linux/string.h:124: warning: incompatible implicit declaration of built-in function 'strlen'
>> make[1]: *** [arch/s390/lib/string.o] Error 1
>> make: *** [arch/s390/lib] Error 2
>
> That would be a side effect of commit 43a47c6ca0e0b5479ae316e188a28b7e625d41e5 ("misc:strstarts") from the rr tree.  Rusty cc'd.

breaks all Blackfin ports as well:
In file included from include/linux/bitmap.h:9,
                 from include/linux/nodemask.h:90,
                 from include/linux/mmzone.h:17,
                 from include/linux/gfp.h:5,
                 from include/linux/kmod.h:23,
                 from include/linux/module.h:14,
                 from arch/blackfin/lib/strncmp.c:14:
include/linux/string.h: In function 'strstarts':
include/linux/string.h:124: error: implicit declaration of function 'strncmp'
make[1]: *** [arch/blackfin/lib/strncmp.o] Error 1
make: *** [arch/blackfin/lib] Error 2
-mike

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

* Re: [s390] next Feb 18: defconfig build break
  2009-02-18 17:10     ` Mike Frysinger
@ 2009-02-18 22:43       ` Rusty Russell
  2009-02-19  5:20         ` Sachin P. Sant
  2009-02-20 10:23         ` Martin Schwidefsky
  2009-02-18 22:59       ` Rusty Russell
  2009-02-19  0:15       ` Rusty Russell
  2 siblings, 2 replies; 13+ messages in thread
From: Rusty Russell @ 2009-02-18 22:43 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: Stephen Rothwell, Sachin P. Sant, linux-s390, linux-next, LKML,
	schwidefsky, heiko.carstens

On Thursday 19 February 2009 03:40:59 Mike Frysinger wrote:
> On Wed, Feb 18, 2009 at 06:45, Stephen Rothwell wrote:
> > That would be a side effect of commit 43a47c6ca0e0b5479ae316e188a28b7e625d41e5 ("misc:strstarts") from the rr tree.  Rusty cc'd.
> 
> breaks all Blackfin ports as well:

My first reaction was WTF?  My second was, how did our string code become
such a catastrophe?

Sorry, I had no idea what a mess I was wading into.

Here's the s390 fix:

Subject: s390: allow usage of string functions in linux/string.h

In introducing a trivial "strstarts()" function in linux/string.h, we
hit the following error on s390:

In file included from include/linux/bitmap.h:8,
                 from include/linux/cpumask.h:142,
                 from include/linux/smp.h:12,
                 from /home/rusty/devel/kernel/patches/linux-2.6/arch/s390/include/asm/spinlock.h:14,
                 from include/linux/spinlock.h:88,
                 from include/linux/seqlock.h:29,
                 from include/linux/time.h:8,
                 from include/linux/stat.h:60,
                 from include/linux/module.h:10,
                 from arch/s390/lib/string.c:13:
include/linux/string.h: In function 'strstarts':
include/linux/string.h:124: error: implicit declaration of function 'strlen'
include/linux/string.h:124: warning: incompatible implicit declaration of built-in function 'strlen'

Because when including asm/string.h from arch/s390/lib/string.c we
don't declare the string ops we are about to define, and
linux/string.h barfs.

The fix is to declare them in this IN_ARCH_STRING_C case, but in
general I wonder if there's a neater fix.

Reported-by: linux-next
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/arch/s390/include/asm/string.h b/arch/s390/include/asm/string.h
--- a/arch/s390/include/asm/string.h
+++ b/arch/s390/include/asm/string.h
@@ -135,7 +135,13 @@ static inline size_t strnlen(const char 
 		: "+a" (end), "+a" (tmp) : "d" (r0)  : "cc");
 	return end - s;
 }
-
+#else /* IN_ARCH_STRING_C */
+void *memchr(const void * s, int c, size_t n);
+void *memscan(void *s, int c, size_t n);
+char *strcat(char *dst, const char *src);
+char *strcpy(char *dst, const char *src);
+size_t strlen(const char *s);
+size_t strnlen(const char * s, size_t n);
 #endif /* !IN_ARCH_STRING_C */
 
 #endif /* __KERNEL__ */

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

* Re: [s390] next Feb 18: defconfig build break
  2009-02-18 17:10     ` Mike Frysinger
  2009-02-18 22:43       ` Rusty Russell
@ 2009-02-18 22:59       ` Rusty Russell
  2009-02-19  1:55         ` Mike Frysinger
  2009-02-19  0:15       ` Rusty Russell
  2 siblings, 1 reply; 13+ messages in thread
From: Rusty Russell @ 2009-02-18 22:59 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: Stephen Rothwell, Sachin P. Sant, linux-s390, linux-next, LKML,
	schwidefsky, heiko.carstens

On Thursday 19 February 2009 03:40:59 Mike Frysinger wrote:
> breaks all Blackfin ports as well:
> In file included from include/linux/bitmap.h:9,
>                  from include/linux/nodemask.h:90,
>                  from include/linux/mmzone.h:17,
>                  from include/linux/gfp.h:5,
>                  from include/linux/kmod.h:23,
>                  from include/linux/module.h:14,
>                  from arch/blackfin/lib/strncmp.c:14:
> include/linux/string.h: In function 'strstarts':
> include/linux/string.h:124: error: implicit declaration of function 'strncmp'
> make[1]: *** [arch/blackfin/lib/strncmp.o] Error 1
> make: *** [arch/blackfin/lib] Error 2
> -mike

Hi Mike,

   I don't have a blackfin cross compiler, but I think this is the right
fix:

Subject: blackfin: allow usage of string functions in linux/string.h

In introducing a trivial "strstarts()" function in linux/string.h, we
hit the following error on blackfin:

file included from include/linux/bitmap.h:9,
                 from include/linux/nodemask.h:90,
                 from include/linux/mmzone.h:17,
                 from include/linux/gfp.h:5,
                 from include/linux/kmod.h:23,
                 from include/linux/module.h:14,
                 from arch/blackfin/lib/strncmp.c:14:
include/linux/string.h: In function 'strstarts':
include/linux/string.h:124: error: implicit declaration of function 'strncmp'

Because when including asm/string.h from arch/blackfin/lib/strncmp.c,
we don't declare the string op we are about to define, and
linux/string.h barfs.

The fix is to declare the function whose definition we steal via the
#define trick.  I do this for all of them, so this won't bite us in
future.

Reported-by: linux-next
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/arch/blackfin/lib/strcmp.c b/arch/blackfin/lib/strcmp.c
--- a/arch/blackfin/lib/strcmp.c
+++ b/arch/blackfin/lib/strcmp.c
@@ -6,6 +6,7 @@
  * Licensed under the GPL-2 or later.
  */
 
+int strcmp(const char *dest, const char *src);
 #define strcmp __inline_strcmp
 #include <asm/string.h>
 #undef strcmp
diff --git a/arch/blackfin/lib/strcpy.c b/arch/blackfin/lib/strcpy.c
--- a/arch/blackfin/lib/strcpy.c
+++ b/arch/blackfin/lib/strcpy.c
@@ -6,6 +6,7 @@
  * Licensed under the GPL-2 or later.
  */
 
+char *strcpy(char *dest, const char *src);
 #define strcpy __inline_strcpy
 #include <asm/string.h>
 #undef strcpy
diff --git a/arch/blackfin/lib/strncmp.c b/arch/blackfin/lib/strncmp.c
--- a/arch/blackfin/lib/strncmp.c
+++ b/arch/blackfin/lib/strncmp.c
@@ -6,6 +6,7 @@
  * Licensed under the GPL-2 or later.
  */
 
+int strncmp(const char *cs, const char *ct, size_t count);
 #define strncmp __inline_strncmp
 #include <asm/string.h>
 #undef strncmp
diff --git a/arch/blackfin/lib/strncpy.c b/arch/blackfin/lib/strncpy.c
--- a/arch/blackfin/lib/strncpy.c
+++ b/arch/blackfin/lib/strncpy.c
@@ -6,6 +6,7 @@
  * Licensed under the GPL-2 or later.
  */
 
+char *strncpy(char *dest, const char *src, size_t n);
 #define strncpy __inline_strncpy
 #include <asm/string.h>
 #undef strncpy

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

* Re: [s390] next Feb 18: defconfig build break
  2009-02-18 17:10     ` Mike Frysinger
  2009-02-18 22:43       ` Rusty Russell
  2009-02-18 22:59       ` Rusty Russell
@ 2009-02-19  0:15       ` Rusty Russell
  2009-02-19  9:51         ` Russell King
  2 siblings, 1 reply; 13+ messages in thread
From: Rusty Russell @ 2009-02-19  0:15 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: Stephen Rothwell, Sachin P. Sant, linux-s390, linux-next, LKML,
	schwidefsky, heiko.carstens, rmk

On Thursday 19 February 2009 03:40:59 Mike Frysinger wrote:
> On Wed, Feb 18, 2009 at 06:45, Stephen Rothwell wrote:
> > That would be a side effect of commit 43a47c6ca0e0b5479ae316e188a28b7e625d41e5 ("misc:strstarts") from the rr tree.  Rusty cc'd.
> 
> breaks all Blackfin ports as well:

And arm!

Subject: arm: allow usage of string functions in linux/string.h

In introducing a trivial "strstarts()" function in linux/string.h, we
hit:

	arch/arm/boot/compressed/misc.o: In function `strstarts':
	misc.c:(.text+0x368): undefined reference to `strlen'
	misc.c:(.text+0x378): undefined reference to `strncmp'

This is because of "CFLAGS_misc.o := -Dstatic=" in the Makefile.
"static inline strstarts(...)" becomes non-inline, and refers to the
other string ops.

The simplest workaround is to include asm/string.h.  This makes sense
anyway, since lib/string.c won't be linked against this so we can't
use those functions anyway.

Compile tested here.

Reported-by: linux-next
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -18,7 +18,10 @@
 
 unsigned int __machine_arch_type;
 
-#include <linux/string.h>
+#include <linux/compiler.h>	/* for inline */
+#include <linux/types.h>	/* for size_t */
+#include <linux/stddef.h>	/* for NULL */
+#include <asm/string.h>
 
 #ifdef STANDALONE_DEBUG
 #define putstr printf

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

* Re: [s390] next Feb 18: defconfig build break
  2009-02-18 22:59       ` Rusty Russell
@ 2009-02-19  1:55         ` Mike Frysinger
  2009-02-19 11:40           ` Rusty Russell
  0 siblings, 1 reply; 13+ messages in thread
From: Mike Frysinger @ 2009-02-19  1:55 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Stephen Rothwell, Sachin P. Sant, linux-s390, linux-next, LKML,
	schwidefsky, heiko.carstens

On Wed, Feb 18, 2009 at 17:59, Rusty Russell wrote:
> On Thursday 19 February 2009 03:40:59 Mike Frysinger wrote:
>> breaks all Blackfin ports as well:
>> In file included from include/linux/bitmap.h:9,
>>                  from include/linux/nodemask.h:90,
>>                  from include/linux/mmzone.h:17,
>>                  from include/linux/gfp.h:5,
>>                  from include/linux/kmod.h:23,
>>                  from include/linux/module.h:14,
>>                  from arch/blackfin/lib/strncmp.c:14:
>> include/linux/string.h: In function 'strstarts':
>> include/linux/string.h:124: error: implicit declaration of function 'strncmp'
>> make[1]: *** [arch/blackfin/lib/strncmp.o] Error 1
>> make: *** [arch/blackfin/lib] Error 2
>
>   I don't have a blackfin cross compiler, but I think this is the right
> fix:

np ... fix is almost correct :)

> --- a/arch/blackfin/lib/strncmp.c
> +++ b/arch/blackfin/lib/strncmp.c
> @@ -6,6 +6,7 @@
>  * Licensed under the GPL-2 or later.
>  */
>
> +int strncmp(const char *cs, const char *ct, size_t count);
>  #define strncmp __inline_strncmp
>  #include <asm/string.h>
>  #undef strncmp
> diff --git a/arch/blackfin/lib/strncpy.c b/arch/blackfin/lib/strncpy.c
> --- a/arch/blackfin/lib/strncpy.c
> +++ b/arch/blackfin/lib/strncpy.c
> @@ -6,6 +6,7 @@
>  * Licensed under the GPL-2 or later.
>  */
>
> +char *strncpy(char *dest, const char *src, size_t n);
>  #define strncpy __inline_strncpy
>  #include <asm/string.h>
>  #undef strncpy

size_t is not a builtin type so there needs to be a linux/types.h
include right above these two prototypes.  then things build up fine
for me.

thanks!
-mike

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

* Re: [s390] next Feb 18: defconfig build break
  2009-02-18 22:43       ` Rusty Russell
@ 2009-02-19  5:20         ` Sachin P. Sant
  2009-02-20 10:23         ` Martin Schwidefsky
  1 sibling, 0 replies; 13+ messages in thread
From: Sachin P. Sant @ 2009-02-19  5:20 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Mike Frysinger, Stephen Rothwell, linux-s390, linux-next, LKML,
	schwidefsky, heiko.carstens

Rusty Russell wrote:
> On Thursday 19 February 2009 03:40:59 Mike Frysinger wrote:
>   
>> On Wed, Feb 18, 2009 at 06:45, Stephen Rothwell wrote:
>>     
>>> That would be a side effect of commit 43a47c6ca0e0b5479ae316e188a28b7e625d41e5 ("misc:strstarts") from the rr tree.  Rusty cc'd.
>>>       
>> breaks all Blackfin ports as well:
>>     
>
> My first reaction was WTF?  My second was, how did our string code become
> such a catastrophe?
>
> Sorry, I had no idea what a mess I was wading into.
>
> Here's the s390 fix:
>   
Thanks Rusty. That fixes the issue.

Regards
-Sachin

-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

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

* Re: [s390] next Feb 18: defconfig build break
  2009-02-19  0:15       ` Rusty Russell
@ 2009-02-19  9:51         ` Russell King
  2009-02-19 11:48           ` Rusty Russell
  0 siblings, 1 reply; 13+ messages in thread
From: Russell King @ 2009-02-19  9:51 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Mike Frysinger, Stephen Rothwell, Sachin P. Sant, linux-s390,
	linux-next, LKML, schwidefsky, heiko.carstens

On Thu, Feb 19, 2009 at 10:45:25AM +1030, Rusty Russell wrote:
> Subject: arm: allow usage of string functions in linux/string.h
> 
> In introducing a trivial "strstarts()" function in linux/string.h, we
> hit:
> 
> 	arch/arm/boot/compressed/misc.o: In function `strstarts':
> 	misc.c:(.text+0x368): undefined reference to `strlen'
> 	misc.c:(.text+0x378): undefined reference to `strncmp'
> 
> This is because of "CFLAGS_misc.o := -Dstatic=" in the Makefile.
> "static inline strstarts(...)" becomes non-inline, and refers to the
> other string ops.
> 
> The simplest workaround is to include asm/string.h.  This makes sense
> anyway, since lib/string.c won't be linked against this so we can't
> use those functions anyway.
> 
> Compile tested here.
> 
> Reported-by: linux-next
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

I guess this should go in with the change which caused the breakage.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

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

* Re: [s390] next Feb 18: defconfig build break
  2009-02-19  1:55         ` Mike Frysinger
@ 2009-02-19 11:40           ` Rusty Russell
  2009-02-19 17:14             ` Mike Frysinger
  0 siblings, 1 reply; 13+ messages in thread
From: Rusty Russell @ 2009-02-19 11:40 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: Stephen Rothwell, Sachin P. Sant, linux-s390, linux-next, LKML,
	schwidefsky, heiko.carstens

On Thursday 19 February 2009 12:25:13 Mike Frysinger wrote:
> > +char *strncpy(char *dest, const char *src, size_t n);
> >  #define strncpy __inline_strncpy
> >  #include <asm/string.h>
> >  #undef strncpy
> 
> size_t is not a builtin type so there needs to be a linux/types.h
> include right above these two prototypes.  then things build up fine
> for me.

OK, this time for sure!


blackfin: allow usage of string functions in linux/string.h

In introducing a trivial "strstarts()" function in linux/string.h, we
hit the following error on blackfin:

file included from include/linux/bitmap.h:9,
                 from include/linux/nodemask.h:90,
                 from include/linux/mmzone.h:17,
                 from include/linux/gfp.h:5,
                 from include/linux/kmod.h:23,
                 from include/linux/module.h:14,
                 from arch/blackfin/lib/strncmp.c:14:
include/linux/string.h: In function 'strstarts':
include/linux/string.h:124: error: implicit declaration of function 'strncmp'

Because when including asm/string.h from arch/blackfin/lib/strncmp.c,
we don't declare the string op we are about to define, and
linux/string.h barfs.

The fix is to declare the function whose definition we steal via the
#define trick.  I do this for all of them, so this won't bite us in
future.

Reported-by: linux-next
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 arch/blackfin/lib/strcmp.c  |    1 +
 arch/blackfin/lib/strcpy.c  |    1 +
 arch/blackfin/lib/strncmp.c |    1 +
 arch/blackfin/lib/strncpy.c |    1 +
 4 files changed, 4 insertions(+)

diff --git a/arch/blackfin/lib/strcmp.c b/arch/blackfin/lib/strcmp.c
--- a/arch/blackfin/lib/strcmp.c
+++ b/arch/blackfin/lib/strcmp.c
@@ -6,6 +6,7 @@
  * Licensed under the GPL-2 or later.
  */
 
+int strcmp(const char *dest, const char *src);
 #define strcmp __inline_strcmp
 #include <asm/string.h>
 #undef strcmp
diff --git a/arch/blackfin/lib/strcpy.c b/arch/blackfin/lib/strcpy.c
--- a/arch/blackfin/lib/strcpy.c
+++ b/arch/blackfin/lib/strcpy.c
@@ -6,6 +6,7 @@
  * Licensed under the GPL-2 or later.
  */
 
+char *strcpy(char *dest, const char *src);
 #define strcpy __inline_strcpy
 #include <asm/string.h>
 #undef strcpy
diff --git a/arch/blackfin/lib/strncmp.c b/arch/blackfin/lib/strncmp.c
--- a/arch/blackfin/lib/strncmp.c
+++ b/arch/blackfin/lib/strncmp.c
@@ -6,6 +6,8 @@
  * Licensed under the GPL-2 or later.
  */
 
+#include <linux/types.h>
+int strncmp(const char *cs, const char *ct, size_t count);
 #define strncmp __inline_strncmp
 #include <asm/string.h>
 #undef strncmp
diff --git a/arch/blackfin/lib/strncpy.c b/arch/blackfin/lib/strncpy.c
--- a/arch/blackfin/lib/strncpy.c
+++ b/arch/blackfin/lib/strncpy.c
@@ -6,6 +6,8 @@
  * Licensed under the GPL-2 or later.
  */
 
+#include <linux/types.h>
+char *strncpy(char *dest, const char *src, size_t n);
 #define strncpy __inline_strncpy
 #include <asm/string.h>
 #undef strncpy

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

* Re: [s390] next Feb 18: defconfig build break
  2009-02-19  9:51         ` Russell King
@ 2009-02-19 11:48           ` Rusty Russell
  0 siblings, 0 replies; 13+ messages in thread
From: Rusty Russell @ 2009-02-19 11:48 UTC (permalink / raw)
  To: Russell King
  Cc: Mike Frysinger, Stephen Rothwell, Sachin P. Sant, linux-s390,
	linux-next, LKML, schwidefsky, heiko.carstens

On Thursday 19 February 2009 20:21:50 Russell King wrote:
> On Thu, Feb 19, 2009 at 10:45:25AM +1030, Rusty Russell wrote:
> > Subject: arm: allow usage of string functions in linux/string.h
> 
> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
> 
> I guess this should go in with the change which caused the breakage.

Well, feel free to queue it yourself too, but now you've acked it I've put it
in my queue ahead of the strstarts patch.

Thanks,
Rusty.

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

* Re: [s390] next Feb 18: defconfig build break
  2009-02-19 11:40           ` Rusty Russell
@ 2009-02-19 17:14             ` Mike Frysinger
  0 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-02-19 17:14 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Stephen Rothwell, Sachin P. Sant, linux-s390, linux-next, LKML,
	schwidefsky, heiko.carstens

On Thu, Feb 19, 2009 at 06:40, Rusty Russell wrote:
> On Thursday 19 February 2009 12:25:13 Mike Frysinger wrote:
>> > +char *strncpy(char *dest, const char *src, size_t n);
>> >  #define strncpy __inline_strncpy
>> >  #include <asm/string.h>
>> >  #undef strncpy
>>
>> size_t is not a builtin type so there needs to be a linux/types.h
>> include right above these two prototypes.  then things build up fine
>> for me.
>
> OK, this time for sure!
>
>
> blackfin: allow usage of string functions in linux/string.h
>
> In introducing a trivial "strstarts()" function in linux/string.h, we
> hit the following error on blackfin:
>
> file included from include/linux/bitmap.h:9,
>                 from include/linux/nodemask.h:90,
>                 from include/linux/mmzone.h:17,
>                 from include/linux/gfp.h:5,
>                 from include/linux/kmod.h:23,
>                 from include/linux/module.h:14,
>                 from arch/blackfin/lib/strncmp.c:14:
> include/linux/string.h: In function 'strstarts':
> include/linux/string.h:124: error: implicit declaration of function 'strncmp'
>
> Because when including asm/string.h from arch/blackfin/lib/strncmp.c,
> we don't declare the string op we are about to define, and
> linux/string.h barfs.
>
> The fix is to declare the function whose definition we steal via the
> #define trick.  I do this for all of them, so this won't bite us in
> future.
>
> Reported-by: linux-next
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Tested-by: Mike Frysinger <vapier@gentoo.org>
-mike

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

* Re: [s390] next Feb 18: defconfig build break
  2009-02-18 22:43       ` Rusty Russell
  2009-02-19  5:20         ` Sachin P. Sant
@ 2009-02-20 10:23         ` Martin Schwidefsky
  1 sibling, 0 replies; 13+ messages in thread
From: Martin Schwidefsky @ 2009-02-20 10:23 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Mike Frysinger, Stephen Rothwell, Sachin P. Sant, linux-s390,
	linux-next, LKML, heiko.carstens

Hi Rusty,

On Thu, 19 Feb 2009 09:13:26 +1030
Rusty Russell <rusty@rustcorp.com.au> wrote:

> Here's the s390 fix:
> 
> Subject: s390: allow usage of string functions in linux/string.h

Thanks for the fix.
 
> Because when including asm/string.h from arch/s390/lib/string.c we
> don't declare the string ops we are about to define, and
> linux/string.h barfs.
> 
> The fix is to declare them in this IN_ARCH_STRING_C case, but in
> general I wonder if there's a neater fix.

The out-of-line version of the string functions in
arch/s390/lib/string.c needs EXPORT_SYMBOL and other stuff. To fix the
problem without the seperate out-of-line prototypes would required to
avoid the inclusing of linux/string.h. Which would be fragile if
possible at all. So I think your patch is the best way to deal with the
problem.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

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

end of thread, other threads:[~2009-02-20 10:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20090218191640.0b023029.sfr@canb.auug.org.au>
2009-02-18 10:29 ` [s390] next Feb 18: defconfig build break Sachin P. Sant
2009-02-18 11:45   ` Stephen Rothwell
2009-02-18 17:10     ` Mike Frysinger
2009-02-18 22:43       ` Rusty Russell
2009-02-19  5:20         ` Sachin P. Sant
2009-02-20 10:23         ` Martin Schwidefsky
2009-02-18 22:59       ` Rusty Russell
2009-02-19  1:55         ` Mike Frysinger
2009-02-19 11:40           ` Rusty Russell
2009-02-19 17:14             ` Mike Frysinger
2009-02-19  0:15       ` Rusty Russell
2009-02-19  9:51         ` Russell King
2009-02-19 11:48           ` Rusty Russell

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