Fix non-optimized compilation of Xen's memcmp
authorKeir Fraser <keir.fraser@citrix.com>
Sat, 24 Nov 2007 13:37:26 +0000 (13:37 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Sat, 24 Nov 2007 13:37:26 +0000 (13:37 +0000)
Even when using __builtin_memcmp, gcc may emit external references to
memcmp (when not optimizing for instance), so this #define does not
always provide a completely suitable memcmp().

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/common/string.c
xen/include/asm-x86/string.h

index 562f6cb585d2886774e5319980f5d50099c294e5..5a357430f1335fe60fc19b7c934bc14707fc33d9 100644 (file)
@@ -370,6 +370,7 @@ void * memmove(void * dest,const void *src,size_t count)
 #endif
 
 #ifndef __HAVE_ARCH_MEMCMP
+#undef memcmp
 /**
  * memcmp - Compare two areas of memory
  * @cs: One area of memory
index 2bbdf0ce42cb41420381fb9ef70003cd47c1a79d..5921d22c85a59eebcf561b772d772575463965b1 100644 (file)
@@ -109,7 +109,8 @@ void *__memcpy(void *t, const void *f, size_t n)
 #define __HAVE_ARCH_MEMMOVE
 extern void *memmove(void *dest, const void *src, size_t n);
 
-#define __HAVE_ARCH_MEMCMP
+/* Some versions of gcc emit references to memcmp despite this macro defn. */
+/*#define __HAVE_ARCH_MEMCMP*/
 #define memcmp __builtin_memcmp
 
 static inline void *__memset_generic(void *s, char c, size_t count)