diff mbox series

[v5,02/24] crypto: Merge crypto-obj-y into libqemuutil.a

Message ID 20190510012458.22706-3-richard.henderson@linaro.org
State New
Headers show
Series Add qemu_getrandom and ARMv8.5-RNG etc | expand

Commit Message

Richard Henderson May 10, 2019, 1:24 a.m. UTC
We will shortly need this in the user-only binaries, so drop the split
into system and tools binaries.  This also means that crypto-aes-obj-y
can be merged back into crypto-obj-y.

Cc: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 Makefile             | 12 +++++-------
 Makefile.objs        |  8 ++------
 Makefile.target      |  4 ----
 configure            |  9 +++------
 crypto/Makefile.objs |  5 +----
 5 files changed, 11 insertions(+), 27 deletions(-)

-- 
2.17.1

Comments

Daniel P. Berrangé May 10, 2019, 8:55 a.m. UTC | #1
On Thu, May 09, 2019 at 06:24:36PM -0700, Richard Henderson wrote:
> We will shortly need this in the user-only binaries, so drop the split

> into system and tools binaries.  This also means that crypto-aes-obj-y

> can be merged back into crypto-obj-y.

> 

> Cc: Daniel P. Berrangé <berrange@redhat.com>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  Makefile             | 12 +++++-------

>  Makefile.objs        |  8 ++------

>  Makefile.target      |  4 ----

>  configure            |  9 +++------

>  crypto/Makefile.objs |  5 +----

>  5 files changed, 11 insertions(+), 27 deletions(-)

> 

> diff --git a/Makefile b/Makefile

> index a971247cac..7c9c208207 100644

> --- a/Makefile

> +++ b/Makefile

> @@ -410,7 +410,6 @@ dummy := $(call unnest-vars,, \

>                  block-obj-y \

>                  block-obj-m \

>                  crypto-obj-y \

> -                crypto-aes-obj-y \

>                  qom-obj-y \

>                  io-obj-y \

>                  common-obj-y \

> @@ -446,7 +445,6 @@ SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))

>  

>  $(SOFTMMU_SUBDIR_RULES): $(authz-obj-y)

>  $(SOFTMMU_SUBDIR_RULES): $(block-obj-y)

> -$(SOFTMMU_SUBDIR_RULES): $(crypto-obj-y)

>  $(SOFTMMU_SUBDIR_RULES): $(io-obj-y)

>  $(SOFTMMU_SUBDIR_RULES): config-all-devices.mak

>  $(SOFTMMU_SUBDIR_RULES): $(edk2-decompressed)

> @@ -502,7 +500,7 @@ Makefile: $(version-obj-y)

>  ######################################################################

>  # Build libraries

>  

> -libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y)

> +libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y) $(crypto-obj-y)


The main reason for a separate crypto-obj-y variable was that it was only
built into some pieces of QEMU. Since we're building into libqemuutil.a
now, we might as well just add all the crypto object files directly
to the util-obj-y variable & drop crypto-obj-y entirely.

That said, what you've done here is fine, so don't feel this comment
is mandatory. Its just an idea for a cleanup if you need to repost
again for another reason.


Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>



Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Laurent Vivier May 10, 2019, 9:57 a.m. UTC | #2
On 10/05/2019 03:24, Richard Henderson wrote:
> We will shortly need this in the user-only binaries, so drop the split

> into system and tools binaries.  This also means that crypto-aes-obj-y

> can be merged back into crypto-obj-y.

> 

> Cc: Daniel P. Berrangé <berrange@redhat.com>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>   Makefile             | 12 +++++-------

>   Makefile.objs        |  8 ++------

>   Makefile.target      |  4 ----

>   configure            |  9 +++------

>   crypto/Makefile.objs |  5 +----

>   5 files changed, 11 insertions(+), 27 deletions(-)

> 

> diff --git a/Makefile b/Makefile

> index a971247cac..7c9c208207 100644

> --- a/Makefile

> +++ b/Makefile

> @@ -410,7 +410,6 @@ dummy := $(call unnest-vars,, \

>                   block-obj-y \

>                   block-obj-m \

>                   crypto-obj-y \

> -                crypto-aes-obj-y \

>                   qom-obj-y \

>                   io-obj-y \

>                   common-obj-y \

> @@ -446,7 +445,6 @@ SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))

>   

>   $(SOFTMMU_SUBDIR_RULES): $(authz-obj-y)

>   $(SOFTMMU_SUBDIR_RULES): $(block-obj-y)

> -$(SOFTMMU_SUBDIR_RULES): $(crypto-obj-y)

>   $(SOFTMMU_SUBDIR_RULES): $(io-obj-y)

>   $(SOFTMMU_SUBDIR_RULES): config-all-devices.mak

>   $(SOFTMMU_SUBDIR_RULES): $(edk2-decompressed)

> @@ -502,7 +500,7 @@ Makefile: $(version-obj-y)

>   ######################################################################

>   # Build libraries

>   

> -libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y)

> +libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y) $(crypto-obj-y)

>   libvhost-user.a: $(libvhost-user-obj-y) $(util-obj-y) $(stub-obj-y)

>   

>   ######################################################################

> @@ -511,9 +509,9 @@ COMMON_LDADDS = libqemuutil.a

>   

>   qemu-img.o: qemu-img-cmds.h

>   

> -qemu-img$(EXESUF): qemu-img.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)

> -qemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)

> -qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)

> +qemu-img$(EXESUF): qemu-img.o $(authz-obj-y) $(block-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)

> +qemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)

> +qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)

>   

>   qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS)

>  


There is a remaining crypto-aes-obj you should remove:

$(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \
         $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))

except that:

Reviewed-by: Laurent Vivier <lvivier@redhat.com>


Thanks,
Laurent
Richard Henderson May 10, 2019, 3:27 p.m. UTC | #3
On 5/10/19 2:57 AM, Laurent Vivier wrote:
> There is a remaining crypto-aes-obj you should remove:

> 

> $(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \

>         $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))


Fixed, thanks.


r~
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index a971247cac..7c9c208207 100644
--- a/Makefile
+++ b/Makefile
@@ -410,7 +410,6 @@  dummy := $(call unnest-vars,, \
                 block-obj-y \
                 block-obj-m \
                 crypto-obj-y \
-                crypto-aes-obj-y \
                 qom-obj-y \
                 io-obj-y \
                 common-obj-y \
@@ -446,7 +445,6 @@  SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
 
 $(SOFTMMU_SUBDIR_RULES): $(authz-obj-y)
 $(SOFTMMU_SUBDIR_RULES): $(block-obj-y)
-$(SOFTMMU_SUBDIR_RULES): $(crypto-obj-y)
 $(SOFTMMU_SUBDIR_RULES): $(io-obj-y)
 $(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
 $(SOFTMMU_SUBDIR_RULES): $(edk2-decompressed)
@@ -502,7 +500,7 @@  Makefile: $(version-obj-y)
 ######################################################################
 # Build libraries
 
-libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y)
+libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y) $(crypto-obj-y)
 libvhost-user.a: $(libvhost-user-obj-y) $(util-obj-y) $(stub-obj-y)
 
 ######################################################################
@@ -511,9 +509,9 @@  COMMON_LDADDS = libqemuutil.a
 
 qemu-img.o: qemu-img-cmds.h
 
-qemu-img$(EXESUF): qemu-img.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
-qemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
-qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
+qemu-img$(EXESUF): qemu-img.o $(authz-obj-y) $(block-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
+qemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
+qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
 
 qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS)
 
@@ -524,7 +522,7 @@  qemu-edid$(EXESUF): qemu-edid.o hw/display/edid-generate.o $(COMMON_LDADDS)
 fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal.o fsdev/9p-iov-marshal.o $(COMMON_LDADDS)
 fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
 
-scsi/qemu-pr-helper$(EXESUF): scsi/qemu-pr-helper.o scsi/utils.o $(authz-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
+scsi/qemu-pr-helper$(EXESUF): scsi/qemu-pr-helper.o scsi/utils.o $(authz-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
 ifdef CONFIG_MPATH
 scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist
 endif
diff --git a/Makefile.objs b/Makefile.objs
index cf065de5ed..0ce429c1af 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -3,6 +3,8 @@ 
 stub-obj-y = stubs/ util/ crypto/
 util-obj-y = util/ qobject/ qapi/
 
+crypto-obj-y = crypto/
+
 chardev-obj-y = chardev/
 
 #######################################################################
@@ -21,12 +23,6 @@  block-obj-$(CONFIG_REPLICATION) += replication.o
 
 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/
-
 #######################################################################
 # qom-obj-y is code used by both qemu system emulation and qemu-img
 
diff --git a/Makefile.target b/Makefile.target
index ae02495951..ce02924ffb 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -179,8 +179,6 @@  dummy := $(call unnest-vars,.., \
                block-obj-y \
                block-obj-m \
                chardev-obj-y \
-               crypto-obj-y \
-               crypto-aes-obj-y \
                qom-obj-y \
                io-obj-y \
                common-obj-y \
@@ -189,8 +187,6 @@  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_SOFTMMU) += $(crypto-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y)
 
 ifdef CONFIG_SOFTMMU
diff --git a/configure b/configure
index c4f27ed453..68b34a93eb 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..a291bc5b9a 100644
--- a/crypto/Makefile.objs
+++ b/crypto/Makefile.objs
@@ -34,8 +34,5 @@  crypto-obj-y += xts.o
 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
-
+crypto-obj-y += aes.o
 stub-obj-y += pbkdf-stub.o