aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-05-23 12:57:17 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-05-23 12:57:17 +0100
commitd418238dca7b4e0b124135827ead3076233052b1 (patch)
tree5869c8301e18962d3ddb4e927e152220c21ce33f /configure
parentc4600d5d417ea13e0f1cc047b227a2b5b0e694f5 (diff)
parent369fd5ca66810b2ddb16e23a497eabe59385eceb (diff)
Merge remote-tracking branch 'remotes/rth/tags/pull-rng-20190522' into staging
Introduce qemu_guest_getrandom. Use qemu_guest_getrandom in aspeed, nrf51, bcm2835, exynos4210 rng devices. Use qemu_guest_getrandom in target/ppc darn instruction. Support ARMv8.5-RNG extension. Support x86 RDRAND extension. Acked-by: Daniel P. Berrangé <berrange@redhat.com> Acked-by: Laurent Vivier <laurent@vivier.eu> # gpg: Signature made Wed 22 May 2019 19:36:43 BST # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth/tags/pull-rng-20190522: (25 commits) target/i386: Implement CPUID_EXT_RDRAND target/ppc: Use qemu_guest_getrandom for DARN target/ppc: Use gen_io_start/end around DARN target/arm: Implement ARMv8.5-RNG target/arm: Put all PAC keys into a structure hw/misc/exynos4210_rng: Use qemu_guest_getrandom hw/misc/bcm2835_rng: Use qemu_guest_getrandom_nofail hw/misc/nrf51_rng: Use qemu_guest_getrandom_nofail aspeed/scu: Use qemu_guest_getrandom_nofail linux-user: Remove srand call linux-user/aarch64: Use qemu_guest_getrandom for PAUTH keys linux-user: Use qemu_guest_getrandom_nofail for AT_RANDOM linux-user: Call qcrypto_init if not using -seed linux-user: Initialize pseudo-random seeds for all guest cpus cpus: Initialize pseudo-random seeds for all guest cpus util: Add qemu_guest_getrandom and associated routines ui/vnc: Use gcrypto_random_bytes for start_auth_vnc ui/vnc: Split out authentication_failed crypto: Change the qcrypto_random_bytes buffer type to void* crypto: Use getrandom for qcrypto_random_bytes ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure87
1 files changed, 58 insertions, 29 deletions
diff --git a/configure b/configure
index cef51b2a0b..528b9ff705 100755
--- a/configure
+++ b/configure
@@ -2784,17 +2784,23 @@ fi
# GNUTLS probe
if test "$gnutls" != "no"; then
+ pass="no"
if $pkg_config --exists "gnutls >= 3.1.18"; then
gnutls_cflags=$($pkg_config --cflags gnutls)
gnutls_libs=$($pkg_config --libs gnutls)
- libs_softmmu="$gnutls_libs $libs_softmmu"
- libs_tools="$gnutls_libs $libs_tools"
- QEMU_CFLAGS="$QEMU_CFLAGS $gnutls_cflags"
- gnutls="yes"
- elif test "$gnutls" = "yes"; then
+ # Packaging for the static libraries is not always correct.
+ # At least ubuntu 18.04 ships only shared libraries.
+ write_c_skeleton
+ if compile_prog "" "$gnutls_libs" ; then
+ LIBS="$gnutls_libs $LIBS"
+ QEMU_CFLAGS="$QEMU_CFLAGS $gnutls_cflags"
+ pass="yes"
+ fi
+ fi
+ if test "$pass" = "no" && test "$gnutls" = "yes"; then
feature_not_found "gnutls" "Install gnutls devel >= 3.1.18"
else
- gnutls="no"
+ gnutls="$pass"
fi
fi
@@ -2849,43 +2855,52 @@ has_libgcrypt() {
if test "$nettle" != "no"; then
+ pass="no"
if $pkg_config --exists "nettle >= 2.7.1"; then
nettle_cflags=$($pkg_config --cflags nettle)
nettle_libs=$($pkg_config --libs nettle)
nettle_version=$($pkg_config --modversion nettle)
- libs_softmmu="$nettle_libs $libs_softmmu"
- libs_tools="$nettle_libs $libs_tools"
- QEMU_CFLAGS="$QEMU_CFLAGS $nettle_cflags"
- nettle="yes"
-
- if test -z "$gcrypt"; then
- gcrypt="no"
+ # Link test to make sure the given libraries work (e.g for static).
+ write_c_skeleton
+ if compile_prog "" "$nettle_libs" ; then
+ LIBS="$nettle_libs $LIBS"
+ QEMU_CFLAGS="$QEMU_CFLAGS $nettle_cflags"
+ if test -z "$gcrypt"; then
+ gcrypt="no"
+ fi
+ pass="yes"
fi
+ fi
+ if test "$pass" = "no" && test "$nettle" = "yes"; then
+ feature_not_found "nettle" "Install nettle devel >= 2.7.1"
else
- if test "$nettle" = "yes"; then
- feature_not_found "nettle" "Install nettle devel >= 2.7.1"
- else
- nettle="no"
- fi
+ nettle="$pass"
fi
fi
if test "$gcrypt" != "no"; then
+ pass="no"
if has_libgcrypt; then
gcrypt_cflags=$(libgcrypt-config --cflags)
gcrypt_libs=$(libgcrypt-config --libs)
- # Debian has remove -lgpg-error from libgcrypt-config
+ # Debian has removed -lgpg-error from libgcrypt-config
# as it "spreads unnecessary dependencies" which in
# turn breaks static builds...
if test "$static" = "yes"
then
gcrypt_libs="$gcrypt_libs -lgpg-error"
fi
- libs_softmmu="$gcrypt_libs $libs_softmmu"
- libs_tools="$gcrypt_libs $libs_tools"
- QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags"
- gcrypt="yes"
+ # Link test to make sure the given libraries work (e.g for static).
+ write_c_skeleton
+ if compile_prog "" "$gcrypt_libs" ; then
+ LIBS="$gcrypt_libs $LIBS"
+ QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags"
+ pass="yes"
+ fi
+ fi
+ if test "$pass" = "yes"; then
+ gcrypt="yes"
cat > $TMPC << EOF
#include <gcrypt.h>
int main(void) {
@@ -2898,12 +2913,10 @@ EOF
if compile_prog "$gcrypt_cflags" "$gcrypt_libs" ; then
gcrypt_hmac=yes
fi
+ elif test "$gcrypt" = "yes"; then
+ feature_not_found "gcrypt" "Install gcrypt devel >= 1.5.0"
else
- if test "$gcrypt" = "yes"; then
- feature_not_found "gcrypt" "Install gcrypt devel >= 1.5.0"
- else
- gcrypt="no"
- fi
+ gcrypt="no"
fi
fi
@@ -5803,6 +5816,20 @@ if compile_prog "" "" ; then
fi
##########################################
+# check for getrandom()
+
+have_getrandom=no
+cat > $TMPC << EOF
+#include <sys/random.h>
+int main(void) {
+ return getrandom(0, 0, GRND_NONBLOCK);
+}
+EOF
+if compile_prog "" "" ; then
+ have_getrandom=yes
+fi
+
+##########################################
# checks for sanitizers
have_asan=no
@@ -7191,7 +7218,9 @@ fi
if test "$have_utmpx" = "yes" ; then
echo "HAVE_UTMPX=y" >> $config_host_mak
fi
-
+if test "$have_getrandom" = "yes" ; then
+ echo "CONFIG_GETRANDOM=y" >> $config_host_mak
+fi
if test "$ivshmem" = "yes" ; then
echo "CONFIG_IVSHMEM=y" >> $config_host_mak
fi