From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] Add cross compile to top level configuration file Date: Tue, 16 Oct 2007 15:03:50 -0500 Message-ID: <47151926.5090908@codemonkey.ws> References: <1192475533.5811.6.camel@thinkpad> <4713C9D5.3070001@codemonkey.ws> <1192480549.5811.27.camel@thinkpad> <4714D1BA.6050504@codemonkey.ws> <1192564309.6079.19.camel@thinkpad> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , Avi Kivity To: jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org Return-path: In-Reply-To: <1192564309.6079.19.camel@thinkpad> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Jerone Young wrote: > On Tue, 2007-10-16 at 09:59 -0500, Anthony Liguori wrote: > >> Jerone Young wrote: >> >>> On Mon, 2007-10-15 at 15:13 -0500, Anthony Liguori wrote: >>> >>> >>> >>>>> +fi >>>>> + >>>>> +qemudir=`pwd`/qemu >>>>> + >>>>> +#configure user dir >>>>> +(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \ >>>>> + $user_opts --arch="$arch") >>>>> +(cd qemu; ./configure --target-list=$target_exec \ >>>>> --disable-kqemu --extra-cflags="-I $PWD/../user" \ >>>>> --extra-ldflags="-L $PWD/../user" \ >>>>> --enable-kvm --kernel-path="$libkvm_kerneldir" \ >>>>> - --enable-alsa \ >>>>> ${disable_gcc_check:+"--disable-gcc-check"} \ >>>>> - --prefix="$prefix" >>>>> + --prefix="$prefix" \ >>>>> + $qemu_opts --cpu="$arch" >>>>> >>>>> >>>>> >>>> I don't think this is right. You're using two different --cpu options >>>> for i386 and x86_64. There really shouldn't be a --cpu option at all >>>> for x86. >>>> >>>> >>> So the --cpu option is actually a hidden option in qemu & is not on the >>> qemu help page .. who know why it isn't but the it's in the code. >>> >>> It makes since though that if you are going to specify cross-prefix= >>> then there is little reason to specify the cpu on the qemu line. As it >>> should detect everything from cross compiler. >>> >>> I'll test this out and send a new patch with the 2 changes. >>> >>> >> So, instead of doing the funky $qemu_opts thing, why not just do: >> >> >> ${cross_prefix:+"--cross-prefix=${cross_prefix} --cpu=${arch}"} > > Well you could but what I need to is satisfy the situation that if you > have --qemu-cc specified that it not use it. I'm not sure how you do > this in one line in bash. So I have > > if [[ -z $cross_prefix ]]; then > qemu_opts+=" --cc=$cc" > else > qemu_opts+=" --cross-prefix=$cross_prefix" > fi > Unconditionally passing --cc to qemu seems like a bad idea to me. I think what you really want is: ${cross_prefix:+"--cross-prefix=${cross_prefix} --cpu=${arch}"} \ ${qemu_cc:+"--cc=${qemu_cc}"} QEMU doesn't perform the same checks if you explicitly pass --cc so if you do this unconditionally, it will do ugly things like try to use gcc4 instead of finding gcc3.2 Regards, Anthony Liguori > Also after this options are added to $qemu_opts based on what > architecture you are compiling for. For now you only see x86-64 & i386. > But this is about to change .. if I can ever get this patch in :-) > > Also it becomes even more complicated with the next version of the patch > I'll be sending out in out. > > > > >> Regards, >> >> Anthony Liguori >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> kvm-devel mailing list >> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >> https://lists.sourceforge.net/lists/listinfo/kvm-devel >> > > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/