public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] kvmtool: Rework guest/init integration
@ 2015-06-23 15:06 Andre Przywara
  2015-06-23 15:06 ` [RFC PATCH 1/2] Makefile: cleanup guest/init generation Andre Przywara
  2015-06-23 15:06 ` [RFC PATCH 2/2] Makefile: use xxd for converting guest/init Andre Przywara
  0 siblings, 2 replies; 4+ messages in thread
From: Andre Przywara @ 2015-06-23 15:06 UTC (permalink / raw)
  To: will.deacon, Andreas Herrmann; +Cc: kvm

Hi,

this mini series aims at solving long standing issues with compiling
and linking the guest/init binary for MIPS.
It seems that many MIPS toolchains use different default ELF targets
for the compiler and the linker, rendering the approach of linking
the guest/init executable into the lkvm binary moot.
One could work around this by specifying some magic ELF target
options to the linker so it matches the compiler ones, but I couldn't
find a way of automatically determining those, so this approach is
only valid on a particular toolchain.
Another approach would be to fixup the ELF header, but that sounds
dodgy and fragile to me.

Instead of using "ld" this series transforms the generated guest
binary into a C file, which gets compiled (with CC) and thus
automatically links fine with the other object files.
Patch 2/2 implements this, patch 1/2 cleans up the rules for the
guest binary generation in the Makefile.

This uses the "xxd" tool, which has a special command line option
to generate a C array out of a binary blob. On the distributions
I checked, this comes with the vim package, not sure if that is a
restriction.

I compile tested this on on PowerPC64, MIPS64, ARM, ARM64, i386 and
x86_64.

Please test whether this works with your toolchain / system!

Cheers,
Andre.

Andre Przywara (2):
  Makefile: cleanup guest/init generation
  Makefile: use xxd for converting guest/init

 Makefile        | 21 ++++++++++++---------
 builtin-run.c   |  8 ++++----
 builtin-setup.c |  8 ++++----
 3 files changed, 20 insertions(+), 17 deletions(-)

-- 
2.3.5


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-24  9:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-23 15:06 [RFC PATCH 0/2] kvmtool: Rework guest/init integration Andre Przywara
2015-06-23 15:06 ` [RFC PATCH 1/2] Makefile: cleanup guest/init generation Andre Przywara
2015-06-23 15:06 ` [RFC PATCH 2/2] Makefile: use xxd for converting guest/init Andre Przywara
2015-06-24  8:53   ` Andreas Herrmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox