All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qemu: access host pkg-config via HOSTTOOLS
@ 2020-07-10 17:48 Taras Kondratiuk
  2020-07-10 17:56 ` Richard Purdie
  0 siblings, 1 reply; 14+ messages in thread
From: Taras Kondratiuk @ 2020-07-10 17:48 UTC (permalink / raw)
  To: Richard Purdie; +Cc: xe-linux-external, OE-core, Cristian Iorga

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
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-07-15 22:30 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10 17:48 [PATCH] qemu: access host pkg-config via HOSTTOOLS Taras Kondratiuk
2020-07-10 17:56 ` Richard Purdie
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

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.