Skip to contentSkip to conversation

kvm-userspace: kvmppc: fix build for ppc

PATCH New [email protected] 2 participants 4 messages Sep 16, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover kvm-userspace: kvmppc: fix build for ppc

From: Christian Ehrhardt <[email protected]>

Updating and testing kvm-userspace for ppc after a too long time brought up some issues fixed in this series.

The patches are small and their description should be comprehendible. Due to the fact that most of the issues where build time issues I also started to discuss about/establish some kind of automated build test for us that should allow us to find such things faster.
let me know if qumranet has such a process for x86 already and I should help you to include ppc.

[patches in series]
[PATCH 1/3] kvm-userspace: kvmppc: fix file header in libkvm-powerpc.c [PATCH 2/3] kvm-userspace: kvmppc: fix hostlonbits detection when cross compiling [PATCH 3/3] kvm-userspace: kvmppc: fix building userspace for powerpc

---
[diffstat]

 Makefile                       |    3 ++-
 kernel/powerpc/Makefile.pre    |    1 +
 kernel/powerpc/hack-module.awk |    5 +++++
 libkvm/libkvm-powerpc.c        |   14 +++++---------
 qemu/Makefile.target           |    2 +-
 qemu/configure                 |   13 +++++++------
 6 files changed, 21 insertions(+), 17 deletions(-)

A message that is not in the archive (sent off-list or not yet received): 1221554914-29751-1-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org

#2 lore raw

PATCH 1/3 kvm-userspace: kvmppc: fix file header in libkvm-powerpc.c

From: Christian Ehrhardt <[email protected]>

It came up in the review of the s390 libkvm code that we have some broken headers too.

---

[diffstat]

 libkvm-powerpc.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

[diff]

libkvm/libkvm-powerpc.c +5 -9
@@ -1,10 +1,7 @@
 /*
- * This header is for functions & variables that will ONLY be
- * used inside libkvm for x86.
- * THESE ARE NOT EXPOSED TO THE USER AND ARE ONLY FOR USE
- * WITHIN LIBKVM.
- *
- * derived from libkvm.c
+ * This file contains the powerpc specific implementation for the 
+ * architecture dependent functions defined in kvm-common.h and
+ * libkvm.h
  *
  * Copyright (C) 2006 Qumranet, Inc.
  *
@@ -12,11 +9,10 @@
  *      Avi Kivity   <avi-atKUWr5tajBWk0Htik3J/[email protected]>
  *      Yaniv Kamay  <yaniv-atKUWr5tajBWk0Htik3J/[email protected]>
  *
- * Copyright 2007 IBM Corporation.
- * Added by & Authors:
+ * Copyright IBM Corp. 2007,2008
+ * Added by:
  * 	Jerone Young <jyoung5-r/[email protected]>
  * 	Christian Ehrhardt <[email protected]>
- *
  *
  * This work is licensed under the GNU LGPL license, version 2.
  */

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

PATCH 2/3 kvm-userspace: kvmppc: fix hostlonbits detection when cross compiling

In reply to a message not in the archive

From: Christian Ehrhardt <[email protected]>

The kvm merge with qemu brought code for 64bit power that broke cross compilation. The issue is caused by configure trying to execute target architecture binaries where configure is executed.

I tried to change that detection so that it works with&without cross compilation with only a small change and especially without an addtional configure command line switch. Including the bits/wordsize.h header a platform usually can check its wordsize and by doing that configure can check the hostlongbits without executing the binary. Instead it now stops after preprocessing stage which resolved the __WORDSIZE constant and retrieves that value.

I don't like that check style, but it is at least less broken than before. Comments and other approaches welcome.

---

[diffstat]

 configure |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

[diff]

qemu/configure +7 -6
@@ -685,14 +685,15 @@
 # ppc specific hostlongbits selection
 if test "$cpu" = "powerpc" ; then
     cat > $TMPC <<EOF
-int main(void){return sizeof(long);}
+#include <bits/wordsize.h>
+__WORDSIZE
 EOF
 
-    if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null; then
-        $TMPE
-        case $? in
-            4) hostlongbits="32";;
-            8) hostlongbits="64";;
+    if $cc $ARCH_CFLAGS -E -o $TMPE.E $TMPC 2> /dev/null; then
+        wordsize=`tail -n 1 ${TMPE}.E`
+        case $wordsize in
+            32) hostlongbits="32";;
+            64) hostlongbits="64";;
             *) echo "Couldn't determine bits per long value"; exit 1;;
         esac
     else

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

PATCH 1/1 kvm-userspace: kvmppc: fix building userspace for powerpc

In reply to [email protected]

From: Christian Ehrhardt <[email protected]>

Commit 2d5737d8 added the requirement for an $arch/Makefile.pre in the kernel subdirectory. This patch adds a stub for powerpc. Additionally now a file kernel/$arch/hack-module.awk is needed and a simple version for ppc is added for that one too.
In the root Makefile ia64 patch 030253bf added ia64 with a comma which should break both architectures because filter works without. The patch removes that comma.
The commit 76ff90aa fixed the dependency to DEPLIBS, but the definition of the libfdt dependency lacks the right path (../libfdt/).

---

[diffstat]

 Makefile                       |    2 +-
 kernel/powerpc/Makefile.pre    |    1 +
 kernel/powerpc/hack-module.awk |    5 +++++
 qemu/Makefile.target           |    2 +-
 4 files changed, 8 insertions(+), 2 deletions(-)

[diff]

Makefile +1 -1
@@ -23,7 +23,7 @@
 ifneq '$(filter $(ARCH), i386 x86_64)' ''
     qemu: extboot
 endif
-ifneq '$(filter $(ARCH), powerpc, ia64)' ''
+ifneq '$(filter $(ARCH), powerpc ia64)' ''
     qemu: libfdt
 endif
 user: libkvm
kernel/powerpc/Makefile.pre new file +1 -0
new file mode 100644
@@ -0,0 +1,1 @@
+prerequisite:
kernel/powerpc/hack-module.awk new file +5 -0
new file mode 100644
@@ -0,0 +1,5 @@
+/MODULE_AUTHOR/ {
+    printf("MODULE_INFO(version, \"%s\");\n", version)
+}
+
+{ print }
qemu/Makefile.target +1 -1
@@ -579,7 +579,7 @@
 
 ifdef CONFIG_LIBFDT
 LIBS += -lfdt
-DEPLIBS += libfdt.a
+DEPLIBS += ../libfdt/libfdt.a
 endif
 
 # SCSI layer