From nobody Thu May 2 23:19:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611066737; cv=none; d=zohomail.com; s=zohoarc; b=lovFyUQJXPtll0dP+owCxY0kjzngNjtH10OAlWIAjp4rApPuvPoN2STyM7QrUIKcF3ZV6z0K4aWuWMDj6D9F1bYlE7Oo0xw6Iy5rDK1nwRpUWpEO15FSLOaInWqEvvugabTqK14vBGONixdegh5p31FdB4AzomdkKSnROOkG3iM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611066737; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=0YUI3OWKcE7B9PF9NVC69zqgGZLZdjxngYv9U5qN19E=; b=kP47qTraqUhAEU+eORMRFi8WEv2C0AW0zQR3wy4YGuAbuO7WrNMSOvRZHBBMmg6nr1jY7kCEo4yO6nc6+7rwUQymS7g18Hy7ulOdmtgzF97sbF+3HAJxwy8+0GScmeQtJF/70DC7KOx5XJJeK9OhLOOf/LuE9/AzEJBmXlBkhOY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1611066737246719.9577983892505; Tue, 19 Jan 2021 06:32:17 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-550-aWkoWuQ5P4CP085sMa-3qg-1; Tue, 19 Jan 2021 09:32:14 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2E5A800D62; Tue, 19 Jan 2021 14:32:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C98E5DA2D; Tue, 19 Jan 2021 14:32:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A00CF180954D; Tue, 19 Jan 2021 14:32:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10JEW3lk021082 for ; Tue, 19 Jan 2021 09:32:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id 74C2B36FA; Tue, 19 Jan 2021 14:32:03 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.40.193.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 42EC960C5A for ; Tue, 19 Jan 2021 14:31:59 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 19F97244611; Tue, 19 Jan 2021 15:31:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611066736; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0YUI3OWKcE7B9PF9NVC69zqgGZLZdjxngYv9U5qN19E=; b=OcNFO0/8cp/RVhkUCcULcoO/VixlK68yXrXG/7SgT0ag3BePaeK1kNeTUsofDzop8yZauG 4AK2heAVlNK7wKeTIiH+slG7cmG/cm2DNX7nwgu1yJapT0UGLwmzJdK/ID4YEPwOu58200 m+IDB6VrBKj01vL5dBw7VpP0R++DOOg= X-MC-Unique: aWkoWuQ5P4CP085sMa-3qg-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH v2] meson: Fix build with -Dtest_coverage=true Date: Tue, 19 Jan 2021 15:31:56 +0100 Message-Id: <88d9df7f3831c925abc97be29d161815e7929873.1611066700.git.jdenemar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" As can be seen in commit 8a62a1592ae00eab4eb153c02661e56b9d8d9032 (from autoconf era), the coverage flags have to be used also when linking objects. However, this was not reflected when we switched to meson. Without this patch linking fails with undefined references to various __gcov_* symbols. Signed-off-by: Jiri Denemark Reviewed-by: Pavel Hrdina --- tests/meson.build | 8 ++++---- tools/nss/meson.build | 2 ++ tools/wireshark/src/meson.build | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index f1d91ca50d..23255dd62a 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -26,7 +26,10 @@ tests_dep =3D declare_dependency( top_inc_dir, util_inc_dir, ], - link_args: libvirt_export_dynamic, + link_args: ( + libvirt_export_dynamic + + coverage_flags + ), ) =20 tests_env =3D [ @@ -228,9 +231,6 @@ executable( dependencies: [ tests_dep, ], - link_args: [ - coverage_flags, - ], ) =20 =20 diff --git a/tools/nss/meson.build b/tools/nss/meson.build index cf3eec9b24..198936f3d4 100644 --- a/tools/nss/meson.build +++ b/tools/nss/meson.build @@ -66,6 +66,7 @@ nss_libvirt_lib =3D shared_module( link_args: [ nss_libvirt_syms, libvirt_export_dynamic, + coverage_flags, ], link_whole: [ nss_libvirt_impl, @@ -81,6 +82,7 @@ nss_libvirt_guest_lib =3D shared_library( link_args: [ nss_libvirt_guest_syms, libvirt_export_dynamic, + coverage_flags, ], link_whole: [ nss_libvirt_guest_impl, diff --git a/tools/wireshark/src/meson.build b/tools/wireshark/src/meson.bu= ild index 49ccc9bb86..9b452dc5ca 100644 --- a/tools/wireshark/src/meson.build +++ b/tools/wireshark/src/meson.build @@ -12,6 +12,9 @@ shared_library( xdr_dep, tools_dep, ], + link_args: [ + coverage_flags + ], install: true, install_dir: wireshark_plugindir, ) --=20 2.30.0