Skip to contentSkip to conversation

configure: Fix libssh on Ubuntu 18.04

PATCH In review Philippe Mathieu-Daudé 5 participants 16 messages Aug 14, 2019 – Aug 15, 2019 Block layer

lore
Share & tools
lore
#0 lore raw

cover configure: Fix libssh on Ubuntu 18.04

Since a long time occured between libssh 0.7 and libssh 0.8, distributions went cherry-picking improvments from the trunk branch into their 0.7 branch, leading to packages versioned as 0.7 but having 0.8 features.

This series fixes the oddest combination found so far, packaged with Ubuntu 18.04.

This fixes https://bugs.launchpad.net/qemu/+bug/1838763

Philippe Mathieu-Daudé (4):
RFC configure: Improve libssh check
configure: Avoid using libssh deprecated API
configure: Improve checking libssh version is 0.8
configure: Log the libssh version detected

 block/ssh.c |  2 +-
 configure   | 21 +++++++++++++++++++--
 2 files changed, 20 insertions(+), 3 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

RFC PATCH 1/4 configure: Improve libssh check

The libssh pkg-config is not complete, the libraries required to link with libssh are not returned. For example on Ubuntu 18.04:

  $ dpkg -l|fgrep libssh
  ii libssh-4:arm64 0.8.0~20170825.94fa1e38-1ubuntu0.2 arm64 tiny C SSH library (OpenSSL flavor)
  ii libssh-dev 0.8.0~20170825.94fa1e38-1ubuntu0.2 arm64 tiny C SSH library. Development files (OpenSSL flavor)
  $ pkg-config libssh --libs
  -lssh

Since the ./configure script tries to link an object to figure if libssh is available, it fails:

  $ cat  config.log
  [...]
  cc -pthread -I/usr/include/glib-2.0 [...] -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -m64 -static -g -lssh
  /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libssh.a(dh.c.o): In function `ssh_crypto_init':
  (.text+0x1a9): undefined reference to `BN_new'
  (.text+0x1c2): undefined reference to `BN_set_word'
  (.text+0x1c7): undefined reference to `BN_new'
  (.text+0x1e7): undefined reference to `BN_bin2bn'
  (.text+0x1ec): undefined reference to `BN_new'
  (.text+0x20c): undefined reference to `BN_bin2bn'
  (.text+0x218): undefined reference to `OPENSSL_init_crypto'
  [...]
  collect2: error: ld returned 1 exit status

To bypass this check, simply compile an object using libssh headers.

---
Should we check for libcrypto?

$ pkg-config --libs libssh openssl
-lssh -lssl -lcrypto
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 714e7fb6a1..1d5c07de1f 100755
@@ -3951,7 +3951,7 @@ if test "$libssh" = "yes"; then
 #include <libssh/libssh.h>
 int main(void) { return ssh_get_server_publickey(NULL, NULL); }
 EOF
-  if compile_prog "$libssh_cflags" "$libssh_libs"; then
+  if compile_object "$libssh_cflags"; then
     libssh_cflags="-DHAVE_LIBSSH_0_8 $libssh_cflags"
   fi
 fi
Signature · 1 line
2.20.1
#2 lore raw

Re: [Qemu-devel] [RFC PATCH 1/4] configure: Improve libssh check

Quoted 13 lines · On Wednesday, 14 August 2019 14:15:24 CEST Philippe Mathieu-Daudé wrote:

The libssh pkg-config is not complete, the libraries required to link with libssh are not returned. For example on Ubuntu 18.04:

  $ dpkg -l|fgrep libssh
  ii libssh-4:arm64 0.8.0~20170825.94fa1e38-1ubuntu0.2 arm64 tiny C SSH library (OpenSSL flavor)
  ii libssh-dev 0.8.0~20170825.94fa1e38-1ubuntu0.2 arm64 tiny C SSH library. Development files (OpenSSL flavor)
  $ pkg-config libssh --libs
  -lssh

Since the ./configure script tries to link an object to figure if libssh is available, it fails:

Quoted 13 lines
  $ cat  config.log
  [...]
  cc -pthread -I/usr/include/glib-2.0 [...] -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -m64 -static -g -lssh
  /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libssh.a(dh.c.o): In function `ssh_crypto_init':
  (.text+0x1a9): undefined reference to `BN_new'
  (.text+0x1c2): undefined reference to `BN_set_word'
  (.text+0x1c7): undefined reference to `BN_new'
  (.text+0x1e7): undefined reference to `BN_bin2bn'
  (.text+0x1ec): undefined reference to `BN_new'
  (.text+0x20c): undefined reference to `BN_bin2bn'
  (.text+0x218): undefined reference to `OPENSSL_init_crypto'
  [...]
  collect2: error: ld returned 1 exit status

Sigh :/

Quoted 5 lines

---
Should we check for libcrypto?

$ pkg-config --libs libssh openssl
-lssh -lssl -lcrypto

Definitely not! The crypto library is an internal implementation of libssh, so please do not assume libssh is built against openssl.

Signature · 1 line
Pino Toscano
#3 lore raw

PATCH 2/4 configure: Avoid using libssh deprecated API

In reply to Philippe Mathieu-Daudé

The libssh packaged by a distribution can predate version 0.8, but still provides the newer API introduced after version 0.7.

Using the deprecated API leads to build failure, as on Ubuntu 18.04:

CC block/ssh.o
block/ssh.c: In function 'check_host_key_hash':
block/ssh.c:444:5: error: 'ssh_get_publickey' is deprecated [-Werror=deprecated-declarations]

       r = ssh_get_publickey(s->session, &pubkey);
       ^
  In file included from block/ssh.c:27:0:
  /usr/include/libssh/libssh.h:489:31: note: declared here
   SSH_DEPRECATED LIBSSH_API int ssh_get_publickey(ssh_session session, ssh_key *key);
                                 ^~~~~~~~~~~~~~~~~

rules.mak:69: recipe for target 'block/ssh.o' failed
make: *** [block/ssh.o] Error 1

Fix by using the newer API if available.

---
 block/ssh.c | 2 +-
 configure   | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
block/ssh.c +1 -1
index 501933b855..f5fea921c6 100644
@@ -438,7 +438,7 @@ check_host_key_hash(BDRVSSHState *s, const char *hash,
     unsigned char *server_hash;
     size_t server_hash_len;
 
-#ifdef HAVE_LIBSSH_0_8
+#ifdef HAVE_SSH_GET_SERVER_PUBLICKEY
     r = ssh_get_server_publickey(s->session, &pubkey);
 #else
     r = ssh_get_publickey(s->session, &pubkey);
configure +7 -0
index 1d5c07de1f..fe3fef9309 100755
@@ -3949,11 +3949,18 @@ fi
 if test "$libssh" = "yes"; then
   cat > $TMPC <<EOF
 #include <libssh/libssh.h>
+#ifdef HAVE_SSH_GET_SERVER_PUBLICKEY
 int main(void) { return ssh_get_server_publickey(NULL, NULL); }
+#else
+int main(void) { return ssh_get_publickey(NULL, NULL); }
+#endif
 EOF
   if compile_object "$libssh_cflags"; then
     libssh_cflags="-DHAVE_LIBSSH_0_8 $libssh_cflags"
   fi
+  if compile_object "$libssh_cflags -DHAVE_SSH_GET_SERVER_PUBLICKEY"; then
+    libssh_cflags="-DHAVE_SSH_GET_SERVER_PUBLICKEY $libssh_cflags"
+  fi
 fi
 
 ##########################################
Signature · 1 line
2.20.1
#4 lore raw

Re: [Qemu-devel] [PATCH 2/4] configure: Avoid using libssh deprecated API

Quoted 49 lines · On Wednesday, 14 August 2019 14:15:25 CEST Philippe Mathieu-Daudé wrote:

The libssh packaged by a distribution can predate version 0.8, but still provides the newer API introduced after version 0.7.

Using the deprecated API leads to build failure, as on Ubuntu 18.04:

CC block/ssh.o
block/ssh.c: In function 'check_host_key_hash':
block/ssh.c:444:5: error: 'ssh_get_publickey' is deprecated [-Werror=deprecated-declarations]

       r = ssh_get_publickey(s->session, &pubkey);
       ^
  In file included from block/ssh.c:27:0:
  /usr/include/libssh/libssh.h:489:31: note: declared here
   SSH_DEPRECATED LIBSSH_API int ssh_get_publickey(ssh_session session, ssh_key *key);
                                 ^~~~~~~~~~~~~~~~~

rules.mak:69: recipe for target 'block/ssh.o' failed
make: *** [block/ssh.o] Error 1

Fix by using the newer API if available.

---
 block/ssh.c | 2 +-
 configure   | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
block/ssh.c +1 -1
index 501933b855..f5fea921c6 100644
@@ -438,7 +438,7 @@ check_host_key_hash(BDRVSSHState *s, const char *hash,
     unsigned char *server_hash;
     size_t server_hash_len;
 
-#ifdef HAVE_LIBSSH_0_8
+#ifdef HAVE_SSH_GET_SERVER_PUBLICKEY
     r = ssh_get_server_publickey(s->session, &pubkey);
 #else
     r = ssh_get_publickey(s->session, &pubkey);
configure +1 -0
index 1d5c07de1f..fe3fef9309 100755
@@ -3949,11 +3949,18 @@ fi
 if test "$libssh" = "yes"; then
   cat > $TMPC <<EOF
 #include <libssh/libssh.h>
+#ifdef HAVE_SSH_GET_SERVER_PUBLICKEY
 int main(void) { return ssh_get_server_publickey(NULL, NULL); }

configure fi · line 3963

Quoted 10 lines
configure +6 -0
+#else
+int main(void) { return ssh_get_publickey(NULL, NULL); }
+#endif
 EOF
   if compile_object "$libssh_cflags"; then
     libssh_cflags="-DHAVE_LIBSSH_0_8 $libssh_cflags"
   fi
+  if compile_object "$libssh_cflags -DHAVE_SSH_GET_SERVER_PUBLICKEY"; then
+    libssh_cflags="-DHAVE_SSH_GET_SERVER_PUBLICKEY $libssh_cflags"
+  fi

Why try to compile it twice? If the check for ssh_get_server_publickey works, then it is available...

Just add an additional HAVE_SSH_GET_SERVER_PUBLICKEY define when this test succeeds, and change the usage of ssh_get_server_publickey based on this.

Signature · 1 line
Pino Toscano
#5 lore raw

Re: [Qemu-devel] [PATCH 2/4] configure: Avoid using libssh deprecated API

In reply to Philippe Mathieu-Daudé
Quoted 17 lines · Philippe Mathieu-Daudé

The libssh packaged by a distribution can predate version 0.8, but still provides the newer API introduced after version 0.7.

Using the deprecated API leads to build failure, as on Ubuntu 18.04:

CC block/ssh.o
block/ssh.c: In function 'check_host_key_hash':
block/ssh.c:444:5: error: 'ssh_get_publickey' is deprecated [-Werror=deprecated-declarations]

       r = ssh_get_publickey(s->session, &pubkey);
       ^
  In file included from block/ssh.c:27:0:
  /usr/include/libssh/libssh.h:489:31: note: declared here
   SSH_DEPRECATED LIBSSH_API int ssh_get_publickey(ssh_session session, ssh_key *key);
                                 ^~~~~~~~~~~~~~~~~

rules.mak:69: recipe for target 'block/ssh.o' failed
make: *** [block/ssh.o] Error 1

Quoted 8 lines

Fix by using the newer API if available.

---
 block/ssh.c | 2 +-
 configure   | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

Did I really suggest this? I have no recollection of doing so, or even getting involved with libssh support in QEMU at all for that matter.

Signature · 1 line
Andrea Bolognani / Red Hat / Virtualization
#6 lore raw

Re: [Qemu-devel] [PATCH 2/4] configure: Avoid using libssh deprecated API

Quoted 27 lines · Andrea Bolognani
Quoted 17 lines · Philippe Mathieu-Daudé

The libssh packaged by a distribution can predate version 0.8, but still provides the newer API introduced after version 0.7.

Using the deprecated API leads to build failure, as on Ubuntu 18.04:

CC block/ssh.o
block/ssh.c: In function 'check_host_key_hash':
block/ssh.c:444:5: error: 'ssh_get_publickey' is deprecated [-Werror=deprecated-declarations]

       r = ssh_get_publickey(s->session, &pubkey);
       ^
  In file included from block/ssh.c:27:0:
  /usr/include/libssh/libssh.h:489:31: note: declared here
   SSH_DEPRECATED LIBSSH_API int ssh_get_publickey(ssh_session session, ssh_key *key);
                                 ^~~~~~~~~~~~~~~~~

rules.mak:69: recipe for target 'block/ssh.o' failed
make: *** [block/ssh.o] Error 1

Quoted 8 lines

Fix by using the newer API if available.

---
 block/ssh.c | 2 +-
 configure   | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
Quoted 3 lines

Did I really suggest this? I have no recollection of doing so, or even getting involved with libssh support in QEMU at all for that matter.

I took this suggestion from
https://www.redhat.com/archives/libvir-list/2018-May/msg00597.html

#7 lore raw

Re: [Qemu-devel] [PATCH 2/4] configure: Avoid using libssh deprecated API

Quoted 28 lines · Philippe Mathieu-Daudé
Quoted 27 lines · Andrea Bolognani
Quoted 25 lines · Philippe Mathieu-Daudé

The libssh packaged by a distribution can predate version 0.8, but still provides the newer API introduced after version 0.7.

Using the deprecated API leads to build failure, as on Ubuntu 18.04:

CC block/ssh.o
block/ssh.c: In function 'check_host_key_hash':
block/ssh.c:444:5: error: 'ssh_get_publickey' is deprecated [-Werror=deprecated-declarations]

       r = ssh_get_publickey(s->session, &pubkey);
       ^
  In file included from block/ssh.c:27:0:
  /usr/include/libssh/libssh.h:489:31: note: declared here
   SSH_DEPRECATED LIBSSH_API int ssh_get_publickey(ssh_session session, ssh_key *key);
                                 ^~~~~~~~~~~~~~~~~

rules.mak:69: recipe for target 'block/ssh.o' failed
make: *** [block/ssh.o] Error 1

Fix by using the newer API if available.

---
 block/ssh.c | 2 +-
 configure   | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
Quoted 6 lines
Quoted 3 lines

Did I really suggest this? I have no recollection of doing so, or even getting involved with libssh support in QEMU at all for that matter.

I took this suggestion from
https://www.redhat.com/archives/libvir-list/2018-May/msg00597.html

I see :)

I feel like adding a Suggested-by because of something that was posted on an unrelated project's mailing list is stretching the definition of the tag a bit, so if you end up having to respin I think it would be reasonable to drop it, but honestly it's not a big deal either way: I was just curious.

Signature · 1 line
Andrea Bolognani / Red Hat / Virtualization
#8 lore raw

Re: [Qemu-devel] [PATCH 2/4] configure: Avoid using libssh deprecated API

Quoted 36 lines · Andrea Bolognani
Quoted 28 lines · Philippe Mathieu-Daudé
Quoted 27 lines · Andrea Bolognani
Quoted 25 lines · Philippe Mathieu-Daudé

The libssh packaged by a distribution can predate version 0.8, but still provides the newer API introduced after version 0.7.

Using the deprecated API leads to build failure, as on Ubuntu 18.04:

CC block/ssh.o
block/ssh.c: In function 'check_host_key_hash':
block/ssh.c:444:5: error: 'ssh_get_publickey' is deprecated [-Werror=deprecated-declarations]

       r = ssh_get_publickey(s->session, &pubkey);
       ^
  In file included from block/ssh.c:27:0:
  /usr/include/libssh/libssh.h:489:31: note: declared here
   SSH_DEPRECATED LIBSSH_API int ssh_get_publickey(ssh_session session, ssh_key *key);
                                 ^~~~~~~~~~~~~~~~~

rules.mak:69: recipe for target 'block/ssh.o' failed
make: *** [block/ssh.o] Error 1

Fix by using the newer API if available.

---
 block/ssh.c | 2 +-
 configure   | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
Quoted 6 lines
Quoted 3 lines

Did I really suggest this? I have no recollection of doing so, or even getting involved with libssh support in QEMU at all for that matter.

I took this suggestion from
https://www.redhat.com/archives/libvir-list/2018-May/msg00597.html

Quoted 7 lines

I see :)

I feel like adding a Suggested-by because of something that was posted on an unrelated project's mailing list is stretching the definition of the tag a bit, so if you end up having to respin I think it would be reasonable to drop it, but honestly it's not a big deal either way: I was just curious.

Understood, sorry.

#9 lore raw

Re: [Qemu-devel] [PATCH 2/4] configure: Avoid using libssh deprecated API

Quoted 20 lines · Philippe Mathieu-Daudé
Quoted 19 lines · Andrea Bolognani
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 8 lines · Andrea Bolognani
Quoted 6 lines · Philippe Mathieu-Daudé
---
 block/ssh.c | 2 +-
 configure   | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
Quoted 6 lines
Quoted 3 lines

Did I really suggest this? I have no recollection of doing so, or even getting involved with libssh support in QEMU at all for that matter.

I took this suggestion from
https://www.redhat.com/archives/libvir-list/2018-May/msg00597.html

I see :)

Quoted 7 lines
Quoted 5 lines

I feel like adding a Suggested-by because of something that was posted on an unrelated project's mailing list is stretching the definition of the tag a bit, so if you end up having to respin I think it would be reasonable to drop it, but honestly it's not a big deal either way: I was just curious.

Understood, sorry.

Nothing to apologize for! :)

Signature · 1 line
Andrea Bolognani / Red Hat / Virtualization
#10 lore raw

PATCH 3/4 configure: Improve checking libssh version is 0.8

In reply to Philippe Mathieu-Daudé

To figure out which libssh version is installed, checking for ssh_get_server_publickey() is not sufficient.

ssh_get_server_publickey() has been introduced in libssh commit bbd052202 (predating 0.8) but distributions also backported other pre-0.8 patches, such libssh commit 963c46e4f which introduce the ssh_known_hosts_e enum.

Check the enum is available to assume the version is 0.8.

This fixes build failure on Ubuntu 18.04:

CC block/ssh.o
block/ssh.c: In function 'check_host_key_knownhosts':
block/ssh.c:281:28: error: storage size of 'state' isn't known

       enum ssh_known_hosts_e state;
                              ^~~~~

rules.mak:69: recipe for target 'block/ssh.o' failed
make: *** [block/ssh.o] Error 1

---
 configure | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
configure +7 -1
index fe3fef9309..040aa8eb6c 100755
@@ -3949,18 +3949,24 @@ fi
 if test "$libssh" = "yes"; then
   cat > $TMPC <<EOF
 #include <libssh/libssh.h>
+#ifdef HAVE_LIBSSH_0_8
+static const enum ssh_known_hosts_e val = SSH_KNOWN_HOSTS_OK;
+#endif
 #ifdef HAVE_SSH_GET_SERVER_PUBLICKEY
 int main(void) { return ssh_get_server_publickey(NULL, NULL); }
 #else
 int main(void) { return ssh_get_publickey(NULL, NULL); }
 #endif
 EOF
-  if compile_object "$libssh_cflags"; then
+  if compile_object "$libssh_cflags -DHAVE_LIBSSH_0_8"; then
     libssh_cflags="-DHAVE_LIBSSH_0_8 $libssh_cflags"
   fi
   if compile_object "$libssh_cflags -DHAVE_SSH_GET_SERVER_PUBLICKEY"; then
     libssh_cflags="-DHAVE_SSH_GET_SERVER_PUBLICKEY $libssh_cflags"
   fi
+  if ! compile_object "$libssh_cflags"; then
+    error_exit "cannot use with libssh (is it broken?)"
+  fi
 fi
 
 ##########################################
Signature · 1 line
2.20.1
#11 lore raw

Re: [Qemu-devel] [PATCH 3/4] configure: Improve checking libssh version is 0.8

Quoted 44 lines · On Wednesday, 14 August 2019 14:15:26 CEST Philippe Mathieu-Daudé wrote:

To figure out which libssh version is installed, checking for ssh_get_server_publickey() is not sufficient.

ssh_get_server_publickey() has been introduced in libssh commit bbd052202 (predating 0.8) but distributions also backported other pre-0.8 patches, such libssh commit 963c46e4f which introduce the ssh_known_hosts_e enum.

Check the enum is available to assume the version is 0.8.

This fixes build failure on Ubuntu 18.04:

CC block/ssh.o
block/ssh.c: In function 'check_host_key_knownhosts':
block/ssh.c:281:28: error: storage size of 'state' isn't known

       enum ssh_known_hosts_e state;
                              ^~~~~

rules.mak:69: recipe for target 'block/ssh.o' failed
make: *** [block/ssh.o] Error 1

---
 configure | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
configure +3 -0
index fe3fef9309..040aa8eb6c 100755
@@ -3949,18 +3949,24 @@ fi
 if test "$libssh" = "yes"; then
   cat > $TMPC <<EOF
 #include <libssh/libssh.h>
+#ifdef HAVE_LIBSSH_0_8
+static const enum ssh_known_hosts_e val = SSH_KNOWN_HOSTS_OK;
+#endif
 #ifdef HAVE_SSH_GET_SERVER_PUBLICKEY
 int main(void) { return ssh_get_server_publickey(NULL, NULL); }
 #else
 int main(void) { return ssh_get_publickey(NULL, NULL); }
 #endif
 EOF

configure fi · line 3969

Quoted 10 lines
configure +4 -1
-  if compile_object "$libssh_cflags"; then
+  if compile_object "$libssh_cflags -DHAVE_LIBSSH_0_8"; then
     libssh_cflags="-DHAVE_LIBSSH_0_8 $libssh_cflags"
   fi
   if compile_object "$libssh_cflags -DHAVE_SSH_GET_SERVER_PUBLICKEY"; then
     libssh_cflags="-DHAVE_SSH_GET_SERVER_PUBLICKEY $libssh_cflags"
   fi
+  if ! compile_object "$libssh_cflags"; then
+    error_exit "cannot use with libssh (is it broken?)"
+  fi

Ugh no, this is way more twisted and complex than really needed.

Instead, just add another build time check for ssh_session_is_known_server, and change check_host_key_knownhosts to use it only when found.

Signature · 1 line
Pino Toscano
#12 lore raw

PATCH 4/4 configure: Log the libssh version detected

In reply to Philippe Mathieu-Daudé

Log wether the version is 0.7 or 0.8 to better understand user reports.

---
 configure | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
configure +5 -1
index 040aa8eb6c..d06cee0ba0 100755
@@ -3930,6 +3930,7 @@ if test "$libssh" != "no" ; then
   if $pkg_config --exists libssh; then
     libssh_cflags=$($pkg_config libssh --cflags)
     libssh_libs=$($pkg_config libssh --libs)
+    libssh_version=$($pkg_config libssh --modversion)
     libssh=yes
   else
     if test "$libssh" = "yes" ; then
@@ -3960,6 +3961,9 @@ int main(void) { return ssh_get_publickey(NULL, NULL); }
 EOF
   if compile_object "$libssh_cflags -DHAVE_LIBSSH_0_8"; then
     libssh_cflags="-DHAVE_LIBSSH_0_8 $libssh_cflags"
+  else
+    # If this is not libssh 0.8, this is likely 0.7
+    libssh_version="0.7"
   fi
   if compile_object "$libssh_cflags -DHAVE_SSH_GET_SERVER_PUBLICKEY"; then
     libssh_cflags="-DHAVE_SSH_GET_SERVER_PUBLICKEY $libssh_cflags"
@@ -6466,7 +6470,7 @@ echo "GlusterFS support $glusterfs"
 echo "gcov              $gcov_tool"
 echo "gcov enabled      $gcov"
 echo "TPM support       $tpm"
-echo "libssh support    $libssh"
+echo "libssh support    $libssh $(echo_version $libssh $libssh_version)"
 echo "QOM debugging     $qom_cast_debug"
 echo "Live block migration $live_block_migration"
 echo "lzo support       $lzo"
Signature · 1 line
2.20.1
Acked-by on v1 4/4
#13 lore raw

Re: [Qemu-devel] [PATCH 4/4] configure: Log the libssh version detected

The series seems fine, so:

If it was me I'd be inclined to file a bug against Ubuntu and get them to fix their broken package instead :-)

Rich.

Signature · 5 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
#14 lore raw

Re: [Qemu-devel] [PATCH 4/4] configure: Log the libssh version detected

In reply to Philippe Mathieu-Daudé
Quoted 21 lines · On Wednesday, 14 August 2019 14:15:27 CEST Philippe Mathieu-Daudé wrote:

Log wether the version is 0.7 or 0.8 to better understand user reports.

---
 configure | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
configure +1 -0
index 040aa8eb6c..d06cee0ba0 100755
@@ -3930,6 +3930,7 @@ if test "$libssh" != "no" ; then
   if $pkg_config --exists libssh; then
     libssh_cflags=$($pkg_config libssh --cflags)
     libssh_libs=$($pkg_config libssh --libs)
+    libssh_version=$($pkg_config libssh --modversion)
     libssh=yes
   else
     if test "$libssh" = "yes" ; then

configure int main(void) { return ssh_get_publickey(NULL, NULL); } · line 3967

Quoted 7 lines
configure +3 -0
@@ -3960,6 +3961,9 @@ int main(void) { return ssh_get_publickey(NULL, NULL); }
 EOF
   if compile_object "$libssh_cflags -DHAVE_LIBSSH_0_8"; then
     libssh_cflags="-DHAVE_LIBSSH_0_8 $libssh_cflags"
+  else
+    # If this is not libssh 0.8, this is likely 0.7
+    libssh_version="0.7"
   fi

Not sure why this though -- please leave it out, and just log the version as found.

Signature · 1 line
Pino Toscano
#15 lore raw
In reply to Philippe Mathieu-Daudé
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1 === TEST SCRIPT END ===

Configure options:
--enable-werror --target-list=x86_64-softmmu --prefix=/tmp/qemu-test/install --python=/usr/bin/python3 --enable-debug --enable-sanitizers --cxx=clang++ --cc=clang --host-cc=clang

ERROR: configure test passed without -Werror but failed with -Werror.
This is probably a bug in the configure script. The failing command
will be at the bottom of config.log.
You can run configure with --disable-werror to bypass this check.
---
funcs: do_compiler do_cc compile_object check_define main
lines: 92 122 627 696 0
clang -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -c -o config-temp/qemu-conf.o config-temp/qemu-conf.c
config-temp/qemu-conf.c:2:2: error: __i386__ not defined
#error __i386__ not defined
^
1 error generated.
---
funcs: do_compiler do_cc compile_object check_define main
lines: 92 122 627 699 0
clang -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -c -o config-temp/qemu-conf.o config-temp/qemu-conf.c
config-temp/qemu-conf.c:2:2: error: __ILP32__ not defined
#error __ILP32__ not defined
^
1 error generated.
---
funcs: do_compiler do_cc compile_prog cc_has_warning_flag main
lines: 92 128 1958 1962 0
clang -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -Wno-string-plus-int -Wno-typedef-redefinition -Wno-initializer-overrides -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Werror -Wold-style-declaration -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -m64 -g
error: unknown warning option '-Wold-style-declaration'; did you mean '-Wout-of-line-declaration'? [-Werror,-Wunknown-warning-option]

funcs: do_compiler do_cc compile_prog cc_has_warning_flag main
lines: 92 128 1958 1962 0
---
funcs: do_compiler do_cc compile_prog main
lines: 92 128 2400 0
clang -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -Wno-string-plus-int -Wno-typedef-redefinition -Wno-initializer-overrides -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g -llzfse config-temp/qemu-conf.c:1:10: fatal error: 'lzfse.h' file not found

#include <lzfse.h>
         ^~~~~~~~~

1 error generated.
---
funcs: do_compiler do_cc compile_prog main
lines: 92 128 2981 0
clang -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -Wno-string-plus-int -Wno-typedef-redefinition -Wno-initializer-overrides -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g -lpam config-temp/qemu-conf.c:1:10: fatal error: 'security/pam_appl.h' file not found

#include <security/pam_appl.h>
         ^~~~~~~~~~~~~~~~~~~~~

1 error generated.
---
funcs: do_compiler do_cc compile_prog main
lines: 92 128 3313 0
clang -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -Wno-string-plus-int -Wno-typedef-redefinition -Wno-initializer-overrides -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g config-temp/qemu-conf.c:2:10: fatal error: 'xfs/xfs.h' file not found

#include <xfs/xfs.h>
         ^~~~~~~~~~~

1 error generated.
---
funcs: do_compiler do_cc compile_prog main
lines: 92 128 3337 0
clang -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -Wno-string-plus-int -Wno-typedef-redefinition -Wno-initializer-overrides -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g -lvdeplug config-temp/qemu-conf.c:1:10: fatal error: 'libvdeplug.h' file not found

#include <libvdeplug.h>
         ^~~~~~~~~~~~~~

1 error generated.
---
funcs: do_compiler do_cc compile_prog main
lines: 92 128 3900 0
clang -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -Wno-string-plus-int -Wno-typedef-redefinition -Wno-initializer-overrides -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g config-temp/qemu-conf.c:3:52: error: too few arguments to function call, expected 2, have 1
static void *f(void *p) { pthread_setname_np("QEMU"); }

                          ~~~~~~~~~~~~~~~~~~       ^

/usr/include/pthread.h:452:1: note: 'pthread_setname_np' declared here
---
funcs: do_compiler do_cc compile_object main
lines: 92 122 3962 0
clang -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -Wno-string-plus-int -Wno-typedef-redefinition -Wno-initializer-overrides -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -DHAVE_LIBSSH_0_8 -c -o config-temp/qemu-conf.o config-temp/qemu-conf.c config-temp/qemu-conf.c:8:25: warning: 'ssh_get_publickey' is deprecated [-Wdeprecated-declarations]
int main(void) { return ssh_get_publickey(NULL, NULL); }

                        ^
/usr/include/libssh/libssh.h:545:1: note: 'ssh_get_publickey' has been explicitly marked deprecated here
---
/usr/include/libssh/libssh.h:99:40: note: expanded from macro 'SSH_DEPRECATED'
#define SSH_DEPRECATED __attribute__ ((deprecated))
                                       ^
config-temp/qemu-conf.c:3:37: warning: unused variable 'val' [-Wunused-const-variable]
static const enum ssh_known_hosts_e val = SSH_KNOWN_HOSTS_OK;
                                    ^

2 warnings generated.
clang -Werror -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -Wno-string-plus-int -Wno-typedef-redefinition -Wno-initializer-overrides -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -DHAVE_LIBSSH_0_8 -c -o config-temp/qemu-conf.o config-temp/qemu-conf.c config-temp/qemu-conf.c:8:25: error: 'ssh_get_publickey' is deprecated [-Werror,-Wdeprecated-declarations]
int main(void) { return ssh_get_publickey(NULL, NULL); }

                        ^

/usr/include/libssh/libssh.h:545:1: note: 'ssh_get_publickey' has been explicitly marked deprecated here

The full log is available at
http://patchew.org/logs/[email protected]/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]