From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex =?utf-8?Q?Benn=C3=A9e?= Subject: Re: [PATCH kvm-unit-tests v2] configure: fix non-newlib cross-compiling Date: Tue, 17 Jan 2017 15:21:15 +0000 Message-ID: <87tw8xu2z8.fsf@linaro.org> References: <20170116160706.8822-1-drjones@redhat.com> <87y3y9uck6.fsf@linaro.org> <20170117123635.p4dzvv4wxmje4iko@kamzik.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: kvm@vger.kernel.org, pbonzini@redhat.com To: Andrew Jones Return-path: Received: from mail-wm0-f42.google.com ([74.125.82.42]:37234 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbdAQP1e (ORCPT ); Tue, 17 Jan 2017 10:27:34 -0500 Received: by mail-wm0-f42.google.com with SMTP id c206so228132728wme.0 for ; Tue, 17 Jan 2017 07:27:33 -0800 (PST) In-reply-to: <20170117123635.p4dzvv4wxmje4iko@kamzik.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Andrew Jones writes: > On Tue, Jan 17, 2017 at 11:54:17AM +0000, Alex Bennée wrote: >> >> Andrew Jones writes: >> >> > Commit 529046c3 "libcflat: add PRI(dux)32 format types" applies a >> > detection trick that requires native compiling or cross-compiling >> > with newlib, an embedded system C standard library. We can avoid >> > the new dependency with a different trick. >> > >> > Cc: Alex Bennée >> > Signed-off-by: Andrew Jones >> > >> > --- >> > v2: drop the awk magic and just grep for long, as not all compilers >> > have long in the same place >> > --- >> > configure | 14 +++++--------- >> > 1 file changed, 5 insertions(+), 9 deletions(-) >> > >> > diff --git a/configure b/configure >> > index 127868ce3090..a05a4e3a5bc3 100755 >> > --- a/configure >> > +++ b/configure >> > @@ -12,6 +12,7 @@ host=$arch >> > cross_prefix= >> > endian="" >> > pretty_print_stacks=yes >> > +u32_long= >> > >> > usage() { >> > cat <<-EOF >> > @@ -110,16 +111,11 @@ if [ -f $testdir/run ]; then >> > fi >> > >> > # check if uint32_t needs a long format modifier >> > -cat << EOF > lib_test.c >> > -#include >> > +cat << EOF > lib-test.c >> > +__UINT32_TYPE__ >> > EOF >> > - >> > -$cross_prefix$cc lib_test.c -E | grep "typedef" | grep "long" | grep "uint32_t" &> /dev/null >> > -exit=$? >> > -if [ $exit -eq 0 ]; then >> > - u32_long=true >> > -fi >> > -rm -f lib_test.c >> > +u32_long=$(gcc -E lib-test.c | grep -v '^#' | grep -q long && echo yes) >> >> Erm you'll need to use the cross compiler here... > > Argh. I copy+pasted that from my 3-line test script without remembering > to change it. v3 coming... I can include your fixed patch in the series I'm about to post if you want? -- Alex Bennée