Skip to content

./configure has unprefixed calls to pkg-config and clang breaking cross-compilation

Description of problem

The configure script (as generated) includes some calls to the toolchain without including cross compiler prefixes. This can very easily break cross compilation. Here are the locations:

pkg-config

https://github.com/qemu/qemu/blob/ebc55f523c2f406e30ec8fad77bd3b9aad5d4579/configure#L2506

echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >> $config_host_mak

This can be replaced with:

echo "GLIB_VERSION=$(${pkg-config} --modversion glib-2.0)" >> $config_host_mak

clang

https://github.com/qemu/qemu/blob/ebc55f523c2f406e30ec8fad77bd3b9aad5d4579/configure#L662

# Default objcc to clang if available, otherwise use CC
if has clang; then
  objcc=clang
else
  objcc="$cc"
fi

This should probably take ${cross_prefix} into account, but it isn't so bad since the --objcc configure flag is available.

Edited by Allen Webb
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information