qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] get qemu to compile as 64-bit on Mac


From: C.W. Betts
Subject: [Qemu-devel] [PATCH] get qemu to compile as 64-bit on Mac
Date: Mon, 2 Jun 2008 15:25:54 -0600

This patch makes it so that you can compile qemu on Mac OS X Leopard as a 64-bit app.  This is heavily based on an earlier patch that had the same goal.

Hint: in order to build qemu on another architecture, you have to modify the config-host.mak and the config-host.h file.  You have to set the ARCH_CFLAGS and ARCH_LDFLAGS in the .mak file to match the architecture that you want to build("-m32 -arch ppc" for PowerPC, "-m64 -arch x86_64" for 64-bit Intel, etc…), as well as the ARCH flag.  In the header file, change the HOST_PPC or HOST_I386 to the processor you want to build on.

Index: dyngen-exec.h
===================================================================
--- dyngen-exec.h (revision 4654)
+++ dyngen-exec.h (working copy)
@@ -36,7 +36,7 @@
 typedef unsigned short uint16_t;
 typedef unsigned int uint32_t;
 // Linux/Sparc64 defines uint64_t
-#if !(defined (__sparc_v9__) && defined(__linux__))
+#if !(defined (__sparc_v9__) && defined(__linux__)) && !(defined(__APPLE__) && defined(__x86_64__))
 /* XXX may be done for all 64 bits targets ? */
 #if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__) 
 typedef unsigned long uint64_t;
@@ -54,7 +54,7 @@
 typedef signed short int16_t;
 typedef signed int int32_t;
 // Linux/Sparc64 defines int64_t
-#if !(defined (__sparc_v9__) && defined(__linux__))
+#if !(defined (__sparc_v9__) && defined(__linux__)) && !(defined(__APPLE__) && defined(__x86_64__))
 #if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__)
 typedef signed long int64_t;
 #else
Index: exec-all.h
===================================================================
--- exec-all.h (revision 4654)
+++ exec-all.h (working copy)
@@ -116,6 +116,9 @@
 #if defined(__i386__) && !defined(_WIN32)
 #define USE_DIRECT_JUMP
 #endif
+#if defined(__x86_64__) && defined(__APPLE__)
+#define USE_DIRECT_JUMP
+#endif
 
 typedef struct TranslationBlock {
     target_ulong pc;   /* simulated PC corresponding to this block (EIP + CS base) */
Index: host-utils.h
===================================================================
--- host-utils.h (revision 4654)
+++ host-utils.h (working copy)
@@ -23,6 +23,8 @@
  * THE SOFTWARE.
  */
 
+#include "osdep.h"
+
 #if defined(__x86_64__)
 #define __HAVE_FAST_MULU64__
 static always_inline void mulu64 (uint64_t *plow, uint64_t *phigh,
Index: osdep.h
===================================================================
--- osdep.h (revision 4654)
+++ osdep.h (working copy)
@@ -37,7 +37,10 @@
 #define always_inline __attribute__ (( always_inline )) __inline__
 #endif
 #endif
+#ifndef __APPLE__
+//Apple has this already defined, this would just mess things up
 #define inline always_inline
+#endif
 
 #ifdef __i386__
 #define REGPARM __attribute((regparm(3)))

Attachment: Mac 64-bit patch.diff
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]