From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cristi Magherusan Subject: Re: uClibc compatibility or static linking support Date: Sun, 06 Jul 2008 13:07:44 +0300 Message-ID: <1215338864.4175.59.camel@localhost> References: <1215287773.21784.25.camel@localhost> <48707BFE.4030207@qumranet.com> Reply-To: cristi.magherusan@net.utcluj.ro Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from bavaria.utcluj.ro ([193.226.5.35]:58387 "EHLO bavaria.utcluj.ro" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753569AbYGFKIM (ORCPT ); Sun, 6 Jul 2008 06:08:12 -0400 In-Reply-To: <48707BFE.4030207@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: Hello, On Sun, 2008-07-06 at 11:02 +0300, Avi Kivity wrote: > Cristi Magherusan wrote: > > Hello, > > > > As part of my GSoC project I'm working to create a small coreboot > > payload containing a KVM-enabled Linux kernel and the KVM tools. > > > > This involves either compiling and linking KVM against uClibc, or m= aking > > a static binary linked against glibc. > > > > Has anyone tried compiling kvm against uClibc before? I did and it = seems > > it has some issues. I have fixed some by including aio support insi= de > > uClibc, but it still won't work and I get some linking errors..I ca= n > > provide more details if needed. > > > > =20 >=20 > Please post the build log. Sorry, the part about incompatibility with uClibc was an error on my side. It were just my build tools. I had some errors in the Makefile I'm using for KVM which are now partially fixed and now I got rid of that error, but I have another strange one which again seems to be caused by my Makefile. =46or building all the stuff I'm using a somehow modified version of coreboot's buildrom.=20 This is my build log: http://rafb.net/p/DXMwsg76.html And this is my Makefile that triggers the kvm make command: http://tinyurl.com/66objx Currently, in order to reproduce it some steps must be done manually bu= t those will be patched in the sources later on... So if you want to reproduce it yourself, these are the steps: git clone git://repo.or.cz/kvm-coreboot.git Then cd into the dir and type "make" Beware, it will download and compile some stuff, including a 2.6.22 linux kernel, busybox and uClibc, so it will take a while to complete. Also, note that gcc-4.3 will fail to build the kernel and you'll either have to use gcc <=3D4.2.x or add a strange CFLAG to the kernel Makefile= , at the CFLAGS_KERNEL. I'll search for that one and include a patch for it by default, but for now I'm sticking to gcc-4.2.4. After everything builds, kvm-70 will break at some point. First rsync -= R will fail, and you must remove the line containing "$(LINUX)"/./include/asm-*/kvm*.h from work/kvm-tools/kvm-70/kernel/Makefile It's strange that the first compilation fails with this message: /tmp/kvm-coreboot/work/kvm-tools/kvm-70/qemu/hw/i8254-kvm.c: In functio= n =E2=80=98kvm_pit_save=E2=80=99: /tmp/kvm-coreboot/work/kvm-tools/kvm-70/qemu/hw/i8254-kvm.c:36: error: storage size of =E2=80=98pit=E2=80=99 isn=E2=80=99t known /tmp/kvm-coreboot/work/kvm-tools/kvm-70/qemu/hw/i8254-kvm.c:41: warning= : implicit declaration of function =E2=80=98kvm_get_pit=E2=80=99....... Then if you run make again it will pass over that point and you'll get some errors caused by u32 and u64 in work/kvm-tools/kvm-70/kernel/include/linux/kvm_para.h to fix those run this command: sed -i -e 's/u32/uint32_t/;s/u64/uint64_t/' \ work/kernel/linux-2.6.22.2/include/linux/kvm_para.h then include in the same file. Run make again and then you get the error I'm facing now. > > Also, it seems that currently there's no way to build it statically > > linked against glibc, so that I can include it in my BIOS image in = this > > way. I used the -static CFLAG, but it seems it is still linked > > dinamically against the same libs. Any ideas? > > =20 >=20 > I don't see any reason for that. Perhaps the build logs will tell. I hope I won't need to do this and that uClibc will be enough. Thanks for your answer, Cristi --=20 Ing. Cristi M=C4=83gheru=C8=99an, Universitatea Tehnic=C4=83 din Cluj-Napoca Centrul de Comunica=C8=9Bii "Pusztai Kalman" Tel. 0264/401247 http://cc.utcluj.ro