From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8qwb-0002bP-QQ for qemu-devel@nongnu.org; Wed, 07 Jan 2015 08:46:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8qwU-0000ko-Up for qemu-devel@nongnu.org; Wed, 07 Jan 2015 08:46:41 -0500 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]:38433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8qwU-0000jz-JL for qemu-devel@nongnu.org; Wed, 07 Jan 2015 08:46:34 -0500 Received: by mail-pa0-f43.google.com with SMTP id kx10so4999618pab.2 for ; Wed, 07 Jan 2015 05:46:31 -0800 (PST) Received: from HalseyPC ([103.242.168.62]) by mx.google.com with ESMTPSA id qp4sm1068581pbc.63.2015.01.07.00.37.12 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jan 2015 00:37:15 -0800 (PST) From: "Halsey Pian" Date: Wed, 7 Jan 2015 16:36:39 +0800 Message-ID: <01a601d02a55$11e79200$35b6b600$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01A7_01D02A98.200D1BF0" Content-Language: zh-cn Subject: [Qemu-devel] [Makefile] Compiling Qemu to dynamic library List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multipart message in MIME format. ------=_NextPart_000_01A7_01D02A98.200D1BF0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Dear All, Recently, I would try to compile qemu to a so in order to call qemu internal functions in my program, I'm trying to do this by steps, 1. Add rules in qemu-2.1.2/ rules.mak %.so: $(call quiet-command,rm -f $@ && $(LINKPROG) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) -fPIC -shared -DBUILD_DSO $(CFLAGS) $($@-cflags) $(LDFLAGS) $(LIBS) -o $@ $^," GEN $(TARGET_DIR)$@") 2. Add target in qemu-2.1.2/Makefile qemu-kvm-obj = vl.o blockdev.o migration.o migration-unix.o qtest.o migration-fd.o ioport.o savevm.o cpus.o qemu-kvm-obj += net/net.o net/queue.o qemu-kvm-obj += ui/console.o qemu-kvm-obj += qom/object.o qemu-kvm-obj += hw/usb/bus.o qemu-kvm-obj += pixman/pixman/pixman-bits-image.o pixman/pixman/pixman-utils.o qemu-kvm-obj += qapi/qapi-visit-core.o libqemu.so : $(block-obj-y) $(util-obj-y) qemu-img.o vmstate.o qemu-file.o $(qemu-kvm-obj) vl.o qapi-event.o migration.o blockdev.o migration-unix.o qtest.o migration-fd.o as you know, the main entrance for final binary qemu-system-x86_64 is located in vl.c, I just want it and qemu-img.o to be included in the so library, so it seems that there are many dependent objects above should have to be included, that would be suffering problem to be fixed below during doing this, There are many platform dependent source code i.e. cpus.c memory.c, how to compile them into so for specific platform? Is there some guidance for building qemu to so? could you give help on this? Thanks a lot! Best Regards Halsey Pian ------=_NextPart_000_01A7_01D02A98.200D1BF0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Dear All,

 

Recently, I would try to = compile qemu to a so in order to call qemu internal functions in my = program, I’m trying to do this by steps,

 

1.       = Add rules = in qemu-2.1.2/ rules.mak

 

%.so:

$(call quiet-command,rm -f $@ && = $(LINKPROG) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) -fPIC = -shared -DBUILD_DSO  $(CFLAGS) $($@-cflags) $(LDFLAGS) = $(LIBS)   -o $@ $^,"  GEN    = $(TARGET_DIR)$@")

 

2.       = Add target = in qemu-2.1.2/Makefile

 

qemu-kvm-obj = =3D vl.o blockdev.o migration.o migration-unix.o qtest.o migration-fd.o = ioport.o savevm.o cpus.o

qemu-kvm-obj = +=3D  net/net.o net/queue.o

qemu-kvm-obj = +=3D ui/console.o

qemu-kvm-obj = +=3D qom/object.o

qemu-kvm-obj = +=3D hw/usb/bus.o

qemu-kvm-obj = +=3D pixman/pixman/pixman-bits-image.o = pixman/pixman/pixman-utils.o

qemu-kvm-obj = +=3D qapi/qapi-visit-core.o

 

libqemu.so : = $(block-obj-y) $(util-obj-y) qemu-img.o  vmstate.o qemu-file.o = $(qemu-kvm-obj) vl.o qapi-event.o migration.o  blockdev.o = migration-unix.o qtest.o migration-fd.o

 

as you know, the = main entrance for final binary qemu-system-x86_64 is located in vl.c, I = just want it and qemu-img.o to be included in the so library, so  = it seems that there are many dependent objects above should have to be = included,  that would be suffering problem to be fixed below during = doing this,

 

There are many platform = dependent source code i.e. cpus.c memory.c, how to compile them into so = for specific platform? Is there some guidance for building qemu to so? = could you give help on this?

 

Thanks a = lot!

 

Best = Regards

Halsey = Pian

 

------=_NextPart_000_01A7_01D02A98.200D1BF0--