[XEN PATCH] xen/lib: remove the overwrtitten string functions from x86 build

Federico Serafini posted 1 patch 6 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/c313895654437fe154e989a7d633cca2ccc710d8.1698914967.git.federico.serafini@bugseng.com
xen/lib/Makefile | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
[XEN PATCH] xen/lib: remove the overwrtitten string functions from x86 build
Posted by Federico Serafini 6 months, 2 weeks ago
Remove the generic implementation of memcpy(), memmove() and
memset() from the x86 build since a version written in asm is present.
This addesses violations of MISRA C:2012 Rule 8.6 ("An identifier with
external linkage shall have exactly one external definition").

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/lib/Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index 2d9ebb945f..ac0edd4745 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -1,5 +1,9 @@
 obj-$(CONFIG_X86) += x86/
 
+ifneq ($(CONFIG_X86),y)
+    NO_ARCH_STRING_C=y
+endif
+
 lib-y += bsearch.o
 lib-y += ctors.o
 lib-y += ctype.o
@@ -7,9 +11,9 @@ lib-y += list-sort.o
 lib-y += memchr.o
 lib-y += memchr_inv.o
 lib-y += memcmp.o
-lib-y += memcpy.o
-lib-y += memmove.o
-lib-y += memset.o
+lib-$(NO_ARCH_STRING_C) += memcpy.o
+lib-$(NO_ARCH_STRING_C) += memmove.o
+lib-$(NO_ARCH_STRING_C) += memset.o
 lib-y += muldiv64.o
 lib-y += parse-size.o
 lib-y += rbtree.o
-- 
2.34.1