From nobody Tue May 21 01:52:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1601309358; cv=none; d=zohomail.com; s=zohoarc; b=YeP8WqdVbp5asbVinEBv9qfnIY3KtAZDRXyjuERrl2Ld6KCwW+HFIMvmF/qel1DrT6PjyFuB/w5jrllD6a77e/fHVPZ5/6TR3n2ewNRNmvSTVVDMimS27h724lWmK2ycbr1LfHyGNF9hRp6U6dCNR6CJlAX3H+vUakEr09TIhnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601309358; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=1jOZnrxRTG3Vn0Y7sOS02Z9FyMYbuYQPu1NRLX+duSw=; b=gFxTmxRQfbe9Y1lTHQ7WJK2IRR7MTZMGEeItPWLD6MTKWEqO+rh8ISt8e0g65lvrCnYO2Hkatv0jkNkTI+Xj60svwWokUpZf//8D2Q54VwUn5rzbe8R7zMOdgV7rODxm/gGSHn+Ul1MT7EmrqyKcBN2gW9b/GoStmP9AP2MCTi8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601309357984791.2536576784371; Mon, 28 Sep 2020 09:09:17 -0700 (PDT) Received: from localhost ([::1]:43366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMviG-0006In-Dt for importer@patchew.org; Mon, 28 Sep 2020 12:09:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMvdM-0002UZ-NE for qemu-devel@nongnu.org; Mon, 28 Sep 2020 12:04:12 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:39769) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMvdK-0003vZ-6W for qemu-devel@nongnu.org; Mon, 28 Sep 2020 12:04:12 -0400 Received: by mail-wr1-x431.google.com with SMTP id k10so1959874wru.6 for ; Mon, 28 Sep 2020 09:04:08 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id r21sm2420834wrc.70.2020.09.28.09.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2020 09:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1jOZnrxRTG3Vn0Y7sOS02Z9FyMYbuYQPu1NRLX+duSw=; b=tZnoGXl3+47IBn/jurHyNSw25u0qJjmzoYukvCPjke1C4KbtagTFdTISWuzMltvUpH hSWbgyeTI2yvqHQEIEG/sq7myF/84mQRIk+RjesVQZ2stKoj+nlE3Ay8qhiPOHcfJRQ6 dsxHZMGlK6v6ZldcbU6VaVoGL0U4Sbvkxec9FoKg1gOOEjwNsobBb4G0Bdil0zacSSC2 NTckKh6dJtIJRg1E2D+m1zSYXbx9VIFhdrRZom8enAkODNkt+lG0SS9XHEIyzj7GdiAC FkHuPwL1MqscsdQHi/uw94rKwxbcP2BIuwgDyXzr8cU6eIrnlrec3Gt8uskm8sg9minV 1CAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1jOZnrxRTG3Vn0Y7sOS02Z9FyMYbuYQPu1NRLX+duSw=; b=gKCZsrxln6oS/cdtLYeTCJiiHGJoWCLlpLzgKvKTi+72eOAXAc4XlVp4ELNxQwBnVS 4uONlXA50hXfbQgFGiubtauw52+01g91FLgZw75jCsycErRktVuH8QUJj/97r6ylKm4R 8yHlbo7NIzWCLIcY3jv8L42Vs8oVbaRhvPL6fo9LXeVCMRJcPeIbjhNzrZiR7FUkDd7Q cqClrp+h7dS1+WT0nDeIqyySWVUTFf5oYEvqHnCiJJkARdYBlQ57GU/JRfwIbEe+AvP0 vI9p7bhp8U7s2KLUb2RXJqB76ANaC2rxq4NnePZtHpowfq1t5jIIawHhaQ+hA1ZRlKra mIRg== X-Gm-Message-State: AOAM530InteYxdeCmLpdLJynMEYzZYATW/m02ZrJKXBGXgirZNMOsMNN y2lzSMYkyl7PN7yHtAm3zbxP6Zk09GQLRyUZ X-Google-Smtp-Source: ABdhPJxpvZAwQHIJtCkYOaVOE1p4pUU8ySId2SPqatf3EYN6EiAvenMgYHBrx5CdB5ecDnhtl7+TGQ== X-Received: by 2002:adf:ec87:: with SMTP id z7mr2669655wrn.57.1601309045283; Mon, 28 Sep 2020 09:04:05 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH] configure: Test that gio libs from pkg-config work Date: Mon, 28 Sep 2020 17:04:02 +0100 Message-Id: <20200928160402.7961-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" On some hosts (eg Ubuntu Bionic) pkg-config returns a set of libraries for gio-2.0 which don't actually work when compiling statically. (Specifically, the returned library string includes -lmount, but not -lblkid which -lmount depends upon, so linking fails due to missing symbols.) Check that the libraries work, and don't enable gio if they don't, in the same way we do for gnutls. Signed-off-by: Peter Maydell Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- I wanted a statically-linked system emulation binary (which, yes, I know is not really something we support :-)). I got one with suitably liberal use of --disable-foo configure options, and this was the only thing I couldn't work around that way. The patch is needed because there's no --disable-gio. I suppose we could add that instead (or as well)... Possibly meson offers a nicer way to do this, but this was simple and gnutls is doing the check this way already. --- configure | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure b/configure index e8e8e984f24..cd79227d763 100755 --- a/configure +++ b/configure @@ -3762,13 +3762,21 @@ if test "$static" =3D yes && test "$mingw32" =3D ye= s; then fi =20 if $pkg_config --atleast-version=3D$glib_req_ver gio-2.0; then - gio=3Dyes gio_cflags=3D$($pkg_config --cflags gio-2.0) gio_libs=3D$($pkg_config --libs gio-2.0) gdbus_codegen=3D$($pkg_config --variable=3Dgdbus_codegen gio-2.0) if [ ! -x "$gdbus_codegen" ]; then gdbus_codegen=3D fi + # Check that the libraries actually work -- Ubuntu 18.04 ships + # with pkg-config --static --libs data for gio-2.0 that is missing + # -lblkid and will give a link error. + write_c_skeleton + if compile_prog "" "gio_libs" ; then + gio=3Dyes + else + gio=3Dno + fi else gio=3Dno fi --=20 2.20.1