Skip to contentSkip to conversation

linux-next: UML build error

DISCUSSION Gabriel C 2 participants 3 messages May 21, 2008

Subsystems (2)
lore
Share & tools
lore

Gabriel C

author
#0 lore raw

Hi,

I get the following UML compile error on linux-next-20080521 , 64bit box :

...

CC arch/um/sys-x86_64/ksyms.o
arch/um/sys-x86_64/ksyms.c:5: error: '__memcpy' undeclared here (not in a function) arch/um/sys-x86_64/ksyms.c:5: warning: type defaults to 'int' in declaration of '__memcpy' make[1]: *** [arch/um/sys-x86_64/ksyms.o] Error 1
make: *** [arch/um/sys-x86_64] Error 2

...

config is UM's defconfig.

Regards,

Gabriel

#1 lore raw
Quoted 3 lines · Gabriel C

CC arch/um/sys-x86_64/ksyms.o
arch/um/sys-x86_64/ksyms.c:5: error: '__memcpy' undeclared here (not in a function) arch/um/sys-x86_64/ksyms.c:5: warning: type defaults to 'int' in declaration of '__memcpy'

Does the patch below help? There's gcc-version-dependent logic in include/asm-x86/string_64.h which decides whether to declare memcpy or __memcpy and it looks like you're hitting that.

Jeff

Signature · 20 lines
Work email - jdike at linux dot intel dot com

Index: linux-2.6.22/arch/um/sys-x86_64/ksyms.c
===================================================================
--- linux-2.6.22.orig/arch/um/sys-x86_64/ksyms.c	2008-04-23 13:07:23.000000000 -0400
+++ linux-2.6.22/arch/um/sys-x86_64/ksyms.c	2008-05-21 16:03:03.000000000 -0400
@@ -2,4 +2,8 @@
 #include "asm/string.h"
 
 /*XXX: we need them because they would be exported by x86_64 */
+#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
+EXPORT_SYMBOL(memcpy);
+#else
 EXPORT_SYMBOL(__memcpy);
+#endif

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
author
#2 lore raw
Quoted 8 lines · Jeff Dike
Quoted 3 lines · Gabriel C

CC arch/um/sys-x86_64/ksyms.o
arch/um/sys-x86_64/ksyms.c:5: error: '__memcpy' undeclared here (not in a function) arch/um/sys-x86_64/ksyms.c:5: warning: type defaults to 'int' in declaration of '__memcpy'

Does the patch below help? There's gcc-version-dependent logic in include/asm-x86/string_64.h which decides whether to declare memcpy or __memcpy and it looks like you're hitting that.

Yes is fixes this error , however I get now another one but this one seems to be an compiler bug.

...
CC arch/um/sys-x86_64/um_module.o

  LD      arch/um/sys-x86_64/subarch.o
  LD      arch/um/sys-x86_64/built-in.o
  LD      arch/x86/crypto/built-in.o
  CC      kernel/sched.o

In file included from kernel/sched.c:1842:
kernel/sched_idletask.c: In function 'check_preempt_curr_idle':
kernel/sched_idletask.c:20: internal compiler error: in cgraph_estimate_size_after_inlining, at ipa-inline.c:188

...

This is gcc 4.3.0 ( with backports of some known fixed bugs ).
I try to build latest snapshot of gcc 4.3* later on today and try with this one.

Quoted 3 lines

Jeff

Gabriel