qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PULL 02/25] build: Link user-only with crypto random number objects
Date: Wed, 22 May 2019 14:42:03 -0400	[thread overview]
Message-ID: <20190522184226.17871-3-richard.henderson@linaro.org> (raw)
In-Reply-To: <20190522184226.17871-1-richard.henderson@linaro.org>

For user-only, we require only the random number bits of the
crypto subsystem.  Rename crypto-aes-obj-y to crypto-user-obj-y,
and add the random number objects, plus init.o to handle any
extra stuff the crypto library requires.

Move the crypto libraries from libs_softmmu and libs_tools to
LIBS, so that they are universally used.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 Makefile             |  4 ++--
 Makefile.objs        |  2 +-
 Makefile.target      |  4 ++--
 configure            |  9 +++------
 crypto/Makefile.objs | 11 ++++++-----
 5 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/Makefile b/Makefile
index 155f066a20..3dbe82a9e4 100644
--- a/Makefile
+++ b/Makefile
@@ -412,7 +412,7 @@ dummy := $(call unnest-vars,, \
                 block-obj-y \
                 block-obj-m \
                 crypto-obj-y \
-                crypto-aes-obj-y \
+                crypto-user-obj-y \
                 qom-obj-y \
                 io-obj-y \
                 common-obj-y \
@@ -486,7 +486,7 @@ subdir-slirp: .git-submodule-status
 	$(call quiet-command,$(MAKE) -C $(SRC_PATH)/slirp BUILD_DIR="$(BUILD_DIR)/slirp" CC="$(CC)" AR="$(AR)" LD="$(LD)" RANLIB="$(RANLIB)" CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(LDFLAGS)")
 
 $(SUBDIR_RULES): libqemuutil.a $(common-obj-y) \
-	$(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))
+	$(qom-obj-y) $(crypto-user-obj-$(CONFIG_USER_ONLY))
 
 ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
 # Only keep -O and -g cflags
diff --git a/Makefile.objs b/Makefile.objs
index 2b0793ecc9..dcba4429c8 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -25,7 +25,7 @@ block-obj-m = block/
 # crypto-obj-y is code used by both qemu system emulation and qemu-img
 
 crypto-obj-y = crypto/
-crypto-aes-obj-y = crypto/
+crypto-user-obj-y = crypto/
 
 #######################################################################
 # qom-obj-y is code used by both qemu system emulation and qemu-img
diff --git a/Makefile.target b/Makefile.target
index fdbe7c89f4..4ef4ce5996 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -180,7 +180,7 @@ dummy := $(call unnest-vars,.., \
                block-obj-m \
                chardev-obj-y \
                crypto-obj-y \
-               crypto-aes-obj-y \
+               crypto-user-obj-y \
                qom-obj-y \
                io-obj-y \
                common-obj-y \
@@ -189,7 +189,7 @@ all-obj-y += $(common-obj-y)
 all-obj-y += $(qom-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(authz-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y) $(chardev-obj-y)
-all-obj-$(CONFIG_USER_ONLY) += $(crypto-aes-obj-y)
+all-obj-$(CONFIG_USER_ONLY) += $(crypto-user-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(crypto-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y)
 
diff --git a/configure b/configure
index 571dd94ee2..54fa78c4dc 100755
--- a/configure
+++ b/configure
@@ -2792,8 +2792,7 @@ if test "$gnutls" != "no"; then
         # At least ubuntu 18.04 ships only shared libraries.
         write_c_skeleton
         if compile_prog "" "$gnutls_libs" ; then
-            libs_softmmu="$gnutls_libs $libs_softmmu"
-            libs_tools="$gnutls_libs $libs_tools"
+            LIBS="$gnutls_libs $LIBS"
             QEMU_CFLAGS="$QEMU_CFLAGS $gnutls_cflags"
             pass="yes"
         fi
@@ -2864,8 +2863,7 @@ if test "$nettle" != "no"; then
         # Link test to make sure the given libraries work (e.g for static).
         write_c_skeleton
         if compile_prog "" "$nettle_libs" ; then
-            libs_softmmu="$nettle_libs $libs_softmmu"
-            libs_tools="$nettle_libs $libs_tools"
+            LIBS="$nettle_libs $LIBS"
             QEMU_CFLAGS="$QEMU_CFLAGS $nettle_cflags"
             if test -z "$gcrypt"; then
                gcrypt="no"
@@ -2896,8 +2894,7 @@ if test "$gcrypt" != "no"; then
         # Link test to make sure the given libraries work (e.g for static).
         write_c_skeleton
         if compile_prog "" "$gcrypt_libs" ; then
-            libs_softmmu="$gcrypt_libs $libs_softmmu"
-            libs_tools="$gcrypt_libs $libs_tools"
+            LIBS="$gcrypt_libs $LIBS"
             QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags"
             pass="yes"
         fi
diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
index 256c9aca1f..7fe2fa9da2 100644
--- a/crypto/Makefile.objs
+++ b/crypto/Makefile.objs
@@ -19,9 +19,10 @@ crypto-obj-y += tlscredspsk.o
 crypto-obj-y += tlscredsx509.o
 crypto-obj-y += tlssession.o
 crypto-obj-y += secret.o
-crypto-obj-$(CONFIG_GCRYPT) += random-gcrypt.o
-crypto-obj-$(if $(CONFIG_GCRYPT),n,$(CONFIG_GNUTLS)) += random-gnutls.o
-crypto-obj-$(if $(CONFIG_GCRYPT),n,$(if $(CONFIG_GNUTLS),n,y)) += random-platform.o
+crypto-rng-obj-$(CONFIG_GCRYPT) += random-gcrypt.o
+crypto-rng-obj-$(if $(CONFIG_GCRYPT),n,$(CONFIG_GNUTLS)) += random-gnutls.o
+crypto-rng-obj-$(if $(CONFIG_GCRYPT),n,$(if $(CONFIG_GNUTLS),n,y)) += random-platform.o
+crypto-obj-y += $(crypto-rng-obj-y)
 crypto-obj-y += pbkdf.o
 crypto-obj-$(CONFIG_NETTLE) += pbkdf-nettle.o
 crypto-obj-$(if $(CONFIG_NETTLE),n,$(CONFIG_GCRYPT)) += pbkdf-gcrypt.o
@@ -35,7 +36,7 @@ crypto-obj-y += block.o
 crypto-obj-y += block-qcow.o
 crypto-obj-y += block-luks.o
 
-# Let the userspace emulators avoid linking gnutls/etc
-crypto-aes-obj-y = aes.o
+# Let the userspace emulators avoid linking stuff they won't use.
+crypto-user-obj-y = aes.o $(crypto-rng-obj-y) init.o
 
 stub-obj-y += pbkdf-stub.o
-- 
2.17.1



  parent reply	other threads:[~2019-05-22 19:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22 18:42 [Qemu-devel] [PULL 00/25] Add qemu_getrandom and ARMv8.5-RNG etc Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 01/25] configure: Link test before auto-enabling crypto libraries Richard Henderson
2019-05-22 18:42 ` Richard Henderson [this message]
2019-05-22 18:42 ` [Qemu-devel] [PULL 03/25] crypto: Reverse code blocks in random-platform.c Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 04/25] crypto: Do not fail for EINTR during qcrypto_random_bytes Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 05/25] crypto: Use O_CLOEXEC in qcrypto_random_init Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 06/25] crypto: Use getrandom for qcrypto_random_bytes Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 07/25] crypto: Change the qcrypto_random_bytes buffer type to void* Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 08/25] ui/vnc: Split out authentication_failed Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 09/25] ui/vnc: Use gcrypto_random_bytes for start_auth_vnc Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 10/25] util: Add qemu_guest_getrandom and associated routines Richard Henderson
2019-05-30 11:29   ` Peter Maydell
2019-05-30 13:41     ` Richard Henderson
2019-05-30 13:45       ` Peter Maydell
2019-05-22 18:42 ` [Qemu-devel] [PULL 11/25] cpus: Initialize pseudo-random seeds for all guest cpus Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 12/25] linux-user: " Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 13/25] linux-user: Call qcrypto_init if not using -seed Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 14/25] linux-user: Use qemu_guest_getrandom_nofail for AT_RANDOM Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 15/25] linux-user/aarch64: Use qemu_guest_getrandom for PAUTH keys Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 16/25] linux-user: Remove srand call Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 17/25] aspeed/scu: Use qemu_guest_getrandom_nofail Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 18/25] hw/misc/nrf51_rng: " Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 19/25] hw/misc/bcm2835_rng: " Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 20/25] hw/misc/exynos4210_rng: Use qemu_guest_getrandom Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 21/25] target/arm: Put all PAC keys into a structure Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 22/25] target/arm: Implement ARMv8.5-RNG Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 23/25] target/ppc: Use gen_io_start/end around DARN Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 24/25] target/ppc: Use qemu_guest_getrandom for DARN Richard Henderson
2019-05-22 18:42 ` [Qemu-devel] [PULL 25/25] target/i386: Implement CPUID_EXT_RDRAND Richard Henderson
2019-05-23 13:14 ` [Qemu-devel] [PULL 00/25] Add qemu_getrandom and ARMv8.5-RNG etc Peter Maydell

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=20190522184226.17871-3-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --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).