diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2006-07-12 10:40:36 +0000 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2006-07-12 10:40:36 +0000 |
commit | 9a5dce90aef183a067f9d5ebad0d4497f38dbfc5 (patch) | |
tree | a85e4c93c1c2ca5efef358a411c8340f7c4ef6e7 /app-emulation/qemu-softmmu | |
parent | Remove useless cpp checks in freetype (bug #138116). (diff) | |
download | gentoo-2-9a5dce90aef183a067f9d5ebad0d4497f38dbfc5.tar.gz gentoo-2-9a5dce90aef183a067f9d5ebad0d4497f38dbfc5.tar.bz2 gentoo-2-9a5dce90aef183a067f9d5ebad0d4497f38dbfc5.zip |
New revision
(Portage version: 2.1.1_pre2-r4)
Diffstat (limited to 'app-emulation/qemu-softmmu')
5 files changed, 288 insertions, 1 deletions
diff --git a/app-emulation/qemu-softmmu/ChangeLog b/app-emulation/qemu-softmmu/ChangeLog index e42c4f9be33d..9ac351442f52 100644 --- a/app-emulation/qemu-softmmu/ChangeLog +++ b/app-emulation/qemu-softmmu/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-emulation/qemu-softmmu # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-softmmu/ChangeLog,v 1.20 2006/06/09 06:18:16 mr_bones_ Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-softmmu/ChangeLog,v 1.21 2006/07/12 10:40:36 lu_zero Exp $ + +*qemu-softmmu-0.8.1-r1 (12 Jul 2006) + + 12 Jul 2006; Luca Barbato <lu_zero@gentoo.org> + +files/qemu-0.8.0-gcc4-hacks.patch, +files/qemu-0.8.0-gcc4-opts.patch, + +qemu-softmmu-0.8.1-r1.ebuild: + Updated revision, with alsa and partial gcc4 support on x86 (phreak and + genstef found the patches) 09 Jun 2006; Michael Sterrett <mr_bones_@gentoo.org> -files/qemu-softmmu-0.7.0-errno.patch, -files/kqemu-0.7.1-sysfs.patch, diff --git a/app-emulation/qemu-softmmu/files/digest-qemu-softmmu-0.8.1-r1 b/app-emulation/qemu-softmmu/files/digest-qemu-softmmu-0.8.1-r1 new file mode 100644 index 000000000000..ecd18146290f --- /dev/null +++ b/app-emulation/qemu-softmmu/files/digest-qemu-softmmu-0.8.1-r1 @@ -0,0 +1,6 @@ +MD5 02cfdecda90458d6393781496ec6b48b kqemu-0.7.2.tar.gz 79314 +RMD160 cdb154d51eb616d6ad9924da0175276a655edba7 kqemu-0.7.2.tar.gz 79314 +SHA256 4158b2c67603f5256a78d0065d715bde068a457aa58bbfef12dda20fe7f7ad8b kqemu-0.7.2.tar.gz 79314 +MD5 67d924324a5ab79d017bd97a1e767285 qemu-0.8.1.tar.gz 1623264 +RMD160 04d163d4792bbea39fc0b1e52af124cdb7e907dc qemu-0.8.1.tar.gz 1623264 +SHA256 a1f83666f5c05eaee9bfc608a3a5034ad95d0fd3c99937bb399bf9235a6aa0c9 qemu-0.8.1.tar.gz 1623264 diff --git a/app-emulation/qemu-softmmu/files/qemu-0.8.0-gcc4-hacks.patch b/app-emulation/qemu-softmmu/files/qemu-0.8.0-gcc4-hacks.patch new file mode 100644 index 000000000000..b5aa0fd36873 --- /dev/null +++ b/app-emulation/qemu-softmmu/files/qemu-0.8.0-gcc4-hacks.patch @@ -0,0 +1,126 @@ +2005-10-28 Gwenole Beauchesne <gbeauchesne@mandriva.com> + + * Various additional hacks for GCC4. + +Index: qemu-0.8.1/cpu-all.h +=================================================================== +--- qemu-0.8.1.orig/cpu-all.h ++++ qemu-0.8.1/cpu-all.h +@@ -339,7 +339,13 @@ static inline void stl_le_p(void *ptr, i + + static inline void stq_le_p(void *ptr, uint64_t v) + { ++#if defined(__i386__) && __GNUC__ >= 4 ++ const union { uint64_t v; uint32_t p[2]; } x = { .v = v }; ++ ((uint32_t *)ptr)[0] = x.p[0]; ++ ((uint32_t *)ptr)[1] = x.p[1]; ++#else + *(uint64_t *)ptr = v; ++#endif + } + + /* float access */ +Index: qemu-0.8.1/softmmu_header.h +=================================================================== +--- qemu-0.8.1.orig/softmmu_header.h ++++ qemu-0.8.1/softmmu_header.h +@@ -108,7 +108,7 @@ DATA_TYPE REGPARM(1) glue(glue(__ld, SUF + void REGPARM(2) glue(glue(__st, SUFFIX), MMUSUFFIX)(target_ulong addr, DATA_TYPE v, int is_user); + + #if (DATA_SIZE <= 4) && (TARGET_LONG_BITS == 32) && defined(__i386__) && \ +- (ACCESS_TYPE <= 1) && defined(ASM_SOFTMMU) ++ (ACCESS_TYPE <= 1) && defined(ASM_SOFTMMU) && (__GNUC__ < 4) + + #define CPU_TLB_ENTRY_BITS 4 + +@@ -150,7 +150,7 @@ static inline RES_TYPE glue(glue(ld, USU + "m" (*(uint32_t *)offsetof(CPUState, tlb_table[CPU_MEM_INDEX][0].addr_read)), + "i" (CPU_MEM_INDEX), + "m" (*(uint8_t *)&glue(glue(__ld, SUFFIX), MMUSUFFIX)) +- : "%eax", "%ecx", "%edx", "memory", "cc"); ++ : "%eax", "%edx", "memory", "cc"); + return res; + } + +@@ -197,13 +197,14 @@ static inline int glue(glue(lds, SUFFIX) + "m" (*(uint32_t *)offsetof(CPUState, tlb_table[CPU_MEM_INDEX][0].addr_read)), + "i" (CPU_MEM_INDEX), + "m" (*(uint8_t *)&glue(glue(__ld, SUFFIX), MMUSUFFIX)) +- : "%eax", "%ecx", "%edx", "memory", "cc"); ++ : "%eax", "%edx", "memory", "cc"); + return res; + } + #endif + +-static inline void glue(glue(st, SUFFIX), MEMSUFFIX)(target_ulong ptr, RES_TYPE v) ++static inline void glue(glue(st, SUFFIX), MEMSUFFIX)(target_ulong ptr, RES_TYPE val) + { ++ RES_TYPE v = val; + asm volatile ("movl %0, %%edx\n" + "movl %0, %%eax\n" + "shrl %3, %%edx\n" +@@ -240,16 +241,14 @@ static inline void glue(glue(st, SUFFIX) + "2:\n" + : + : "r" (ptr), +-/* NOTE: 'q' would be needed as constraint, but we could not use it +- with T1 ! */ +- "r" (v), ++ "q" (v), + "i" ((CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS), + "i" (TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS), + "i" (TARGET_PAGE_MASK | (DATA_SIZE - 1)), + "m" (*(uint32_t *)offsetof(CPUState, tlb_table[CPU_MEM_INDEX][0].addr_write)), + "i" (CPU_MEM_INDEX), + "m" (*(uint8_t *)&glue(glue(__st, SUFFIX), MMUSUFFIX)) +- : "%eax", "%ecx", "%edx", "memory", "cc"); ++ : "%eax", "%edx", "memory", "cc"); + } + + #else +Index: qemu-0.8.1/target-i386/helper.c +=================================================================== +--- qemu-0.8.1.orig/target-i386/helper.c ++++ qemu-0.8.1/target-i386/helper.c +@@ -3145,8 +3145,15 @@ void helper_fxrstor(target_ulong ptr, in + nb_xmm_regs = 8 << data64; + addr = ptr + 0xa0; + for(i = 0; i < nb_xmm_regs; i++) { ++#if defined(__i386__) && __GNUC__ >= 4 ++ env->xmm_regs[i].XMM_L(0) = ldl(addr); ++ env->xmm_regs[i].XMM_L(1) = ldl(addr + 4); ++ env->xmm_regs[i].XMM_L(2) = ldl(addr + 8); ++ env->xmm_regs[i].XMM_L(3) = ldl(addr + 12); ++#else + env->xmm_regs[i].XMM_Q(0) = ldq(addr); + env->xmm_regs[i].XMM_Q(1) = ldq(addr + 8); ++#endif + addr += 16; + } + } +Index: qemu-0.8.1/target-i386/ops_sse.h +=================================================================== +--- qemu-0.8.1.orig/target-i386/ops_sse.h ++++ qemu-0.8.1/target-i386/ops_sse.h +@@ -34,6 +34,12 @@ + #define Q(n) XMM_Q(n) + #define SUFFIX _xmm + #endif ++#if defined(__i386__) && __GNUC__ >= 4 ++#define RegCopy(d, s) __builtin_memcpy(&(d), &(s), sizeof(d)) ++#endif ++#ifndef RegCopy ++#define RegCopy(d, s) d = s ++#endif + + void OPPROTO glue(op_psrlw, SUFFIX)(void) + { +@@ -570,7 +576,7 @@ void OPPROTO glue(op_pshufw, SUFFIX) (vo + r.W(1) = s->W((order >> 2) & 3); + r.W(2) = s->W((order >> 4) & 3); + r.W(3) = s->W((order >> 6) & 3); +- *d = r; ++ RegCopy(*d, r); + } + #else + void OPPROTO op_shufps(void) diff --git a/app-emulation/qemu-softmmu/files/qemu-0.8.0-gcc4-opts.patch b/app-emulation/qemu-softmmu/files/qemu-0.8.0-gcc4-opts.patch new file mode 100644 index 000000000000..4819dfb7f2a2 --- /dev/null +++ b/app-emulation/qemu-softmmu/files/qemu-0.8.0-gcc4-opts.patch @@ -0,0 +1,41 @@ +2005-11-11 Gwenole Beauchesne <gbeauchesne@mandriva.com> + + * Globaaly save %ebx, %esi, %edi on entry to generated + function. This avoids some register spills in synthetic opcodes. + NOTE: this also easily fixes gcc4 compiled qemu-system-x86_64 on x86. + +Index: qemu-0.8.1/Makefile.target +=================================================================== +--- qemu-0.8.1.orig/Makefile.target ++++ qemu-0.8.1/Makefile.target +@@ -68,6 +68,10 @@ OP_CFLAGS+= -falign-functions=0 -fno-gcs + else + OP_CFLAGS+= -malign-functions=0 + endif ++ifeq ($(TARGET_ARCH), x86_64) ++# XXX globally save %ebx, %esi, %edi on entry to generated function ++OP_CFLAGS+= -fcall-used-ebx -fcall-used-esi -fcall-used-edi ++endif + + ifdef TARGET_GPROF + USE_I386_LD=y +Index: qemu-0.8.1/cpu-exec.c +=================================================================== +--- qemu-0.8.1.orig/cpu-exec.c ++++ qemu-0.8.1/cpu-exec.c +@@ -677,6 +677,15 @@ int cpu_exec(CPUState *env1) + : /* no outputs */ + : "r" (gen_func) + : "r1", "r2", "r3", "r8", "r9", "r10", "r12", "r14"); ++#elif defined(TARGET_X86_64) && defined(__i386__) ++ asm volatile ("push %%ebx\n" ++ "push %%esi\n" ++ "push %%edi\n" ++ "call *%0\n" ++ "pop %%edi\n" ++ "pop %%esi\n" ++ "pop %%ebx\n" ++ : : "r" (gen_func) : "ebx", "esi", "edi"); + #elif defined(TARGET_I386) && defined(USE_CODE_COPY) + { + if (!(tb->cflags & CF_CODE_COPY)) { diff --git a/app-emulation/qemu-softmmu/qemu-softmmu-0.8.1-r1.ebuild b/app-emulation/qemu-softmmu/qemu-softmmu-0.8.1-r1.ebuild new file mode 100644 index 000000000000..bbc9ec3cac10 --- /dev/null +++ b/app-emulation/qemu-softmmu/qemu-softmmu-0.8.1-r1.ebuild @@ -0,0 +1,106 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-softmmu/qemu-softmmu-0.8.1-r1.ebuild,v 1.1 2006/07/12 10:40:36 lu_zero Exp $ + +inherit eutils flag-o-matic toolchain-funcs + +DESCRIPTION="Multi-platform & multi-targets cpu emulator and dynamic translator" +HOMEPAGE="http://fabrice.bellard.free.fr/qemu/" +SRC_URI="${HOMEPAGE}${P/-softmmu/}.tar.gz + kqemu? ( ${HOMEPAGE}kqemu-0.7.2.tar.gz )" + +LICENSE="GPL-2 LGPL-2.1 KQEMU" +SLOT="0" +KEYWORDS="-alpha ~amd64 ~ppc -sparc ~x86" +IUSE="alsa kqemu sdl" #qvm86 debug nptl qemu-fast nptlonly" +RESTRICT="nostrip test" + +RDEPEND="sdl? ( media-libs/libsdl ) + kqemu? ( app-emulation/kqemu ) + alsa? ( media-libs/alsa-lib )" + +DEPEND="${RDEPEND} + !<=app-emulation/qemu-0.7.0 + app-text/texi2html" + +S="${WORKDIR}/${P/-softmmu/}" + +set_target_list() { + TARGET_LIST="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu arm-softmmu mips-softmmu" + export TARGET_LIST +} + +pkg_setup() { + if [ "$(gcc-major-version)" == "4" ]; then + elog "Qemu could not build with GCC 4" + fi +} + +#RUNTIME_PATH="/emul/gnemul/" +src_unpack() { + unpack ${A} + if use kqemu; then + mv ${WORKDIR}/kqemu ${S} + cd ${S}/kqemu + #Let the configure find kqemu but NOT build it + sed -i -e 's:$(MAKE) -C kqemu*::' ${S}/Makefile + fi + + cd ${S} + + epatch "${FILESDIR}"/qemu-0.8.0-gcc4-hacks.patch + epatch "${FILESDIR}"/qemu-0.8.0-gcc4-opts.patch + + # Alter target makefiles to accept CFLAGS set via flag-o. + sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \ + Makefile Makefile.target tests/Makefile + # Ensure mprotect restrictions are relaxed for emulator binaries + [[ -x /sbin/paxctl ]] && \ + sed -i 's/^VL_LDFLAGS=$/VL_LDFLAGS=-Wl,-z,execheap/' \ + Makefile.target + # Prevent install of kernel module by qemu's makefile + sed -i 's/\(.\/install.sh\)/#\1/' Makefile +} + +src_compile() { + #Let the application set its cflags + unset CFLAGS + + # Switch off hardened tech + filter-flags -fpie -fstack-protector + + myconf="--disable-gcc-check" + if ! use sdl ; then + myconf="$myconf --disable-gfx-check" + fi + set_target_list +# --interp-prefix=${RUNTIME_PATH}/qemu-%M + ./configure \ + --prefix=/usr \ + --target-list="${TARGET_LIST}" \ + --enable-slirp \ + --kernel-path=${KV_DIR} \ + $(use_enable kqemu) \ + ${myconf} \ + $(use_enable sdl) \ + $(use_enable alsa) \ + || die "could not configure" + + emake || die "make failed" +} + +src_install() { + make install \ + prefix=${D}/usr \ + bindir=${D}/usr/bin \ + datadir=${D}/usr/share/qemu \ + docdir=${D}/usr/share/doc/${P} \ + mandir=${D}/usr/share/man || die + + chmod -x ${D}/usr/share/man/*/* +} + +pkg_postinst() { + einfo "You will need the Universal TUN/TAP driver compiled into" + einfo "kernel or as a module to use the virtual network device." +} |