qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: peter.crosthwaite@xilinx.com
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH v1 1/1] configure: Probe for libfdt_env.h
Date: Wed, 22 May 2013 09:47:06 +0200	[thread overview]
Message-ID: <20130522074706.GK4051@smtp.vpn> (raw)
In-Reply-To: <95c80377cdf3cc7f7f2cece834ed0e3ef99b59d3.1369187284.git.peter.crosthwaite@xilinx.com>

On Wed, May 22, 2013 at 11:50:22AM +1000, peter.crosthwaite@xilinx.com wrote:
> From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> 
> 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 <nathan.rossi@xilinx.com>
> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

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 <edgar.iglesias@gmail.com>

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 <libfdt_env.h>
> +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 <http://www.gnu.org/licenses/>.
> + *
> + * Copyright IBM Corp. 2008
> + * Authors: Hollis Blanchard <hollisb@us.ibm.com>
> + *
> + */
> +
> +#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 <http://www.gnu.org/licenses/>.
> - *
> - * Copyright IBM Corp. 2008
> - * Authors: Hollis Blanchard <hollisb@us.ibm.com>
> - *
> - */
> -
> -#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
> 

  reply	other threads:[~2013-05-22  7:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  1:50 [Qemu-devel] [PATCH v1 1/1] configure: Probe for libfdt_env.h peter.crosthwaite
2013-05-22  7:47 ` Edgar E. Iglesias [this message]
2013-05-22  8:26   ` Peter Maydell
2013-05-27  2:55     ` Peter Crosthwaite

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130522074706.GK4051@smtp.vpn \
    --to=edgar.iglesias@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).