From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf3p8-00067e-NU for qemu-devel@nongnu.org; Wed, 22 May 2013 03:51:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf3p2-0001Gh-NG for qemu-devel@nongnu.org; Wed, 22 May 2013 03:51:02 -0400 Received: from mail-ee0-f54.google.com ([74.125.83.54]:57039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf3lX-0007U9-Hm for qemu-devel@nongnu.org; Wed, 22 May 2013 03:47:19 -0400 Received: by mail-ee0-f54.google.com with SMTP id e50so953233eek.41 for ; Wed, 22 May 2013 00:47:18 -0700 (PDT) Date: Wed, 22 May 2013 09:47:06 +0200 From: "Edgar E. Iglesias" Message-ID: <20130522074706.GK4051@smtp.vpn> References: <95c80377cdf3cc7f7f2cece834ed0e3ef99b59d3.1369187284.git.peter.crosthwaite@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95c80377cdf3cc7f7f2cece834ed0e3ef99b59d3.1369187284.git.peter.crosthwaite@xilinx.com> Subject: Re: [Qemu-devel] [PATCH v1 1/1] configure: Probe for libfdt_env.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.crosthwaite@xilinx.com Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, peter.maydell@linaro.org On Wed, May 22, 2013 at 11:50:22AM +1000, peter.crosthwaite@xilinx.com wrote: > From: Peter Crosthwaite > > Currently QEMU provides a local clone of the file libfdt_env.h in > /include. This file is supposed to come with the libfdt package and is > only needed for broken installs of libfdt. Unfortunately, libfdt 1.3 > stable is tagged with this bug so we cant realistically remove the > clone. So instead, use a configure time probe - check to see if the > host is already providing this file, and if so, don't use QEMUs > local clone of libfdt.h. > > Moved include/libfdt_env.h to include/libfdt/libfdt_env.h so it can be > treated as a special case. > > For newer (development) versions of libfdt this probe will succeed and > include/libfdt/libfdt_env.h will simply be ignored. > > For older versions -Iinclude/libfdt will be added to CFLAGS. > > Manifests as a bug when building QEMU with modern libfdt. The new > version of libfdt does not compile when QEMUs libfdt_env.h takes > precedence over the hosts. > > Reported-by: Nathan Rossi > Signed-off-by: Peter Crosthwaite Hi, Should we consider removing our builtin version and stick to either using the hosts or when that fails suggest the submoduled dtc pkg? Anyway, this patch improves the current situation so OK with me: Acked-by: Edgar E. Iglesias Cheers, Edgar > --- > To replicate bug (install latest dtc from src to host and make): > git submodule update --init dtc > cd dtc > git checkout master > make > sudo make install PREFIX=/usr/local > cd .. > ./configure --target-list="arm-softmmu" --enable-fdt > make > > configure | 14 ++++++++++++++ > include/libfdt/libfdt_env.h | 36 ++++++++++++++++++++++++++++++++++++ > include/libfdt_env.h | 36 ------------------------------------ > 3 files changed, 50 insertions(+), 36 deletions(-) > create mode 100644 include/libfdt/libfdt_env.h > delete mode 100644 include/libfdt_env.h > > diff --git a/configure b/configure > index 5ae7e4a..f59c49b 100755 > --- a/configure > +++ b/configure > @@ -2550,6 +2550,20 @@ EOF > fi > fi > > +########################################## > +# libfdt_env.h probe > + > +if test "$fdt" == "yes" ; then > + cat > $TMPC << EOF > +#include > +int main(void) { return 0; } > +EOF > + if ! compile_prog "" "$fdt_libs" ; then > + #system libfdt_env is bad - use QEMUs inbuilt snapshot > + fdt_cflags="-I\$(SRC_PATH)/include/libfdt $fdt_cflags" > + fi > +fi > + > libs_softmmu="$libs_softmmu $fdt_libs" > > ########################################## > diff --git a/include/libfdt/libfdt_env.h b/include/libfdt/libfdt_env.h > new file mode 100644 > index 0000000..3667d4c > --- /dev/null > +++ b/include/libfdt/libfdt_env.h > @@ -0,0 +1,36 @@ > +/* > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License, version 2, as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, see . > + * > + * Copyright IBM Corp. 2008 > + * Authors: Hollis Blanchard > + * > + */ > + > +#ifndef _LIBFDT_ENV_H > +#define _LIBFDT_ENV_H > + > +#include "qemu/bswap.h" > + > +#ifdef HOST_WORDS_BIGENDIAN > +#define fdt32_to_cpu(x) (x) > +#define cpu_to_fdt32(x) (x) > +#define fdt64_to_cpu(x) (x) > +#define cpu_to_fdt64(x) (x) > +#else > +#define fdt32_to_cpu(x) bswap32(x) > +#define cpu_to_fdt32(x) bswap32(x) > +#define fdt64_to_cpu(x) bswap64(x) > +#define cpu_to_fdt64(x) bswap64(x) > +#endif > + > +#endif /* _LIBFDT_ENV_H */ > diff --git a/include/libfdt_env.h b/include/libfdt_env.h > deleted file mode 100644 > index 3667d4c..0000000 > --- a/include/libfdt_env.h > +++ /dev/null > @@ -1,36 +0,0 @@ > -/* > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License, version 2, as > - * published by the Free Software Foundation. > - * > - * This program is distributed in the hope that it will be useful, > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > - * GNU General Public License for more details. > - * > - * You should have received a copy of the GNU General Public License > - * along with this program; if not, see . > - * > - * Copyright IBM Corp. 2008 > - * Authors: Hollis Blanchard > - * > - */ > - > -#ifndef _LIBFDT_ENV_H > -#define _LIBFDT_ENV_H > - > -#include "qemu/bswap.h" > - > -#ifdef HOST_WORDS_BIGENDIAN > -#define fdt32_to_cpu(x) (x) > -#define cpu_to_fdt32(x) (x) > -#define fdt64_to_cpu(x) (x) > -#define cpu_to_fdt64(x) (x) > -#else > -#define fdt32_to_cpu(x) bswap32(x) > -#define cpu_to_fdt32(x) bswap32(x) > -#define fdt64_to_cpu(x) bswap64(x) > -#define cpu_to_fdt64(x) bswap64(x) > -#endif > - > -#endif /* _LIBFDT_ENV_H */ > -- > 1.8.3.rc1.44.gb387c77.dirty >