Package: qemu Version: 0.8.2-1 Severity: normal Tags: patch
This patch adds a "qemu-user-static" package containing statically linked versions of all QEMU user emulators. For instance, the current version install these binaries: /usr/bin/qemu-i386-static /usr/bin/qemu-mips-static /usr/bin/qemu-mipsel-static /usr/bin/qemu-sparc-static /usr/bin/qemu-arm-static /usr/bin/qemu-armeb-static /usr/bin/qemu-ppc-static See also bug #306637 for a companion patch that adds the binfmt mechanism. I'll also shortly update http://wiki.debian.org/QemuUserEmulation with these patches. Note: this patch depends on #390166 being applied. It also contains a small workaround (commented out line in Makefile.target) that allows the static binaries to compile properly with a recent toolchain. I could only test it on Ubuntu Edgy, so It would be nice if someone could test it with/without the workaround on Debian, and report any problems. Changelog: * New package: qemu-user-static. - Add workaround for static build bug. -- Anderson Lizardo
Index: qemu-0.8.2/debian/rules =================================================================== --- qemu-0.8.2.orig/debian/rules 2006-10-29 20:58:39.000000000 -0400 +++ qemu-0.8.2/debian/rules 2006-10-29 21:43:10.000000000 -0400 @@ -16,6 +16,7 @@ endif D = $(CURDIR)/debian/qemu +DS = $(CURDIR)/debian/qemu-user-static qemu_bios_files = \ bios.bin \ @@ -41,12 +42,21 @@ --enable-alsa \ --enable-iasl \ --cc=$(CC) + + for d in *-user; do \ + cp -a $$d $$d-static; \ + echo 'CONFIG_STATIC=yes' >> $$d-static/config.mak; \ + echo '#define CONFIG_STATIC 1' >> $$d-static/config.h; \ + done build: patch config-host.mak dh_testdir $(MAKE) $(MAKE) -C pc-bios + + for d in *-user-static; do \ + make -C $$d; done clean: unpatch dh_testdir @@ -56,6 +66,7 @@ -$(MAKE) distclean rm -f hw/acpi-dsdt.hex hw/acpi-dsdt.aml rm -f $(qemu_docs) + rm -rf *-user-static dh_clean @@ -76,6 +87,12 @@ for i in $(qemu_bios_files); do \ rm -f pc-bios/$$i $(D)/usr/share/qemu/$$i; \ done + + install -d -m755 $(DS)/usr/bin + for d in *-user-static; do \ + $(MAKE) -C $$d DESTDIR=$(DS) install; done + for f in $(DS)/usr/bin/qemu-*; do \ + mv $$f $$f-static; done binary-indep: # Nothing to do. Index: qemu-0.8.2/debian/control =================================================================== --- qemu-0.8.2.orig/debian/control 2006-10-29 21:05:52.000000000 -0400 +++ qemu-0.8.2/debian/control 2006-10-29 21:41:55.000000000 -0400 @@ -55,3 +55,25 @@ . This package contains the files for binfmt-support that allow "transparent" user emulation. + +Package: qemu-user-static +Architecture: amd64 i386 powerpc alpha sparc arm s390 +Suggests: dpkg-cross +Description: fast processor emulator (static user mode emulation) + QEMU is a FAST! processor emulator: currently the package supports + arm, powerpc, sparc and x86 emulation. By using dynamic translation + it achieves reasonable speed while being easy to port on new host + CPUs. QEMU has two operating modes: + . + * User mode emulation: QEMU can launch Linux processes compiled for + one CPU on another CPU. + * Full system emulation: QEMU emulates a full system, including a + processor and various peripherals. It enables easier testing and + debugging of system code. It can also be used to provide virtual + hosting of several virtual PC on a single server. + . + As QEMU requires no host kernel patches to run, it is very safe and + easy to use. + . + This package contains statically linked versions of QEMU user mode + emulators. Index: qemu-0.8.2/Makefile.target =================================================================== --- qemu-0.8.2.orig/Makefile.target 2006-10-29 21:20:52.000000000 -0400 +++ qemu-0.8.2/Makefile.target 2006-10-29 21:21:25.000000000 -0400 @@ -81,7 +81,7 @@ USE_I386_LD=y endif ifdef USE_I386_LD -LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld +#LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld else # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object # that the kernel ELF loader considers as an executable. I think this