From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIL0G-0001sa-EM for qemu-devel@nongnu.org; Tue, 25 Feb 2014 11:37:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WIL0B-0004wT-3G for qemu-devel@nongnu.org; Tue, 25 Feb 2014 11:37:08 -0500 Received: from mail-ee0-x230.google.com ([2a00:1450:4013:c00::230]:62798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIL0A-0004wA-Rh for qemu-devel@nongnu.org; Tue, 25 Feb 2014 11:37:03 -0500 Received: by mail-ee0-f48.google.com with SMTP id c13so1209052eek.7 for ; Tue, 25 Feb 2014 08:37:02 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 25 Feb 2014 17:36:55 +0100 Message-Id: <1393346215-5636-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] modules: do not include gmodule-2.0 in static builds List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org gmodule-2.0's pkg-config files include -Wl,--export-dynamic, which breaks static builds. It is a glib bug, but we need to support --static builds for the linux-user targets, and in the end all that is needed to fix this is: * outlaw --enable-modules --static, which makes little sense anyway * only include gmodule-2.0's cflags and ldflags if --enable-modules is specified on the command line. Reported-by: Peter Maydell Signed-off-by: Paolo Bonzini --- configure | 9 ++++++++- util/module.c | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 2735f9a..423f435 100755 --- a/configure +++ b/configure @@ -1424,6 +1424,9 @@ if compile_prog "-Werror -fno-gcse" "" ; then fi if test "$static" = "yes" ; then + if test "$modules" = "yes" ; then + error_exit "static and modules are mutually incompatible" + fi if test "$pie" = "yes" ; then error_exit "static and pie are mutually incompatible" else @@ -2483,8 +2486,12 @@ if test "$mingw32" = yes; then else glib_req_ver=2.12 fi +glib_modules=gthread-2.0 +if test "$modules" = yes; then + glib_modules="$glib_modules gmodule-2.0" +fi -for i in gthread-2.0 gmodule-2.0; do +for i in $glib_modules; do if $pkg_config --atleast-version=$glib_req_ver $i; then glib_cflags=`$pkg_config --cflags $i` glib_libs=`$pkg_config --libs $i` diff --git a/util/module.c b/util/module.c index 42bc373..dc08c16 100644 --- a/util/module.c +++ b/util/module.c @@ -14,7 +14,9 @@ */ #include +#ifdef CONFIG_MODULES #include +#endif #include "qemu-common.h" #include "qemu/queue.h" #include "qemu/module.h" -- 1.8.3.1