WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH]: Implement bzip2 and LZMA loaders / fixed patch

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH]: Implement bzip2 and LZMA loaders / fixed patch for Xen 3.4.1
From: Pasi Kärkkäinen <pasik@xxxxxx>
Date: Tue, 25 Aug 2009 18:23:19 +0300
Cc: Chris Lalancette <clalance@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>, Gerd Hoffmann <kraxel@xxxxxxxxxx>
Delivery-date: Tue, 25 Aug 2009 08:24:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.0908241453260.31592@kaball-desktop>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C6B42D7A.129F7%keir.fraser@xxxxxxxxxxxxx> <C6B431D3.129FE%keir.fraser@xxxxxxxxxxxxx> <20090821201200.GW19938@xxxxxxxxxxxxxxx> <20090821212230.GX19938@xxxxxxxxxxxxxxx> <alpine.DEB.2.00.0908241453260.31592@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
On Mon, Aug 24, 2009 at 03:04:00PM +0100, Stefano Stabellini wrote:
> On Fri, 21 Aug 2009, Pasi Kärkkäinen wrote:
> > On Fri, Aug 21, 2009 at 11:12:00PM +0300, Pasi Kärkkäinen wrote:
> > > On Fri, Aug 21, 2009 at 11:13:23AM +0100, Keir Fraser wrote:
> > > > On 21/08/2009 10:54, "Keir Fraser" <keir.fraser@xxxxxxxxxxxxx> wrote:
> > > > 
> > > > >> Good point. pvgrub should support these aswell.
> > > > >> 
> > > > >> Keir: Would you like to add those libs to stubdom?
> > > > >> 
> > > > >> (Note the lzma.h is coming from that "xz" package..)
> > > > > 
> > > > > No. :-) But feel free to make a patch! You'll just need to modify
> > > > > libxc/Makefile too to force those libs on instead of off, as well as
> > > > > download and build the libs of course.
> > > > 
> > > > Actually I just checked in c/s 20105 to get rid of the minios-specific 
> > > > hack
> > > > in that Makefile. So all you need to do is patch to download and build 
> > > > the
> > > > libs. If you make a patch, I will arrange for the lib tarballs to be 
> > > > hosted
> > > > on xenbits and adjust the patch URLs appropriately.
> > > > 
> > > 
> > > I can now see why you didn't want to do that.. :) I managed to get the 
> > > libs to 
> > > compile, but now I'm having other problems..
> > > 
> > > "make stubdom" gets to the point where it compiles ioemu-stubdom, but it 
> > > fails 
> > > to link because xen-unstable.hg/stubdom/mini-os-x86_32-ioemu/mini-os.o 
> > > has 
> > > undefined references in xc_try_bzip2_decode and xc_try_lzma_decode 
> > > functions.. 
> > > 
> > > I guess only pvgrub would need to have this stuff in? I've been trying to
> > > figure out how the makefile magic works, but haven't really understood it 
> > > yet.
> > > 
> > > Any tips how to make ioemu-stubdom compile/link without including 
> > > bzip2/lzma stuff into it? 
> > > 
> > 
> > Actually I guess I could add the missing libs to extras/mini-os/Makefile to
> > APP_LDLIBS to get them included into ioemu-stubdom?
> > 
> > Is that the right way to do it?
> > 
> 
> bzlib and lzma are libxc dependencies now, so firstly you have to add
> the two libraries to the stubdom build system, take a look at
> pciutils in stubdom/Makefile, that is a good example of how a new
> library is added.

This is done, and works. libbz2.a and liblzma.a end up in
stubdom/cross-root-i686/i686-xen-elf/lib/ directory on my 32bit host.

> Then you also need to add them both at least to the libxc target, take a
> look at zlib (and cross-zlib), that should be close to what you need.

Done.

> Finally you need to tweak the libxc Makefile for the stubdom case so
> that the two libraries are correctly added to zlib-options.
> 

So you mean xen-unstable/tools/libxc/Makefile here? This part?

ifeq ($(CONFIG_MiniOS),y)
zlib-options =



The problem I'm seeing now is "ioemu" target from xen-unstable/stubdom/Makefile 
fails to
link:

ld -nostdlib 
-L/root/tem/xen-unstable.hg/stubdom/cross-root-i686/i686-xen-elf/lib  -m 
elf_i386 -T arch/x86/minios-x86_32.lds
/root/tem/xen-unstable.hg/stubdom/mini-os-x86_32-ioemu/mini-os.o  -o 
/root/tem/xen-unstable.hg/stubdom/mini-os-x86_32-ioemu/mini-os
ld: warning: section `.bss' type changed to PROGBITS 
/root/tem/xen-unstable.hg/stubdom/mini-os-x86_32-ioemu/mini-os.o: In function 
`xc_try_bzip2_decode':
/root/tem/xen-unstable.hg/stubdom/libxc-x86_32/xc_dom_bzimageloader.c:42: 
undefined reference to `BZ2_bzDecompressInit'
/root/tem/xen-unstable.hg/stubdom/libxc-x86_32/xc_dom_bzimageloader.c:105: 
undefined reference to `BZ2_bzDecompressEnd'
/root/tem/xen-unstable.hg/stubdom/libxc-x86_32/xc_dom_bzimageloader.c:69: 
undefined reference to `BZ2_bzDecompress'
/root/tem/xen-unstable.hg/stubdom/libxc-x86_32/xc_dom_bzimageloader.c:105: 
undefined reference to `BZ2_bzDecompressEnd'
/root/tem/xen-unstable.hg/stubdom/mini-os-x86_32-ioemu/mini-os.o: In function 
`xc_try_lzma_decode':
/root/tem/xen-unstable.hg/stubdom/libxc-x86_32/xc_dom_bzimageloader.c:158: 
undefined reference to `lzma_alone_decoder'
/root/tem/xen-unstable.hg/stubdom/libxc-x86_32/xc_dom_bzimageloader.c:253: 
undefined reference to `lzma_end'
/root/tem/xen-unstable.hg/stubdom/libxc-x86_32/xc_dom_bzimageloader.c:185: 
undefined reference to `lzma_code'
/root/tem/xen-unstable.hg/stubdom/libxc-x86_32/xc_dom_bzimageloader.c:253: 
undefined reference to `lzma_end'
make[1]: ***
[/root/tem/xen-unstable.hg/stubdom/mini-os-x86_32-ioemu/mini-os] Error 1
make[1]: Leaving directory `/root/tem/xen-unstable.hg/extras/mini-os'
make: *** [ioemu-stubdom] Error 2

So basicly I should add libbz2.a and liblzma.a to the list of files to link,
but I'm a bit lost where this is happening. Should I edit
xen-unstable/extras/mini-os/Makefile to add those libs or somewhere else? 

I tried adding those libs to xen-unstable/stubdom/Makefile to "ioemu" 
TARGET_LDFLAGS, but
that didn't seem to help.

All tips welcome :)

-- Pasi

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel