Skip to content

Commit

Permalink
Fix build on fc37
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaszAIR committed Feb 20, 2023
1 parent 5f1d3f2 commit a56c58b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions 1320-xen-tpm.c-add-memcpy-implementation-inside-EARLY_TPM.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From 198ac8180ec5bda23aa56574f4c2282549324040 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomasz=20=C5=BByjewski?= <[email protected]>
Date: Mon, 20 Feb 2023 17:21:06 +0100
Subject: [PATCH] xen: tpm.c: add memcpy implementation inside EARLY_TPM
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Compiling xen fails when `-mtune=generic` is set, the error is

ld: arch/x86/boot/tpm_early.o: in function `tpm_hash_extend':
tpm.c:(.text+0x43f): undefined reference to `memcpy'

Add memcpy implementation so linker can use it for tpm_early.o

Signed-off-by: Tomasz Żyjewski <[email protected]>
---
xen/arch/x86/tpm.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/xen/arch/x86/tpm.c b/xen/arch/x86/tpm.c
index 705c00c9029f..7139835ddb39 100644
--- a/xen/arch/x86/tpm.c
+++ b/xen/arch/x86/tpm.c
@@ -34,6 +34,15 @@ asm (
#endif
#define __va(x) _p(x)

+void *memcpy(void *dest, const void *src, size_t n)
+{
+ const uint8_t *s = src;
+ uint8_t *d = dest;
+ while(n--)
+ *d++ = *s++;
+ return dest;
+}
+
#else /* __EARLY_TPM__ */

#include <xen/mm.h>
--
2.25.1

1 change: 1 addition & 0 deletions xen.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ Patch1316: 1316-x86-intel_txt.c-properly-reserve-TXT-data.patch
Patch1317: 1317-x86-tpm.c-map-TXT-TPM-event-log-as-needed.patch
Patch1318: 1318-x86-boot-choose-AP-stack-based-on-APIC-ID.patch
Patch1319: 1319-x86-smpboot.c-TXT-AP-bringup.patch
Patch1320: 1320-xen-tpm.c-add-memcpy-implementation-inside-EARLY_TPM.patch

%if %build_qemutrad
BuildRequires: libidn-devel zlib-devel SDL-devel curl-devel
Expand Down

0 comments on commit a56c58b

Please sign in to comment.