提交 aa0d3bb7 编写于 作者: R Rusty Russell

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.
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 e91defa2
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
unsigned int __machine_arch_type; 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 #ifdef STANDALONE_DEBUG
#define putstr printf #define putstr printf
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册