qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Halsey Pian" <halsey.pian@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Makefile] Compiling Qemu to dynamic library
Date: Thu, 8 Jan 2015 12:02:37 +0800	[thread overview]
Message-ID: <000c01d02af7$f2b94060$d82bc120$@gmail.com> (raw)
In-Reply-To: 

[-- Attachment #1: Type: text/plain, Size: 2432 bytes --]

Hi All,

 

During building this so library, I found that there are many functions with same name in stubs and other source file, for example,

 

There are two implement functions with same name slirp_pollfds_fill in slirp.c and main-loop.c.

 

./stubs/slirp.c:void slirp_pollfds_fill(GArray *pollfds, uint32_t *timeout)

./main-loop.c:    slirp_pollfds_fill(gpollfds, &timeout);

 

Do you know when qemustub should be used? libqemustub.a is only used for qemu-img, qemu-nbd, qemu-io, but not for
qemu-system-x86_64(and other platform binary)? 

 

Thanks!

 

Best Regards

Halsey Pian

 

From: Halsey Pian [mailto:halsey.pian@gmail.com] 
Sent: 2015年1月7日 16:37
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [Makefile] Compiling Qemu to dynamic library

 

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

 


[-- Attachment #2: Type: text/html, Size: 11636 bytes --]

             reply	other threads:[~2015-01-08  4:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08  4:02 Halsey Pian [this message]
2015-01-08 10:39 ` [Qemu-devel] [Makefile] Compiling Qemu to dynamic library Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2015-01-12  2:18 Halsey Pian
2015-01-07  8:36 Halsey Pian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000c01d02af7$f2b94060$d82bc120$@gmail.com' \
    --to=halsey.pian@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).