All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/3] buildsys: Move crypto libraries to per object variables
@ 2017-09-06  7:44 Fam Zheng
  2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 1/3] buildsys: Move nettle cflags/libs to per object Fam Zheng
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Fam Zheng @ 2017-09-06  7:44 UTC (permalink / raw)
  To: qemu-devel

v3: Remove one more line that was missed in v2.

Not all targets need the flags and libs of gcrypt/nettle/gnutls, so move them
out from global variables, as done with other libraries.

There are still other libraries in ./configure that can be converted this way,
which will be sent separatedly.

Fam Zheng (3):
  buildsys: Move nettle cflags/libs to per object
  buildsys: Move gnutls cflags/libs to per object
  buildsys: Move gcrypt cflags/libs to per object

 configure              | 15 ++++++---------
 crypto/Makefile.objs   | 20 ++++++++++++++++++++
 tests/Makefile.include | 10 +++++-----
 3 files changed, 31 insertions(+), 14 deletions(-)

-- 
2.13.5

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

* [Qemu-devel] [PATCH v3 1/3] buildsys: Move nettle cflags/libs to per object
  2017-09-06  7:44 [Qemu-devel] [PATCH v3 0/3] buildsys: Move crypto libraries to per object variables Fam Zheng
@ 2017-09-06  7:44 ` Fam Zheng
  2017-09-06  8:55   ` Daniel P. Berrange
  2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 2/3] buildsys: Move gnutls " Fam Zheng
  2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 3/3] buildsys: Move gcrypt " Fam Zheng
  2 siblings, 1 reply; 9+ messages in thread
From: Fam Zheng @ 2017-09-06  7:44 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 configure            | 5 ++---
 crypto/Makefile.objs | 6 ++++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index fb7e34a901..6a4cb3832b 100755
--- a/configure
+++ b/configure
@@ -2616,9 +2616,6 @@ if test "$nettle" != "no"; 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"
 
         cat > $TMPC << EOF
@@ -5732,6 +5729,8 @@ if test "$nettle" = "yes" ; then
   if test "$nettle_kdf" = "yes" ; then
     echo "CONFIG_NETTLE_KDF=y" >> $config_host_mak
   fi
+  echo "NETTLE_CFLAGS=$nettle_cflags" >> $config_host_mak
+  echo "NETTLE_LIBS=$nettle_libs" >> $config_host_mak
 fi
 if test "$tasn1" = "yes" ; then
   echo "CONFIG_TASN1=y" >> $config_host_mak
diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
index 2b99e08062..a936957d03 100644
--- a/crypto/Makefile.objs
+++ b/crypto/Makefile.objs
@@ -34,6 +34,12 @@ crypto-obj-y += block.o
 crypto-obj-y += block-qcow.o
 crypto-obj-y += block-luks.o
 
+$(if $(CONFIG_NETTLE), \
+	$(foreach x, cipher hash-nettle hmac-nettle pbkdf-nettle, \
+		$(eval $x.o-cflags := $(NETTLE_CFLAGS)) \
+		$(eval $x.o-libs := $(NETTLE_LIBS))) \
+)
+
 # Let the userspace emulators avoid linking gnutls/etc
 crypto-aes-obj-y = aes.o
 
-- 
2.13.5

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

* [Qemu-devel] [PATCH v3 2/3] buildsys: Move gnutls cflags/libs to per object
  2017-09-06  7:44 [Qemu-devel] [PATCH v3 0/3] buildsys: Move crypto libraries to per object variables Fam Zheng
  2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 1/3] buildsys: Move nettle cflags/libs to per object Fam Zheng
@ 2017-09-06  7:44 ` Fam Zheng
  2017-09-06  8:56   ` Daniel P. Berrange
  2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 3/3] buildsys: Move gcrypt " Fam Zheng
  2 siblings, 1 reply; 9+ messages in thread
From: Fam Zheng @ 2017-09-06  7:44 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 configure              |  5 ++---
 crypto/Makefile.objs   |  7 +++++++
 tests/Makefile.include | 10 +++++-----
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 6a4cb3832b..6d90e73a8b 100755
--- a/configure
+++ b/configure
@@ -2472,9 +2472,6 @@ if test "$gnutls" != "no"; then
     if gnutls_works; 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"
 
 	# gnutls_rnd requires >= 2.11.0
@@ -5710,6 +5707,8 @@ fi
 echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak
 if test "$gnutls" = "yes" ; then
   echo "CONFIG_GNUTLS=y" >> $config_host_mak
+  echo "GNUTLS_CFLAGS=$gnutls_cflags" >> $config_host_mak
+  echo "GNUTLS_LIBS=$gnutls_libs" >> $config_host_mak
 fi
 if test "$gnutls_rnd" = "yes" ; then
   echo "CONFIG_GNUTLS_RND=y" >> $config_host_mak
diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
index a936957d03..0cb5fa24b6 100644
--- a/crypto/Makefile.objs
+++ b/crypto/Makefile.objs
@@ -40,6 +40,13 @@ $(if $(CONFIG_NETTLE), \
 		$(eval $x.o-libs := $(NETTLE_LIBS))) \
 )
 
+$(if $(CONFIG_GNUTLS), \
+	$(foreach x, init random-gnutls tlscreds tlscredsanon \
+			tlscredsx509 tlssession, \
+		$(eval $x.o-cflags := $(GNUTLS_CFLAGS)) \
+		$(eval $x.o-libs := $(GNUTLS_LIBS))) \
+)
+
 # Let the userspace emulators avoid linking gnutls/etc
 crypto-aes-obj-y = aes.o
 
diff --git a/tests/Makefile.include b/tests/Makefile.include
index fae5715e9c..d46c22d1ec 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -677,15 +677,15 @@ tests/benchmark-crypto-cipher$(EXESUF): tests/benchmark-crypto-cipher.o $(test-c
 tests/test-crypto-secret$(EXESUF): tests/test-crypto-secret.o $(test-crypto-obj-y)
 tests/test-crypto-xts$(EXESUF): tests/test-crypto-xts.o $(test-crypto-obj-y)
 
-tests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS)
-tests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS)
-tests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS)
+tests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS) $(GNUTLS_CFLAGS)
+tests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS) $(GNUTLS_LIBS)
+tests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS) $(GNUTLS_LIBS)
 
-tests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS)
+tests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS) $(GNUTLS_CFLAGS)
 tests/test-crypto-tlscredsx509$(EXESUF): tests/test-crypto-tlscredsx509.o \
 	tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y)
 
-tests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS)
+tests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS) $(GNUTLS_CFLAGS)
 tests/test-crypto-tlssession$(EXESUF): tests/test-crypto-tlssession.o \
 	tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y)
 tests/test-io-task$(EXESUF): tests/test-io-task.o $(test-io-obj-y)
-- 
2.13.5

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

* [Qemu-devel] [PATCH v3 3/3] buildsys: Move gcrypt cflags/libs to per object
  2017-09-06  7:44 [Qemu-devel] [PATCH v3 0/3] buildsys: Move crypto libraries to per object variables Fam Zheng
  2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 1/3] buildsys: Move nettle cflags/libs to per object Fam Zheng
  2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 2/3] buildsys: Move gnutls " Fam Zheng
@ 2017-09-06  7:44 ` Fam Zheng
  2017-09-06  8:56   ` Daniel P. Berrange
  2 siblings, 1 reply; 9+ messages in thread
From: Fam Zheng @ 2017-09-06  7:44 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 configure            | 5 ++---
 crypto/Makefile.objs | 7 +++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 6d90e73a8b..b37cd54bda 100755
--- a/configure
+++ b/configure
@@ -2565,9 +2565,6 @@ if test "$gcrypt" != "no"; then
         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"
         if test -z "$nettle"; then
            nettle="no"
@@ -5715,6 +5712,8 @@ if test "$gnutls_rnd" = "yes" ; then
 fi
 if test "$gcrypt" = "yes" ; then
   echo "CONFIG_GCRYPT=y" >> $config_host_mak
+  echo "GCRYPT_CFLAGS=$gcrypt_cflags" >> $config_host_mak
+  echo "GCRYPT_LIBS=$gcrypt_libs" >> $config_host_mak
   if test "$gcrypt_hmac" = "yes" ; then
     echo "CONFIG_GCRYPT_HMAC=y" >> $config_host_mak
   fi
diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
index 0cb5fa24b6..45f7c0c80d 100644
--- a/crypto/Makefile.objs
+++ b/crypto/Makefile.objs
@@ -34,6 +34,13 @@ crypto-obj-y += block.o
 crypto-obj-y += block-qcow.o
 crypto-obj-y += block-luks.o
 
+$(if $(CONFIG_GCRYPT), \
+	$(foreach x, init cipher hash-gcrypt hmac-gcrypt random-gcrypt \
+			pbkdf-gcrypt, \
+		$(eval $x.o-cflags := $(NETTLE_CFLAGS)) \
+		$(eval $x.o-libs := $(NETTLE_LIBS))) \
+)
+
 $(if $(CONFIG_NETTLE), \
 	$(foreach x, cipher hash-nettle hmac-nettle pbkdf-nettle, \
 		$(eval $x.o-cflags := $(NETTLE_CFLAGS)) \
-- 
2.13.5

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

* Re: [Qemu-devel] [PATCH v3 1/3] buildsys: Move nettle cflags/libs to per object
  2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 1/3] buildsys: Move nettle cflags/libs to per object Fam Zheng
@ 2017-09-06  8:55   ` Daniel P. Berrange
  2017-09-06  9:30     ` Fam Zheng
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel P. Berrange @ 2017-09-06  8:55 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel

On Wed, Sep 06, 2017 at 03:44:16PM +0800, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  configure            | 5 ++---
>  crypto/Makefile.objs | 6 ++++++
>  2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/configure b/configure
> index fb7e34a901..6a4cb3832b 100755
> --- a/configure
> +++ b/configure
> @@ -2616,9 +2616,6 @@ if test "$nettle" != "no"; 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"
>  
>          cat > $TMPC << EOF
> @@ -5732,6 +5729,8 @@ if test "$nettle" = "yes" ; then
>    if test "$nettle_kdf" = "yes" ; then
>      echo "CONFIG_NETTLE_KDF=y" >> $config_host_mak
>    fi
> +  echo "NETTLE_CFLAGS=$nettle_cflags" >> $config_host_mak
> +  echo "NETTLE_LIBS=$nettle_libs" >> $config_host_mak
>  fi
>  if test "$tasn1" = "yes" ; then
>    echo "CONFIG_TASN1=y" >> $config_host_mak
> diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
> index 2b99e08062..a936957d03 100644
> --- a/crypto/Makefile.objs
> +++ b/crypto/Makefile.objs
> @@ -34,6 +34,12 @@ crypto-obj-y += block.o
>  crypto-obj-y += block-qcow.o
>  crypto-obj-y += block-luks.o
>  
> +$(if $(CONFIG_NETTLE), \
> +	$(foreach x, cipher hash-nettle hmac-nettle pbkdf-nettle, \
> +		$(eval $x.o-cflags := $(NETTLE_CFLAGS)) \
> +		$(eval $x.o-libs := $(NETTLE_LIBS))) \
> +)

This is a bit ugly, but i don't see any obvious alternative that
would work

> +
>  # Let the userspace emulators avoid linking gnutls/etc
>  crypto-aes-obj-y = aes.o

Reviewed-by: Daniel P. Berrange <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 :|

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

* Re: [Qemu-devel] [PATCH v3 2/3] buildsys: Move gnutls cflags/libs to per object
  2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 2/3] buildsys: Move gnutls " Fam Zheng
@ 2017-09-06  8:56   ` Daniel P. Berrange
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel P. Berrange @ 2017-09-06  8:56 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel

On Wed, Sep 06, 2017 at 03:44:17PM +0800, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  configure              |  5 ++---
>  crypto/Makefile.objs   |  7 +++++++
>  tests/Makefile.include | 10 +++++-----
>  3 files changed, 14 insertions(+), 8 deletions(-)
> 
> diff --git a/configure b/configure
> index 6a4cb3832b..6d90e73a8b 100755
> --- a/configure
> +++ b/configure
> @@ -2472,9 +2472,6 @@ if test "$gnutls" != "no"; then
>      if gnutls_works; 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"
>  
>  	# gnutls_rnd requires >= 2.11.0
> @@ -5710,6 +5707,8 @@ fi
>  echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak
>  if test "$gnutls" = "yes" ; then
>    echo "CONFIG_GNUTLS=y" >> $config_host_mak
> +  echo "GNUTLS_CFLAGS=$gnutls_cflags" >> $config_host_mak
> +  echo "GNUTLS_LIBS=$gnutls_libs" >> $config_host_mak
>  fi
>  if test "$gnutls_rnd" = "yes" ; then
>    echo "CONFIG_GNUTLS_RND=y" >> $config_host_mak
> diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
> index a936957d03..0cb5fa24b6 100644
> --- a/crypto/Makefile.objs
> +++ b/crypto/Makefile.objs
> @@ -40,6 +40,13 @@ $(if $(CONFIG_NETTLE), \
>  		$(eval $x.o-libs := $(NETTLE_LIBS))) \
>  )
>  
> +$(if $(CONFIG_GNUTLS), \
> +	$(foreach x, init random-gnutls tlscreds tlscredsanon \
> +			tlscredsx509 tlssession, \
> +		$(eval $x.o-cflags := $(GNUTLS_CFLAGS)) \
> +		$(eval $x.o-libs := $(GNUTLS_LIBS))) \
> +)
> +
>  # Let the userspace emulators avoid linking gnutls/etc
>  crypto-aes-obj-y = aes.o
>  
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index fae5715e9c..d46c22d1ec 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -677,15 +677,15 @@ tests/benchmark-crypto-cipher$(EXESUF): tests/benchmark-crypto-cipher.o $(test-c
>  tests/test-crypto-secret$(EXESUF): tests/test-crypto-secret.o $(test-crypto-obj-y)
>  tests/test-crypto-xts$(EXESUF): tests/test-crypto-xts.o $(test-crypto-obj-y)
>  
> -tests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS)
> -tests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS)
> -tests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS)
> +tests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS) $(GNUTLS_CFLAGS)
> +tests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS) $(GNUTLS_LIBS)
> +tests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS) $(GNUTLS_LIBS)
>  
> -tests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS)
> +tests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS) $(GNUTLS_CFLAGS)
>  tests/test-crypto-tlscredsx509$(EXESUF): tests/test-crypto-tlscredsx509.o \
>  	tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y)
>  
> -tests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS)
> +tests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS) $(GNUTLS_CFLAGS)
>  tests/test-crypto-tlssession$(EXESUF): tests/test-crypto-tlssession.o \
>  	tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y)
>  tests/test-io-task$(EXESUF): tests/test-io-task.o $(test-io-obj-y)

Reviewed-by: Daniel P. Berrange <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 :|

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

* Re: [Qemu-devel] [PATCH v3 3/3] buildsys: Move gcrypt cflags/libs to per object
  2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 3/3] buildsys: Move gcrypt " Fam Zheng
@ 2017-09-06  8:56   ` Daniel P. Berrange
  2017-09-06  9:25     ` Fam Zheng
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel P. Berrange @ 2017-09-06  8:56 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel

On Wed, Sep 06, 2017 at 03:44:18PM +0800, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  configure            | 5 ++---
>  crypto/Makefile.objs | 7 +++++++
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/configure b/configure
> index 6d90e73a8b..b37cd54bda 100755
> --- a/configure
> +++ b/configure
> @@ -2565,9 +2565,6 @@ if test "$gcrypt" != "no"; then
>          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"
>          if test -z "$nettle"; then
>             nettle="no"
> @@ -5715,6 +5712,8 @@ if test "$gnutls_rnd" = "yes" ; then
>  fi
>  if test "$gcrypt" = "yes" ; then
>    echo "CONFIG_GCRYPT=y" >> $config_host_mak
> +  echo "GCRYPT_CFLAGS=$gcrypt_cflags" >> $config_host_mak
> +  echo "GCRYPT_LIBS=$gcrypt_libs" >> $config_host_mak
>    if test "$gcrypt_hmac" = "yes" ; then
>      echo "CONFIG_GCRYPT_HMAC=y" >> $config_host_mak
>    fi
> diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
> index 0cb5fa24b6..45f7c0c80d 100644
> --- a/crypto/Makefile.objs
> +++ b/crypto/Makefile.objs
> @@ -34,6 +34,13 @@ crypto-obj-y += block.o
>  crypto-obj-y += block-qcow.o
>  crypto-obj-y += block-luks.o
>  
> +$(if $(CONFIG_GCRYPT), \
> +	$(foreach x, init cipher hash-gcrypt hmac-gcrypt random-gcrypt \
> +			pbkdf-gcrypt, \
> +		$(eval $x.o-cflags := $(NETTLE_CFLAGS)) \
> +		$(eval $x.o-libs := $(NETTLE_LIBS))) \
> +)
> +
>  $(if $(CONFIG_NETTLE), \
>  	$(foreach x, cipher hash-nettle hmac-nettle pbkdf-nettle, \
>  		$(eval $x.o-cflags := $(NETTLE_CFLAGS)) \

Reviewed-by: Daniel P. Berrange <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 :|

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

* Re: [Qemu-devel] [PATCH v3 3/3] buildsys: Move gcrypt cflags/libs to per object
  2017-09-06  8:56   ` Daniel P. Berrange
@ 2017-09-06  9:25     ` Fam Zheng
  0 siblings, 0 replies; 9+ messages in thread
From: Fam Zheng @ 2017-09-06  9:25 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel

On Wed, 09/06 09:56, Daniel P. Berrange wrote:
> On Wed, Sep 06, 2017 at 03:44:18PM +0800, Fam Zheng wrote:
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  configure            | 5 ++---
> >  crypto/Makefile.objs | 7 +++++++
> >  2 files changed, 9 insertions(+), 3 deletions(-)
> > 
> > diff --git a/configure b/configure
> > index 6d90e73a8b..b37cd54bda 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2565,9 +2565,6 @@ if test "$gcrypt" != "no"; then
> >          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"
> >          if test -z "$nettle"; then
> >             nettle="no"
> > @@ -5715,6 +5712,8 @@ if test "$gnutls_rnd" = "yes" ; then
> >  fi
> >  if test "$gcrypt" = "yes" ; then
> >    echo "CONFIG_GCRYPT=y" >> $config_host_mak
> > +  echo "GCRYPT_CFLAGS=$gcrypt_cflags" >> $config_host_mak
> > +  echo "GCRYPT_LIBS=$gcrypt_libs" >> $config_host_mak
> >    if test "$gcrypt_hmac" = "yes" ; then
> >      echo "CONFIG_GCRYPT_HMAC=y" >> $config_host_mak
> >    fi
> > diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
> > index 0cb5fa24b6..45f7c0c80d 100644
> > --- a/crypto/Makefile.objs
> > +++ b/crypto/Makefile.objs
> > @@ -34,6 +34,13 @@ crypto-obj-y += block.o
> >  crypto-obj-y += block-qcow.o
> >  crypto-obj-y += block-luks.o
> >  
> > +$(if $(CONFIG_GCRYPT), \
> > +	$(foreach x, init cipher hash-gcrypt hmac-gcrypt random-gcrypt \
> > +			pbkdf-gcrypt, \
> > +		$(eval $x.o-cflags := $(NETTLE_CFLAGS)) \
> > +		$(eval $x.o-libs := $(NETTLE_LIBS))) \

Sorry, these should be GCRYPT_* :(

Fam

> > +)
> > +
> >  $(if $(CONFIG_NETTLE), \
> >  	$(foreach x, cipher hash-nettle hmac-nettle pbkdf-nettle, \
> >  		$(eval $x.o-cflags := $(NETTLE_CFLAGS)) \
> 
> Reviewed-by: Daniel P. Berrange <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 :|
> 

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

* Re: [Qemu-devel] [PATCH v3 1/3] buildsys: Move nettle cflags/libs to per object
  2017-09-06  8:55   ` Daniel P. Berrange
@ 2017-09-06  9:30     ` Fam Zheng
  0 siblings, 0 replies; 9+ messages in thread
From: Fam Zheng @ 2017-09-06  9:30 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel

On Wed, 09/06 09:55, Daniel P. Berrange wrote:
> On Wed, Sep 06, 2017 at 03:44:16PM +0800, Fam Zheng wrote:
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  configure            | 5 ++---
> >  crypto/Makefile.objs | 6 ++++++
> >  2 files changed, 8 insertions(+), 3 deletions(-)
> > 
> > diff --git a/configure b/configure
> > index fb7e34a901..6a4cb3832b 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2616,9 +2616,6 @@ if test "$nettle" != "no"; 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"
> >  
> >          cat > $TMPC << EOF
> > @@ -5732,6 +5729,8 @@ if test "$nettle" = "yes" ; then
> >    if test "$nettle_kdf" = "yes" ; then
> >      echo "CONFIG_NETTLE_KDF=y" >> $config_host_mak
> >    fi
> > +  echo "NETTLE_CFLAGS=$nettle_cflags" >> $config_host_mak
> > +  echo "NETTLE_LIBS=$nettle_libs" >> $config_host_mak
> >  fi
> >  if test "$tasn1" = "yes" ; then
> >    echo "CONFIG_TASN1=y" >> $config_host_mak
> > diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
> > index 2b99e08062..a936957d03 100644
> > --- a/crypto/Makefile.objs
> > +++ b/crypto/Makefile.objs
> > @@ -34,6 +34,12 @@ crypto-obj-y += block.o
> >  crypto-obj-y += block-qcow.o
> >  crypto-obj-y += block-luks.o
> >  
> > +$(if $(CONFIG_NETTLE), \
> > +	$(foreach x, cipher hash-nettle hmac-nettle pbkdf-nettle, \
> > +		$(eval $x.o-cflags := $(NETTLE_CFLAGS)) \
> > +		$(eval $x.o-libs := $(NETTLE_LIBS))) \
> > +)
> 
> This is a bit ugly, but i don't see any obvious alternative that
> would work

Since I screwed up the gcrypt patch, v4 is needed, I'll try to make it less
ugly (no foreach and eval).

Fam

> 
> > +
> >  # Let the userspace emulators avoid linking gnutls/etc
> >  crypto-aes-obj-y = aes.o
> 
> Reviewed-by: Daniel P. Berrange <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 :|
> 

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

end of thread, other threads:[~2017-09-06  9:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-06  7:44 [Qemu-devel] [PATCH v3 0/3] buildsys: Move crypto libraries to per object variables Fam Zheng
2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 1/3] buildsys: Move nettle cflags/libs to per object Fam Zheng
2017-09-06  8:55   ` Daniel P. Berrange
2017-09-06  9:30     ` Fam Zheng
2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 2/3] buildsys: Move gnutls " Fam Zheng
2017-09-06  8:56   ` Daniel P. Berrange
2017-09-06  7:44 ` [Qemu-devel] [PATCH v3 3/3] buildsys: Move gcrypt " Fam Zheng
2017-09-06  8:56   ` Daniel P. Berrange
2017-09-06  9:25     ` Fam Zheng

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.