From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>, "Thomas Huth" <thuth@redhat.com>,
integration@gluster.org,
"Daniel P. Berrangé" <berrange@redhat.com>,
qemu-block@nongnu.org, "Loïc Minier" <loic.minier@linaro.org>,
"Michael Tokarev" <mjt@tls.msk.ru>,
"Bharata B Rao" <bharata@linux.ibm.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Niels de Vos" <ndevos@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/6] configure: Link test before auto-enabling glusterfs libraries
Date: Fri, 14 Jun 2019 10:40:32 +0200 [thread overview]
Message-ID: <0855a9ee-631b-29e6-cafa-7b7d988cbf1b@redhat.com> (raw)
In-Reply-To: <20190614072432.820-3-philmd@redhat.com>
On 6/14/19 9:24 AM, Philippe Mathieu-Daudé wrote:
> 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 | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 13fd4a1166..3428adb75b 100755
> --- a/configure
> +++ b/configure
> @@ -4179,9 +4179,23 @@ 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)
> + if test "$static" = "yes"; then
> + glusterfs_libs=$($pkg_config --libs --static glusterfs-api)
> + else
> + glusterfs_libs=$($pkg_config --libs glusterfs-api)
> + fi
I just noticed in ./configure:
case "$opt" in
--static)
static="yes"
LDFLAGS="-static $LDFLAGS"
QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS"
;;
And
pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
query_pkg_config() {
"${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@"
}
pkg_config=query_pkg_config
So I shouldn't need to test "$static" = "yes" and manually add --static.
(same apply to other patches in this series).
I'll see what's wrong...
> + # 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
>
next prev parent reply other threads:[~2019-06-14 8:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-14 7:24 [Qemu-devel] [PATCH 0/6] configure: Try to fix --static linking Philippe Mathieu-Daudé
2019-06-14 7:24 ` [Qemu-devel] [PATCH 1/6] configure: Only generate GLUSTERFS variables if glusterfs is usable Philippe Mathieu-Daudé
2019-06-14 7:43 ` Niels de Vos
2019-06-14 7:24 ` [Qemu-devel] [PATCH 2/6] configure: Link test before auto-enabling glusterfs libraries Philippe Mathieu-Daudé
2019-06-14 8:40 ` Philippe Mathieu-Daudé [this message]
2019-06-14 7:24 ` [Qemu-devel] [PATCH 3/6] configure: Link test before auto-enabling the libusb library Philippe Mathieu-Daudé
2019-06-14 7:24 ` [Qemu-devel] [PATCH 4/6] configure: Link test before auto-enabling the libusbredir library Philippe Mathieu-Daudé
2019-06-14 7:24 ` [Qemu-devel] [PATCH 5/6] configure: Link test before auto-enabling the pulseaudio library Philippe Mathieu-Daudé
2019-06-14 7:24 ` [Qemu-devel] [PATCH 6/6] .travis.yml: Test static linking Philippe Mathieu-Daudé
2019-06-14 14:03 ` Alex Bennée
2019-06-14 8:48 ` [Qemu-devel] [PATCH 0/6] configure: Try to fix --static linking Philippe Mathieu-Daudé
2019-06-14 8:53 ` Peter Maydell
2019-06-14 13:58 ` Alex Bennée
2019-06-14 14:30 ` Peter Maydell
2019-06-14 15:17 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0855a9ee-631b-29e6-cafa-7b7d988cbf1b@redhat.com \
--to=philmd@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=bharata@linux.ibm.com \
--cc=fam@euphon.net \
--cc=integration@gluster.org \
--cc=kraxel@redhat.com \
--cc=loic.minier@linaro.org \
--cc=mjt@tls.msk.ru \
--cc=ndevos@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).