All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard Purdie" <richard.purdie@linuxfoundation.org>
To: Taras Kondratiuk <takondra@cisco.com>
Cc: xe-linux-external@cisco.com,
	OE-core <openembedded-core@lists.openembedded.org>,
	Cristian Iorga <cristian.iorga@intel.com>
Subject: Re: [PATCH] qemu: access host pkg-config via HOSTTOOLS
Date: Fri, 10 Jul 2020 18:56:38 +0100	[thread overview]
Message-ID: <39c5bc9fcf056d93a42833d113521f524f063d33.camel@linuxfoundation.org> (raw)
In-Reply-To: <20200710174813.1963559-1-takondra@cisco.com>

On Fri, 2020-07-10 at 10:48 -0700, Taras Kondratiuk wrote:
> On some build hosts qemu-system-native fails to build with errors:
> like:
> > build/tmp/work/x86_64-linux/qemu-system-native/4.1.0-r0/qemu-4.1.0/qemu-keymap.c:16:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory
> >    16 | #include <xkbcommon/xkbcommon.h>
> >       |          ^~~~~~~~~~~~~~~~~~~~~~~
> > compilation terminated.
> > make: *** [build/tmp/work/x86_64-linux/qemu-system-native/4.1.0-r0/qemu-4.1.0/rules.mak:69: qemu-keymap.o] Error 1
> 
> This is a combination of two factors:
> 1. In our setup we use native toolchain from buildtools-tarball because
>    default host GCC on some machines is too old.
> 2. Qemu recipe adds host pkg-config paths to PKG_CONFIG_PATH using
>    hardcoded pkg-config tool's location (/usr/bin:/bin).  Added by
>    commit 68a5ed337f8f ("qemu: fix qemu-native pkg-config paths")
> 
> Host xkbcommon package is detected in configure. But then the toolchain
> can't find headers because it uses headers from buildtools-tarball only.
> 
> Instead of using hardcoded location, use pkg-config via HOSTTOOLS. It
> will pick up correct pkg-config from PATH and avoid configuration
> discrepancies.
> 
> Signed-off-by: Taras Kondratiuk <takondra@cisco.com>
> ---
>  meta/conf/bitbake.conf              | 2 +-
>  meta/recipes-devtools/qemu/qemu.inc | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 353caacef986..fae1147d397c 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -488,7 +488,7 @@ HOSTTOOLS += " \
>      cpp cut date dd diff diffstat dirname du echo egrep env expand expr false \
>      fgrep file find flock g++ gawk gcc getconf getopt git grep gunzip gzip \
>      head hostname iconv id install ld ldd ln ls make md5sum mkdir mknod \
> -    mktemp mv nm objcopy objdump od patch perl pr printf pwd \
> +    mktemp mv nm objcopy objdump od patch perl pkg-config pr printf pwd \
>      python3 ranlib readelf readlink realpath rm rmdir rpcgen sed seq sh \
>      sha1sum sha224sum sha256sum sha384sum sha512sum \
>      sleep sort split stat strings strip tail tar tee test touch tr true uname \
> diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
> index d41cc8f200b3..881a5ba65025 100644
> --- a/meta/recipes-devtools/qemu/qemu.inc
> +++ b/meta/recipes-devtools/qemu/qemu.inc
> @@ -94,7 +94,7 @@ EXTRA_OECONF_append = " --python=${HOSTTOOLS_DIR}/python3"
>  
>  do_configure_prepend_class-native() {
>  	# Append build host pkg-config paths for native target since the host may provide sdl
> -	BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
> +	BHOST_PKGCONFIG_PATH=$(${HOSTTOOLS_DIR}/pkg-config --variable pc_path pkg-config || echo "")
>  	if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
>  		export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
>  	fi

qemu is a little special, its about the only thing we let look into the
system for things like this. We really don't want pkg-config available
generally in HOSTTOOLS.

I'm not 100% sure I understand how this is fixing things either. Is
this using the pkg-config from your buildtools tarball instead?

Cheers,

Richard



  reply	other threads:[~2020-07-10 17:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 17:48 [PATCH] qemu: access host pkg-config via HOSTTOOLS Taras Kondratiuk
2020-07-10 17:56 ` Richard Purdie [this message]
2020-07-10 18:18   ` Taras Kondratiuk
2020-07-10 19:11     ` Richard Purdie
2020-07-10 20:31       ` [OE-core] " Alexander Kanavin
2020-07-11  3:52       ` Taras Kondratiuk
2020-07-12 21:35         ` [PATCH] qemu: use host pkg-config only when host provides sdl Taras Kondratiuk
2020-07-15  9:15           ` [OE-core] " Alexander Kanavin
2020-07-15 17:09             ` Taras Kondratiuk
2020-07-15 17:23               ` Alexander Kanavin
2020-07-15 18:54                 ` Taras Kondratiuk
2020-07-15 19:17                   ` Alexander Kanavin
2020-07-15 20:17                   ` Richard Purdie
2020-07-15 22:30                     ` Taras Kondratiuk

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=39c5bc9fcf056d93a42833d113521f524f063d33.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=cristian.iorga@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=takondra@cisco.com \
    --cc=xe-linux-external@cisco.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.