* [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking
@ 2019-06-14 10:07 Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 1/9] configure: Only generate GLUSTERFS variables if glusterfs is usable Philippe Mathieu-Daudé
` (10 more replies)
0 siblings, 11 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-06-14 10:07 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Thomas Huth, Daniel P . Berrangé,
qemu-block, Philippe Mathieu-Daudé, Michael Tokarev,
Bharata B Rao, Gerd Hoffmann, Paolo Bonzini, Alex Bennée,
Niels de Vos
Hi,
Apparently QEMU static linking is slowly bitroting. Obviously it
depends the libraries an user has installed, anyway it seems there
are not much testing done.
This series fixes few issues, enough to build QEMU on a Ubuntu
18.04 host.
Peter commented on v1:
The main reason for supporting static linking is so we can build
the user-mode emulators. Almost always the problems with
static linking the softmmu binaries and the tools are
issues with the distro's packaging of the static libraries
(pkg-config files which specify things that don't work for
static is a common one).
So we could put in a lot of checking of "is what pkg-config
tells us broken". Or we could just say "we don't support static
linking for anything except the usermode binaries". We
should probably phase in deprecation of that because it's
possible somebody's using it seriously, but it seems like
a fairly weird thing to do to me.
I share his view on this (restricting static linking to qemu-user)
but since the work was already done when I read his comment, I still
send the v2.
Since v1:
- pkg-config already use the '--static' argument, do not add it twice
- Fixed x86_64 host builds (was missing GTK and OpenGL patches)
- Added Niels R-b tag on the first patch
- The Travis-CI job now succeeds:
https://travis-ci.org/philmd/qemu/jobs/545653697 (6 min 7 sec)
Regards,
Phil.
Philippe Mathieu-Daudé (9):
configure: Only generate GLUSTERFS variables if glusterfs is usable
configure: Link test before auto-enabling GlusterFS libraries
configure: Link test before auto-enabling libusb library
configure: Link test before auto-enabling libusbredir library
configure: Link test before auto-enabling PulseAudio library
configure: Link test before auto-enabling OpenGL libraries
configure: Link test before auto-enabling GTK libraries
tests/docker: Kludge for missing libunistring.so symlink on Ubuntu
18.04
.travis.yml: Test softmmu static linking
.travis.yml | 5 +
configure | 121 ++++++++++++++++-----
tests/docker/dockerfiles/ubuntu1804.docker | 4 +
3 files changed, 100 insertions(+), 30 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH v2 1/9] configure: Only generate GLUSTERFS variables if glusterfs is usable
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
@ 2019-06-14 10:07 ` Philippe Mathieu-Daudé
2019-07-01 14:29 ` Daniel P. Berrangé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 2/9] configure: Link test before auto-enabling GlusterFS libraries Philippe Mathieu-Daudé
` (9 subsequent siblings)
10 siblings, 1 reply; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-06-14 10:07 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Thomas Huth, Daniel P . Berrangé,
qemu-block, Philippe Mathieu-Daudé, Michael Tokarev,
Bharata B Rao, Gerd Hoffmann, Paolo Bonzini, Alex Bennée,
Niels de Vos
It is pointless and confusing to have GLUSTERFS variables
in config-host.mak when glusterfs is not usable.
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
configure | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/configure b/configure
index b091b82cb3..13fd4a1166 100755
--- a/configure
+++ b/configure
@@ -7118,30 +7118,30 @@ if test "$glusterfs" = "yes" ; then
echo "CONFIG_GLUSTERFS=m" >> $config_host_mak
echo "GLUSTERFS_CFLAGS=$glusterfs_cflags" >> $config_host_mak
echo "GLUSTERFS_LIBS=$glusterfs_libs" >> $config_host_mak
-fi
-if test "$glusterfs_xlator_opt" = "yes" ; then
- echo "CONFIG_GLUSTERFS_XLATOR_OPT=y" >> $config_host_mak
-fi
+ if test "$glusterfs_xlator_opt" = "yes" ; then
+ echo "CONFIG_GLUSTERFS_XLATOR_OPT=y" >> $config_host_mak
+ fi
-if test "$glusterfs_discard" = "yes" ; then
- echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak
-fi
+ if test "$glusterfs_discard" = "yes" ; then
+ echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak
+ fi
-if test "$glusterfs_fallocate" = "yes" ; then
- echo "CONFIG_GLUSTERFS_FALLOCATE=y" >> $config_host_mak
-fi
+ if test "$glusterfs_fallocate" = "yes" ; then
+ echo "CONFIG_GLUSTERFS_FALLOCATE=y" >> $config_host_mak
+ fi
-if test "$glusterfs_zerofill" = "yes" ; then
- echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak
-fi
+ if test "$glusterfs_zerofill" = "yes" ; then
+ echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak
+ fi
-if test "$glusterfs_ftruncate_has_stat" = "yes" ; then
- echo "CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT=y" >> $config_host_mak
-fi
+ if test "$glusterfs_ftruncate_has_stat" = "yes" ; then
+ echo "CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT=y" >> $config_host_mak
+ fi
-if test "$glusterfs_iocb_has_stat" = "yes" ; then
- echo "CONFIG_GLUSTERFS_IOCB_HAS_STAT=y" >> $config_host_mak
+ if test "$glusterfs_iocb_has_stat" = "yes" ; then
+ echo "CONFIG_GLUSTERFS_IOCB_HAS_STAT=y" >> $config_host_mak
+ fi
fi
if test "$libssh2" = "yes" ; then
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH v2 2/9] configure: Link test before auto-enabling GlusterFS libraries
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 1/9] configure: Only generate GLUSTERFS variables if glusterfs is usable Philippe Mathieu-Daudé
@ 2019-06-14 10:07 ` Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 3/9] configure: Link test before auto-enabling libusb library Philippe Mathieu-Daudé
` (8 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-06-14 10:07 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Thomas Huth, Daniel P . Berrangé,
qemu-block, Philippe Mathieu-Daudé, Michael Tokarev,
Bharata B Rao, Gerd Hoffmann, Paolo Bonzini, Alex Bennée,
Niels de Vos
Similarly to commit a73e82ef912, test the libraries link correctly
before considering them as usable.
This fixes using ./configure --static on Ubuntu 18.04:
$ make subdir-aarch64-softmmu
[...]
LINK aarch64-softmmu/qemu-system-aarch64
/usr/bin/ld: cannot find -lgfapi
/usr/bin/ld: cannot find -lglusterfs
/usr/bin/ld: cannot find -lgfrpc
/usr/bin/ld: cannot find -lgfxdr
collect2: error: ld returned 1 exit status
Makefile:204: recipe for target 'qemu-system-aarch64' failed
make[1]: *** [qemu-system-aarch64] Error 1
$ fgrep gf config-host.mak
GLUSTERFS_LIBS=-lacl -lgfapi -lglusterfs -lgfrpc -lgfxdr -luuid
$ lsb_release -cri
Distributor ID: Ubuntu
Release: 18.04
Codename: bionic
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
configure | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 13fd4a1166..fe0e2e1b75 100755
--- a/configure
+++ b/configure
@@ -4179,9 +4179,19 @@ fi
# glusterfs probe
if test "$glusterfs" != "no" ; then
if $pkg_config --atleast-version=3 glusterfs-api; then
- glusterfs="yes"
glusterfs_cflags=$($pkg_config --cflags glusterfs-api)
glusterfs_libs=$($pkg_config --libs glusterfs-api)
+ # Packaging for the static libraries is not always correct.
+ # At least ubuntu 18.04 ships only shared libraries.
+ write_c_skeleton
+ if ! compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then
+ if test "$glusterfs" = "yes" ; then
+ error_exit "glusterfs check failed."
+ fi
+ glusterfs="no"
+ else
+ glusterfs="yes"
+ fi
if $pkg_config --atleast-version=4 glusterfs-api; then
glusterfs_xlator_opt="yes"
fi
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH v2 3/9] configure: Link test before auto-enabling libusb library
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 1/9] configure: Only generate GLUSTERFS variables if glusterfs is usable Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 2/9] configure: Link test before auto-enabling GlusterFS libraries Philippe Mathieu-Daudé
@ 2019-06-14 10:07 ` Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 4/9] configure: Link test before auto-enabling libusbredir library Philippe Mathieu-Daudé
` (7 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-06-14 10:07 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Thomas Huth, Daniel P . Berrangé,
qemu-block, Philippe Mathieu-Daudé, Michael Tokarev,
Bharata B Rao, Gerd Hoffmann, Paolo Bonzini, Alex Bennée,
Niels de Vos
Similarly to commit a73e82ef912, test the library links correctly
before considering it as usable.
This fixes using ./configure --static on Ubuntu 18.04:
$ make subdir-aarch64-softmmu
[...]
LINK aarch64-softmmu/qemu-system-aarch64
/usr/bin/ld: cannot find -ludev
collect2: error: ld returned 1 exit status
Makefile:204: recipe for target 'qemu-system-aarch64' failed
make[1]: *** [qemu-system-aarch64] Error 1
$ fgrep udev config-host.mak
LIBUSB_LIBS=-lusb-1.0 -ludev -pthread
$ lsb_release -cri
Distributor ID: Ubuntu
Release: 18.04
Codename: bionic
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
configure | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index fe0e2e1b75..2ebaa32746 100755
--- a/configure
+++ b/configure
@@ -4894,9 +4894,19 @@ fi
# check for libusb
if test "$libusb" != "no" ; then
if $pkg_config --atleast-version=1.0.13 libusb-1.0; then
- libusb="yes"
libusb_cflags=$($pkg_config --cflags libusb-1.0)
libusb_libs=$($pkg_config --libs libusb-1.0)
+ # Packaging for the static libraries is not always correct.
+ # At least ubuntu 18.04 ships only shared libraries.
+ write_c_skeleton
+ if ! compile_prog "$libusb_cflags" "$libusb_libs" ; then
+ if test "$libusb" = "yes" ; then
+ error_exit "libusb check failed."
+ fi
+ libusb="no"
+ else
+ libusb="yes"
+ fi
else
if test "$libusb" = "yes"; then
feature_not_found "libusb" "Install libusb devel >= 1.0.13"
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH v2 4/9] configure: Link test before auto-enabling libusbredir library
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 3/9] configure: Link test before auto-enabling libusb library Philippe Mathieu-Daudé
@ 2019-06-14 10:07 ` Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 5/9] configure: Link test before auto-enabling PulseAudio library Philippe Mathieu-Daudé
` (6 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-06-14 10:07 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Thomas Huth, Daniel P . Berrangé,
qemu-block, Philippe Mathieu-Daudé, Michael Tokarev,
Bharata B Rao, Gerd Hoffmann, Paolo Bonzini, Alex Bennée,
Niels de Vos
Similarly to commit a73e82ef912, test the library links correctly
before considering it as usable.
This fixes using ./configure --static on Ubuntu 18.04:
$ make subdir-aarch64-softmmu
[...]
LINK aarch64-softmmu/qemu-system-aarch64
/usr/bin/ld: cannot find -lusbredirparser
collect2: error: ld returned 1 exit status
Makefile:204: recipe for target 'qemu-system-aarch64' failed
make[1]: *** [qemu-system-aarch64] Error 1
$ fgrep redir config-host.mak
USB_REDIR_LIBS=-lusbredirparser
$ lsb_release -cri
Distributor ID: Ubuntu
Release: 18.04
Codename: bionic
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
configure | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 2ebaa32746..0dd6e8bed3 100755
--- a/configure
+++ b/configure
@@ -4918,9 +4918,19 @@ fi
# check for usbredirparser for usb network redirection support
if test "$usb_redir" != "no" ; then
if $pkg_config --atleast-version=0.6 libusbredirparser-0.5; then
- usb_redir="yes"
usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5)
usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5)
+ # Packaging for the static libraries is not always correct.
+ # At least ubuntu 18.04 ships only shared libraries.
+ write_c_skeleton
+ if ! compile_prog "$usb_redir_cflags" "$usb_redir_libs" ; then
+ if test "$usb_redir" = "yes" ; then
+ error_exit "usbredir check failed."
+ fi
+ usb_redir="no"
+ else
+ usb_redir="yes"
+ fi
else
if test "$usb_redir" = "yes"; then
feature_not_found "usb-redir" "Install usbredir devel"
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH v2 5/9] configure: Link test before auto-enabling PulseAudio library
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 4/9] configure: Link test before auto-enabling libusbredir library Philippe Mathieu-Daudé
@ 2019-06-14 10:07 ` Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 6/9] configure: Link test before auto-enabling OpenGL libraries Philippe Mathieu-Daudé
` (5 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-06-14 10:07 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Thomas Huth, Daniel P . Berrangé,
qemu-block, Philippe Mathieu-Daudé, Michael Tokarev,
Bharata B Rao, Gerd Hoffmann, Paolo Bonzini, Alex Bennée,
Niels de Vos
Similarly to commit a73e82ef912, test the library links correctly
before considering it as usable.
This fixes using ./configure --static on Ubuntu 18.04:
$ make subdir-aarch64-softmmu
[...]
LINK aarch64-softmmu/qemu-system-aarch64
/usr/bin/ld: cannot find -lpulse
/usr/bin/ld: cannot find -lpulsecommon-11.1
collect2: error: ld returned 1 exit status
Makefile:204: recipe for target 'qemu-system-aarch64' failed
make[1]: *** [qemu-system-aarch64] Error 1
$ fgrep pulse config-host.mak
PULSE_LIBS=-L/usr/lib/aarch64-linux-gnu/pulseaudio -lpulse -lpulsecommon-11.1
$ lsb_release -cri
Distributor ID: Ubuntu
Release: 18.04
Codename: bionic
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
configure | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index 0dd6e8bed3..449dbd69ce 100755
--- a/configure
+++ b/configure
@@ -3408,10 +3408,21 @@ for drv in $audio_drv_list; do
pa | try-pa)
if $pkg_config libpulse --exists; then
- pulse_libs=$($pkg_config libpulse --libs)
- audio_pt_int="yes"
- if test "$drv" = "try-pa"; then
- audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa/pa/')
+ pulse_cflags=$($pkg_config --cflags libpulse)
+ pulse_libs=$($pkg_config --libs libpulse)
+ # Packaging for the static libraries is not always correct.
+ # At least ubuntu 18.04 ships only shared libraries.
+ write_c_skeleton
+ if ! compile_prog "$pulse_cflags" "$pulse_libs" ; then
+ unset pulse_cflags pulse_libs
+ if test "$drv" = "try-pa"; then
+ audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa//')
+ fi
+ else
+ audio_pt_int="yes"
+ if test "$drv" = "try-pa"; then
+ audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa/pa/')
+ fi
fi
else
if test "$drv" = "try-pa"; then
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH v2 6/9] configure: Link test before auto-enabling OpenGL libraries
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 5/9] configure: Link test before auto-enabling PulseAudio library Philippe Mathieu-Daudé
@ 2019-06-14 10:07 ` Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 7/9] configure: Link test before auto-enabling GTK libraries Philippe Mathieu-Daudé
` (4 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-06-14 10:07 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Thomas Huth, Daniel P . Berrangé,
qemu-block, Philippe Mathieu-Daudé, Michael Tokarev,
Bharata B Rao, Gerd Hoffmann, Paolo Bonzini, Alex Bennée,
Niels de Vos
Similarly to commit a73e82ef912, test the libraries link correctly
before considering them as usable.
This fixes using ./configure --static on Ubuntu 18.04:
$ make subdir-lm32-softmmu
[...]
LINK lm32-softmmu/qemu-system-lm32
/usr/bin/ld: cannot find -lepoxy
/usr/bin/ld: cannot find -lgbm
collect2: error: ld returned 1 exit status
Makefile:204: recipe for target 'qemu-system-lm32' failed
make[1]: *** [qemu-system-lm32] Error 1
$ fgrep epoxy config-host.mak
OPENGL_LIBS=-lepoxy -ldl -lgbm -ldl
$ lsb_release -cri
Distributor ID: Ubuntu
Release: 18.04
Codename: bionic
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
configure | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index 449dbd69ce..a3da5adf80 100755
--- a/configure
+++ b/configure
@@ -4133,11 +4133,21 @@ if test "$opengl" != "no" ; then
if $pkg_config $opengl_pkgs; then
opengl_cflags="$($pkg_config --cflags $opengl_pkgs)"
opengl_libs="$($pkg_config --libs $opengl_pkgs)"
- opengl=yes
- if test "$gtk" = "yes" && $pkg_config --exists "$gtkpackage >= 3.16"; then
- gtk_gl="yes"
+ # Packaging for the static libraries is not always correct.
+ # At least ubuntu 18.04 ships only shared libraries.
+ write_c_skeleton
+ if ! compile_prog "$opengl_cflags" "$opengl_libs" ; then
+ if test "$opengl" = "yes" ; then
+ error_exit "opengl check failed."
+ fi
+ opengl=no
+ else
+ opengl=yes
+ if test "$gtk" = "yes" && $pkg_config --exists "$gtkpackage >= 3.16"; then
+ gtk_gl="yes"
+ fi
+ QEMU_CFLAGS="$QEMU_CFLAGS $opengl_cflags"
fi
- QEMU_CFLAGS="$QEMU_CFLAGS $opengl_cflags"
else
if test "$opengl" = "yes" ; then
feature_not_found "opengl" "Please install opengl (mesa) devel pkgs: $opengl_pkgs"
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH v2 7/9] configure: Link test before auto-enabling GTK libraries
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
` (5 preceding siblings ...)
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 6/9] configure: Link test before auto-enabling OpenGL libraries Philippe Mathieu-Daudé
@ 2019-06-14 10:07 ` Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 8/9] tests/docker: Kludge for missing libunistring.so symlink on Ubuntu 18.04 Philippe Mathieu-Daudé
` (3 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-06-14 10:07 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Thomas Huth, Daniel P . Berrangé,
qemu-block, Philippe Mathieu-Daudé, Michael Tokarev,
Bharata B Rao, Gerd Hoffmann, Paolo Bonzini, Alex Bennée,
Niels de Vos
Similarly to commit a73e82ef912, test the libraries link correctly
before considering them as usable.
This fixes using ./configure --static on Ubuntu 18.04:
$ make subdir-lm32-softmmu
[...]
LINK lm32-softmmu/qemu-system-lm32
/usr/bin/ld: cannot find -lgtk-3
/usr/bin/ld: cannot find -latk-bridge-2.0
/usr/bin/ld: cannot find -latspi
/usr/bin/ld: cannot find -lsystemd
/usr/bin/ld: cannot find -lgdk-3
/usr/bin/ld: cannot find -lwayland-cursor
/usr/bin/ld: cannot find -lwayland-egl
/usr/bin/ld: cannot find -lwayland-client
/usr/bin/ld: cannot find -lepoxy
/usr/bin/ld: cannot find -lgraphite2
collect2: error: ld returned 1 exit status
Makefile:204: recipe for target 'qemu-system-lm32' failed
make[1]: *** [qemu-system-lm32] Error 1
$ fgrep gdk config-host.mak
GTK_LIBS=-lgtk-3 -latk-bridge-2.0 -latspi -ldbus-1 -lpthread -lsystemd -lgdk-3 -lgio-2.0 -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lXfixes -lxkbcommon -lwayland-cursor -lwayland-egl -lwayland-client -lepoxy -ldl -lpangocairo-1.0 -lpangoft2-1.0 -lharfbuzz -lm -lgraphite2 -lpango-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lz -lpixman-1 -lfontconfig -lexpat -lfreetype -lexpat -lfreetype -lpng16 -lm -lz -lm -lxcb-shm -lxcb-render -lXrender -lXext -lX11 -lpthread -lxcb -lXau -lXdmcp -lgdk_pixbuf-2.0 -lm -lpng16 -lm -lz -lm -lz -lgio-2.0 -lz -lresolv -lselinux -lmount -lgmodule-2.0 -pthread -ldl -lgobject-2.0 -lffi -lglib-2.0 -pthread -lpcre -pthread -lX11 -lpthread -lxcb -lXau -lXdmcp
VTE_CFLAGS=-pthread -I/usr/include/vte-2.91 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/p11-kit-1
$ lsb_release -cri
Distributor ID: Ubuntu
Release: 18.04
Codename: bionic
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
configure | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index a3da5adf80..ffd269b34f 100755
--- a/configure
+++ b/configure
@@ -2782,7 +2782,17 @@ if test "$gtk" != "no"; then
gtk_cflags="$gtk_cflags $x11_cflags"
gtk_libs="$gtk_libs $x11_libs"
fi
- gtk="yes"
+ # Packaging for the static libraries is not always correct.
+ # At least ubuntu 18.04 ships only shared libraries.
+ write_c_skeleton
+ if ! compile_prog "$gtk_cflags" "$gtk_libs" ; then
+ if test "$gtk" = "yes" ; then
+ error_exit "gtk check failed."
+ fi
+ gtk="no"
+ else
+ gtk="yes"
+ fi
elif test "$gtk" = "yes"; then
feature_not_found "gtk" "Install gtk3-devel"
else
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH v2 8/9] tests/docker: Kludge for missing libunistring.so symlink on Ubuntu 18.04
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
` (6 preceding siblings ...)
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 7/9] configure: Link test before auto-enabling GTK libraries Philippe Mathieu-Daudé
@ 2019-06-14 10:07 ` Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 9/9] .travis.yml: Test softmmu static linking Philippe Mathieu-Daudé
` (2 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-06-14 10:07 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Thomas Huth, Daniel P . Berrangé,
qemu-block, Philippe Mathieu-Daudé, Michael Tokarev,
Bharata B Rao, Gerd Hoffmann, Paolo Bonzini, Alex Bennée,
Niels de Vos
When linking statically on Ubuntu 18.04 we get:
$ make subdir-x86_64-softmmu
[...]
LINK x86_64-softmmu/qemu-system-x86_64
c++: error: /usr/lib/x86_64-linux-gnu/libunistring.so: No such file or directory
This library is pulled in by GTK:
$ pkg-config --libs --static gtk+-3.0
-lgtk-3 -latk-bridge-2.0 -latspi -ldbus-1 -lpthread -lsystemd -lgdk-3 -lgio-2.0 -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lXfixes -lxkbcommon -lwayland-cursor -lwayland-egl -lwayland-client -lepoxy -ldl -lpangocairo-1.0 -lpangoft2-1.0 -lharfbuzz -lm -lgraphite2 -lpango-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lz -lpixman-1 -lfontconfig -lexpat -lfreetype -lexpat -lfreetype -lpng16 -lm -lz -lm -lxcb-shm -lxcb-render -lXrender -lXext -lX11 -lpthread -lxcb -lXau -lXdmcp -lgdk_pixbuf-2.0 -lm -lpng16 -lm -lz -lm -lz -lgio-2.0 -lz -lresolv -lselinux -lmount -lgmodule-2.0 -pthread -ldl -lgobject-2.0 -lffi -lglib-2.0 -pthread -lpcre -pthread
However, while the library is presentm, its symlink is missing:
$ ls -ld /usr/lib/x86_64-linux-gnu/libunistring.so
ls: cannot access '/usr/lib/x86_64-linux-gnu/libunistring.so': No such file or directory
$ ls -ld /usr/lib/x86_64-linux-gnu/libunistring.so*
lrwxrwxrwx. 1 root root 21 Mar 3 2018 /usr/lib/x86_64-linux-gnu/libunistring.so.2 -> libunistring.so.2.1.0
-rw-r--r--. 1 root root 1562664 Mar 3 2018 /usr/lib/x86_64-linux-gnu/libunistring.so.2.1.0
Fix the issue by creating the missing symlink manually.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
tests/docker/dockerfiles/ubuntu1804.docker | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/docker/dockerfiles/ubuntu1804.docker b/tests/docker/dockerfiles/ubuntu1804.docker
index 2e2900150b..7e45c52166 100644
--- a/tests/docker/dockerfiles/ubuntu1804.docker
+++ b/tests/docker/dockerfiles/ubuntu1804.docker
@@ -54,4 +54,8 @@ ENV PACKAGES flex bison \
RUN apt-get update && \
apt-get -y install $PACKAGES
RUN dpkg -l $PACKAGES | sort > /packages.txt
+# The libunistring2 package does not create a symlink to libunistring.so
+# Create it manually to fix:
+# error: /usr/lib/x86_64-linux-gnu/libunistring.so: No such file or directory
+RUN ln -s libunistring.so.2 /usr/lib/x86_64-linux-gnu/libunistring.so
ENV FEATURES clang pyyaml sdl2
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH v2 9/9] .travis.yml: Test softmmu static linking
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
` (7 preceding siblings ...)
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 8/9] tests/docker: Kludge for missing libunistring.so symlink on Ubuntu 18.04 Philippe Mathieu-Daudé
@ 2019-06-14 10:07 ` Philippe Mathieu-Daudé
2019-07-01 14:08 ` [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
2019-07-01 14:36 ` Daniel P. Berrangé
10 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-06-14 10:07 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Thomas Huth, Daniel P . Berrangé,
qemu-block, Philippe Mathieu-Daudé, Michael Tokarev,
Bharata B Rao, Gerd Hoffmann, Paolo Bonzini, Alex Bennée,
Niels de Vos
Add a test to avoid the ./configure script to bitrot.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
.travis.yml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/.travis.yml b/.travis.yml
index 08502c0aa2..6962fff826 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -92,6 +92,11 @@ matrix:
- CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
+ # Test static linking
+ - env:
+ - CONFIG="--static --target-list=lm32-softmmu"
+
+
# Just build tools and run minimal unit and softfloat checks
- env:
- BASE_CONFIG="--enable-tools"
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
` (8 preceding siblings ...)
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 9/9] .travis.yml: Test softmmu static linking Philippe Mathieu-Daudé
@ 2019-07-01 14:08 ` Philippe Mathieu-Daudé
2019-07-01 14:36 ` Daniel P. Berrangé
10 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-07-01 14:08 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Thomas Huth, Daniel P . Berrangé,
qemu-block, QEMU Trivial, Michael Tokarev, Bharata B Rao,
Gerd Hoffmann, Paolo Bonzini, Alex Bennée, Niels de Vos
On 6/14/19 12:07 PM, Philippe Mathieu-Daudé wrote:
> Hi,
>
> Apparently QEMU static linking is slowly bitroting. Obviously it
> depends the libraries an user has installed, anyway it seems there
> are not much testing done.
>
> This series fixes few issues, enough to build QEMU on a Ubuntu
> 18.04 host.
>
> Peter commented on v1:
>
> The main reason for supporting static linking is so we can build
> the user-mode emulators. Almost always the problems with
> static linking the softmmu binaries and the tools are
> issues with the distro's packaging of the static libraries
> (pkg-config files which specify things that don't work for
> static is a common one).
>
> So we could put in a lot of checking of "is what pkg-config
> tells us broken". Or we could just say "we don't support static
> linking for anything except the usermode binaries". We
> should probably phase in deprecation of that because it's
> possible somebody's using it seriously, but it seems like
> a fairly weird thing to do to me.
>
> I share his view on this (restricting static linking to qemu-user)
> but since the work was already done when I read his comment, I still
> send the v2.
Alex, any comment?
Patch #1 could go via trivial@, the other should be made obsolete by the
Paolo's switch to Meson.
> Since v1:
> - pkg-config already use the '--static' argument, do not add it twice
> - Fixed x86_64 host builds (was missing GTK and OpenGL patches)
> - Added Niels R-b tag on the first patch
> - The Travis-CI job now succeeds:
> https://travis-ci.org/philmd/qemu/jobs/545653697 (6 min 7 sec)
>
> Regards,
>
> Phil.
>
> Philippe Mathieu-Daudé (9):
> configure: Only generate GLUSTERFS variables if glusterfs is usable
> configure: Link test before auto-enabling GlusterFS libraries
> configure: Link test before auto-enabling libusb library
> configure: Link test before auto-enabling libusbredir library
> configure: Link test before auto-enabling PulseAudio library
> configure: Link test before auto-enabling OpenGL libraries
> configure: Link test before auto-enabling GTK libraries
> tests/docker: Kludge for missing libunistring.so symlink on Ubuntu
> 18.04
> .travis.yml: Test softmmu static linking
>
> .travis.yml | 5 +
> configure | 121 ++++++++++++++++-----
> tests/docker/dockerfiles/ubuntu1804.docker | 4 +
> 3 files changed, 100 insertions(+), 30 deletions(-)
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH v2 1/9] configure: Only generate GLUSTERFS variables if glusterfs is usable
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 1/9] configure: Only generate GLUSTERFS variables if glusterfs is usable Philippe Mathieu-Daudé
@ 2019-07-01 14:29 ` Daniel P. Berrangé
0 siblings, 0 replies; 14+ messages in thread
From: Daniel P. Berrangé @ 2019-07-01 14:29 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Fam Zheng, Peter Maydell, Thomas Huth, qemu-block,
Michael Tokarev, qemu-devel, Bharata B Rao, Gerd Hoffmann,
Paolo Bonzini, Alex Bennée, Niels de Vos
On Fri, Jun 14, 2019 at 12:07:10PM +0200, Philippe Mathieu-Daudé wrote:
> It is pointless and confusing to have GLUSTERFS variables
> in config-host.mak when glusterfs is not usable.
>
> Reviewed-by: Niels de Vos <ndevos@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> configure | 36 ++++++++++++++++++------------------
> 1 file changed, 18 insertions(+), 18 deletions(-)
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 :|
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
` (9 preceding siblings ...)
2019-07-01 14:08 ` [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
@ 2019-07-01 14:36 ` Daniel P. Berrangé
2019-07-01 14:43 ` Philippe Mathieu-Daudé
10 siblings, 1 reply; 14+ messages in thread
From: Daniel P. Berrangé @ 2019-07-01 14:36 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Fam Zheng, Peter Maydell, Thomas Huth, qemu-block,
Michael Tokarev, qemu-devel, Bharata B Rao, Gerd Hoffmann,
Paolo Bonzini, Alex Bennée, Niels de Vos
On Fri, Jun 14, 2019 at 12:07:09PM +0200, Philippe Mathieu-Daudé wrote:
> Hi,
>
> Apparently QEMU static linking is slowly bitroting. Obviously it
> depends the libraries an user has installed, anyway it seems there
> are not much testing done.
Bitrotting implies that it actually worked in the first place.
AFAIK, configure has never been capable of auto-enabling the
correct set of libraries for static linking, if you have the
equiv dyn libraries present.
I always assumed that anyone who is static loinking QEMU is
passing a big long list of --disable-XXXX args to turn off
all the 3rd party libs for which they don't have a static
build present.
> This series fixes few issues, enough to build QEMU on a Ubuntu
> 18.04 host.
>
> Peter commented on v1:
>
> The main reason for supporting static linking is so we can build
> the user-mode emulators. Almost always the problems with
> static linking the softmmu binaries and the tools are
> issues with the distro's packaging of the static libraries
> (pkg-config files which specify things that don't work for
> static is a common one).
>
> So we could put in a lot of checking of "is what pkg-config
> tells us broken". Or we could just say "we don't support static
> linking for anything except the usermode binaries". We
> should probably phase in deprecation of that because it's
> possible somebody's using it seriously, but it seems like
> a fairly weird thing to do to me.
>
> I share his view on this (restricting static linking to qemu-user)
> but since the work was already done when I read his comment, I still
> send the v2.
I share Peter's view that we ought to restrict static linking to be
allowed exclusively for user-mode-only builds of QEMU. This is a use
case with a compelling reason to need static builds. It is not bitrotting
as the main distros all do a static user-mode only QEMU build, alongside
the main everything, fully dynamic build.
Static builds of system emulators & other tools get essentially no
testing by developers, distros, or our CI systems. If they do work
it is largely by luck, and likely requires the user to pass many
--disable-XXX flags. While your patches do make configure a bit
nicer in this respect, if we're going to deprecate static builds
of non-user-mode parts, then making static builds easier feels
undesirable.
Lets just get a deprecation warning in right now for this imminent
release.
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] 14+ messages in thread
* Re: [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking
2019-07-01 14:36 ` Daniel P. Berrangé
@ 2019-07-01 14:43 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-07-01 14:43 UTC (permalink / raw)
To: Daniel P. Berrangé
Cc: Fam Zheng, Peter Maydell, Thomas Huth, qemu-block,
Michael Tokarev, qemu-devel, Bharata B Rao, Gerd Hoffmann,
Paolo Bonzini, Alex Bennée, Niels de Vos
On 7/1/19 4:36 PM, Daniel P. Berrangé wrote:
> On Fri, Jun 14, 2019 at 12:07:09PM +0200, Philippe Mathieu-Daudé wrote:
>> Hi,
>>
>> Apparently QEMU static linking is slowly bitroting. Obviously it
>> depends the libraries an user has installed, anyway it seems there
>> are not much testing done.
>
> Bitrotting implies that it actually worked in the first place.
>
> AFAIK, configure has never been capable of auto-enabling the
> correct set of libraries for static linking, if you have the
> equiv dyn libraries present.
>
> I always assumed that anyone who is static loinking QEMU is
> passing a big long list of --disable-XXXX args to turn off
> all the 3rd party libs for which they don't have a static
> build present.
>
>> This series fixes few issues, enough to build QEMU on a Ubuntu
>> 18.04 host.
>>
>> Peter commented on v1:
>>
>> The main reason for supporting static linking is so we can build
>> the user-mode emulators. Almost always the problems with
>> static linking the softmmu binaries and the tools are
>> issues with the distro's packaging of the static libraries
>> (pkg-config files which specify things that don't work for
>> static is a common one).
>>
>> So we could put in a lot of checking of "is what pkg-config
>> tells us broken". Or we could just say "we don't support static
>> linking for anything except the usermode binaries". We
>> should probably phase in deprecation of that because it's
>> possible somebody's using it seriously, but it seems like
>> a fairly weird thing to do to me.
>>
>> I share his view on this (restricting static linking to qemu-user)
>> but since the work was already done when I read his comment, I still
>> send the v2.
>
> I share Peter's view that we ought to restrict static linking to be
> allowed exclusively for user-mode-only builds of QEMU. This is a use
> case with a compelling reason to need static builds. It is not bitrotting
> as the main distros all do a static user-mode only QEMU build, alongside
> the main everything, fully dynamic build.
>
> Static builds of system emulators & other tools get essentially no
> testing by developers, distros, or our CI systems. If they do work
> it is largely by luck, and likely requires the user to pass many
> --disable-XXX flags. While your patches do make configure a bit
> nicer in this respect, if we're going to deprecate static builds
> of non-user-mode parts, then making static builds easier feels
> undesirable.
OK, I agree then.
>
> Lets just get a deprecation warning in right now for this imminent
> release.
>
> Regards,
> Daniel
>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2019-07-01 14:52 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 1/9] configure: Only generate GLUSTERFS variables if glusterfs is usable Philippe Mathieu-Daudé
2019-07-01 14:29 ` Daniel P. Berrangé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 2/9] configure: Link test before auto-enabling GlusterFS libraries Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 3/9] configure: Link test before auto-enabling libusb library Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 4/9] configure: Link test before auto-enabling libusbredir library Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 5/9] configure: Link test before auto-enabling PulseAudio library Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 6/9] configure: Link test before auto-enabling OpenGL libraries Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 7/9] configure: Link test before auto-enabling GTK libraries Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 8/9] tests/docker: Kludge for missing libunistring.so symlink on Ubuntu 18.04 Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 9/9] .travis.yml: Test softmmu static linking Philippe Mathieu-Daudé
2019-07-01 14:08 ` [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
2019-07-01 14:36 ` Daniel P. Berrangé
2019-07-01 14:43 ` Philippe Mathieu-Daudé
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).