From nobody Wed Apr 24 03:31:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.74 as permitted sender) client-ip=170.10.129.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.74 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=1651767078; cv=none; d=zohomail.com; s=zohoarc; b=JWUOIxR+51N7nQoyet6mp7RZOmqVDoOOirxXW/cy5rifwN/bYT+MyWoO6vWeU5oQiyQY+VCW0Dg5DMi+QWSMXzXNNWf6rrVJlC1EVeH86bBPJltyLFlibbiSj+AqyHrRNwWPhCdPRtQTpIAbNyIof+I7paywLJsXL00FuuFNArI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651767078; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IuJMDd2P+trP0QlMwjdLnLf5YTb6vfzKE8lDLP5i/zc=; b=b372dlbFk5j7lCa6psL3ObKsj6Nzhfw+XJHJ3yVwW9Jto374hbVfZzkfrwn3tN3hhtaHTNNQsX+2MeMEYwh+nxMDIe+x6wIaX/YRyB0mXGzV9C12RjVBzjQqZDeWhu/Gz3evmm1vtUEf8TDry920a2vwH3BSc06EqhCUX/kD3es= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.129.74]) by mx.zohomail.com with SMTPS id 1651767078920796.5792131848675; Thu, 5 May 2022 09:11:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-299-GX7O14kJMReJCwIFqv86DA-1; Thu, 05 May 2022 12:11:16 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8E8AC3C02B79; Thu, 5 May 2022 16:11:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7987840CF900; Thu, 5 May 2022 16:11:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 16B6E1947046; Thu, 5 May 2022 16:11:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D4F3D1947043 for ; Thu, 5 May 2022 16:11:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 86C087AEB; Thu, 5 May 2022 16:11:11 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.193.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5FE17B64 for ; Thu, 5 May 2022 16:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651767077; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=IuJMDd2P+trP0QlMwjdLnLf5YTb6vfzKE8lDLP5i/zc=; b=B1oi+rXx9ktL7CVA22w+FRQwN0O/3hdzWvgBm44zB2IdawfRnfr+XwF3yYUC259TrRlMBR 0uHVH26yyAjk3zzo42UuGnqvgpdM/btrNQCNqM9uT7OrXZ95O739TU1MzPeFbjN8lhdSnN lKraW5OdgQ0GR+MDhE8FTU2ucnkwkgg= X-MC-Unique: GX7O14kJMReJCwIFqv86DA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] meson: Refactor handling of link_args and link_depends Date: Thu, 5 May 2022 18:10:58 +0200 Message-Id: <20220505161100.418597-2-abologna@redhat.com> In-Reply-To: <20220505161100.418597-1-abologna@redhat.com> References: <20220505161100.418597-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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) X-ZM-MESSAGEID: 1651767079861100002 Content-Type: text/plain; charset="utf-8" This ensures variable names and the overall structure of the code setting and using them is consistent. It will also make upcoming changes less disruptive. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- src/admin/meson.build | 20 ++++++-- src/meson.build | 104 ++++++++++++++++++++++-------------------- tools/nss/meson.build | 42 +++++++++-------- 3 files changed, 94 insertions(+), 72 deletions(-) diff --git a/src/admin/meson.build b/src/admin/meson.build index 130997fb87..cacd6feb25 100644 --- a/src/admin/meson.build +++ b/src/admin/meson.build @@ -72,7 +72,7 @@ libvirt_admin_syms =3D custom_target( '@OUTPUT@', 'LIBVIRT_ADMIN_PRIVATE_' + meson.project_version(), '@INPU= T@', ], ) -libvirt_admin_syms_file =3D libvirt_admin_syms + if host_machine.system() =3D=3D 'windows' libvirt_admin_def =3D custom_target( 'libvirt_admin.def', @@ -84,12 +84,22 @@ if host_machine.system() =3D=3D 'windows' ], ) libvirt_admin_syms_file =3D libvirt_admin_def + libvirt_admin_syms_path =3D libvirt_admin_syms_file.full_path() +else + libvirt_admin_syms_file =3D libvirt_admin_syms + libvirt_admin_syms_path =3D libvirt_admin_syms_file.full_path() endif =20 -libvirt_admin_syms_flags =3D '@0@@1@'.format( - version_script_flags, - libvirt_admin_syms_file.full_path(), -) +libvirt_admin_link_args =3D [ + libvirt_nodelete, + '@0@@1@'.format( + version_script_flags, + libvirt_admin_syms_path, + ), +] +libvirt_admin_link_depends =3D [ + libvirt_admin_syms_file, +] =20 if conf.has('WITH_REMOTE') admin_driver_lib =3D static_library( diff --git a/src/meson.build b/src/meson.build index 10165ba5ac..ca0e756e5c 100644 --- a/src/meson.build +++ b/src/meson.build @@ -354,7 +354,7 @@ libvirt_syms =3D custom_target( '@OUTPUT@', 'LIBVIRT_PRIVATE_' + meson.project_version(), '@INPUT@', ], ) -libvirt_syms_file =3D libvirt_syms + if host_machine.system() =3D=3D 'windows' libvirt_def =3D custom_target( 'libvirt.def', @@ -366,15 +366,27 @@ if host_machine.system() =3D=3D 'windows' ], ) libvirt_syms_file =3D libvirt_def + libvirt_syms_path =3D libvirt_syms_file.full_path() +else + libvirt_syms_file =3D libvirt_syms + libvirt_syms_path =3D libvirt_syms_file.full_path() endif =20 =20 # libvirt.so library =20 -libvirt_syms_flags =3D '@0@@1@'.format( - version_script_flags, - libvirt_syms_file.full_path(), -) +libvirt_link_args =3D [ + libvirt_flat_namespace, + libvirt_no_undefined, + libvirt_nodelete, + '@0@@1@'.format( + version_script_flags, + libvirt_syms_path, + ), +] +libvirt_link_depends =3D [ + libvirt_syms_file, +] =20 libvirt_lib =3D shared_library( 'virt', @@ -382,18 +394,11 @@ libvirt_lib =3D shared_library( dependencies: [ src_dep, ], - link_args: [ - libvirt_flat_namespace, - libvirt_no_undefined, - libvirt_nodelete, - libvirt_syms_flags, - ], + link_args: libvirt_link_args, link_whole: [ libvirt_libs, ], - link_depends: [ - libvirt_syms_file, - ], + link_depends: libvirt_link_depends, install: true, version: libvirt_lib_version, soversion: libvirt_so_version, @@ -403,8 +408,7 @@ libvirt_lib =3D shared_library( # libvirt-qemu.syms symbol files =20 libvirt_qemu_syms =3D meson.current_source_dir() / 'libvirt_qemu.syms' -libvirt_qemu_syms_file =3D libvirt_qemu_syms -libvirt_qemu_syms_path =3D libvirt_qemu_syms + if host_machine.system() =3D=3D 'windows' libvirt_qemu_def =3D custom_target( 'libvirt_qemu.def', @@ -416,16 +420,25 @@ if host_machine.system() =3D=3D 'windows' ], ) libvirt_qemu_syms_file =3D libvirt_qemu_def - libvirt_qemu_syms_path =3D libvirt_qemu_def.full_path() + libvirt_qemu_syms_path =3D libvirt_qemu_syms_file.full_path() +else + libvirt_qemu_syms_file =3D libvirt_qemu_syms + libvirt_qemu_syms_path =3D libvirt_qemu_syms endif =20 =20 # libvirt-qemu.so =20 -libvirt_qemu_syms_flags =3D '@0@@1@'.format( - version_script_flags, - libvirt_qemu_syms_path, -) +libvirt_qemu_link_args =3D [ + libvirt_nodelete, + '@0@@1@'.format( + version_script_flags, + libvirt_qemu_syms_path, + ), +] +libvirt_qemu_link_depends =3D [ + libvirt_qemu_syms_file, +] =20 libvirt_qemu_sources =3D files( 'libvirt-qemu.c', @@ -437,16 +450,11 @@ libvirt_qemu_lib =3D shared_library( dependencies: [ src_dep, ], - link_args: [ - libvirt_nodelete, - libvirt_qemu_syms_flags, - ], + link_args: libvirt_qemu_link_args, link_with: [ libvirt_lib, ], - link_depends: [ - libvirt_qemu_syms_file, - ], + link_depends: libvirt_qemu_link_depends, install: true, install_rpath: libvirt_rpath, version: libvirt_lib_version, @@ -457,8 +465,7 @@ libvirt_qemu_lib =3D shared_library( # libvirt-lxc.so symbol files =20 libvirt_lxc_syms =3D meson.current_source_dir() / 'libvirt_lxc.syms' -libvirt_lxc_syms_file =3D libvirt_lxc_syms -libvirt_lxc_syms_path =3D libvirt_lxc_syms + if host_machine.system() =3D=3D 'windows' libvirt_lxc_def =3D custom_target( 'libvirt_lxc.def', @@ -470,16 +477,25 @@ if host_machine.system() =3D=3D 'windows' ], ) libvirt_lxc_syms_file =3D libvirt_lxc_def - libvirt_lxc_syms_path =3D libvirt_lxc_def.full_path() + libvirt_lxc_syms_path =3D libvirt_lxc_syms_file.full_path() +else + libvirt_lxc_syms_file =3D libvirt_lxc_syms + libvirt_lxc_syms_path =3D libvirt_lxc_syms endif =20 =20 # libvirt-lxc.so =20 -libvirt_lxc_syms_flags =3D '@0@@1@'.format( - version_script_flags, - libvirt_lxc_syms_path, -) +libvirt_lxc_link_args =3D [ + libvirt_nodelete, + '@0@@1@'.format( + version_script_flags, + libvirt_lxc_syms_path, + ), +] +libvirt_lxc_link_depends =3D [ + libvirt_lxc_syms_file, +] =20 libvirt_lxc_sources =3D files( 'libvirt-lxc.c', @@ -493,16 +509,11 @@ libvirt_lxc_lib =3D shared_library( selinux_dep, src_dep, ], - link_args: [ - libvirt_nodelete, - libvirt_lxc_syms_flags, - ], + link_args: libvirt_lxc_link_args, link_with: [ libvirt_lib, ], - link_depends: [ - libvirt_lxc_syms_file, - ], + link_depends: libvirt_lxc_link_depends, install: true, install_rpath: libvirt_rpath, version: libvirt_lib_version, @@ -537,16 +548,11 @@ if conf.has('WITH_REMOTE') admin_inc_dir, remote_inc_dir, ], - link_args: [ - libvirt_admin_syms_flags, - libvirt_nodelete, - ], + link_args: libvirt_admin_link_args, link_with: [ libvirt_lib, ], - link_depends: [ - libvirt_admin_syms_file, - ], + link_depends: libvirt_admin_link_depends, install: true, install_rpath: libvirt_rpath, version: libvirt_lib_version, diff --git a/tools/nss/meson.build b/tools/nss/meson.build index f77309ebca..c827b865b3 100644 --- a/tools/nss/meson.build +++ b/tools/nss/meson.build @@ -49,25 +49,23 @@ nss_libvirt_guest_impl =3D static_library( ], ) =20 -nss_libvirt_syms =3D '@0@@1@'.format( - version_script_flags, - meson.current_source_dir() / nss_sym_file, -) +nss_libvirt_syms_file =3D meson.current_source_dir() / nss_sym_file +nss_libvirt_syms_path =3D nss_libvirt_syms_file =20 -nss_libvirt_guest_syms =3D '@0@@1@'.format( - version_script_flags, - meson.current_source_dir() / nss_guest_sym_file, -) +nss_libvirt_link_args =3D [ + libvirt_export_dynamic, + coverage_flags, + '@0@@1@'.format( + version_script_flags, + nss_libvirt_syms_path, + ), +] =20 nss_libvirt_lib =3D shared_library( 'nss_libvirt', name_prefix: nss_prefix, name_suffix: 'so.@0@'.format(nss_so_ver), - link_args: [ - nss_libvirt_syms, - libvirt_export_dynamic, - coverage_flags, - ], + link_args: nss_libvirt_link_args, link_whole: [ nss_libvirt_impl, ], @@ -75,15 +73,23 @@ nss_libvirt_lib =3D shared_library( install_dir: libdir, ) =20 +nss_libvirt_guest_syms_file =3D meson.current_source_dir() / nss_guest_sym= _file +nss_libvirt_guest_syms_path =3D nss_libvirt_guest_syms_file + +nss_libvirt_guest_link_args =3D [ + libvirt_export_dynamic, + coverage_flags, + '@0@@1@'.format( + version_script_flags, + nss_libvirt_guest_syms_path, + ), +] + nss_libvirt_guest_lib =3D shared_library( 'nss_libvirt_guest', name_prefix: nss_prefix, name_suffix: 'so.@0@'.format(nss_so_ver), - link_args: [ - nss_libvirt_guest_syms, - libvirt_export_dynamic, - coverage_flags, - ], + link_args: nss_libvirt_guest_link_args, link_whole: [ nss_libvirt_guest_impl, ], --=20 2.35.1 From nobody Wed Apr 24 03:31:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.74 as permitted sender) client-ip=170.10.133.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.74 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=1651767087; cv=none; d=zohomail.com; s=zohoarc; b=g8/TAk9rGDQ5GYwQzytiW/SkkjHdV7t8hdS6iRTAWWzRSfErp9HX30/y480vopa7G24Wj/x+/7Wuz3NB/qSpuK8FqAPZ/AczUQ/Pzp/WLrJE8wvxWxMu208JkWgzF2J3bZPEunilq4/Ll8gPXQHMtAVAraem2pKCqIJJa4JNnGg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651767087; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8pFUGlovvr8Q+aruXmH1NTLsT1vqJHZ6UBiVroupZs4=; b=D+bJskfKich6as1oAGlHlGP06wq+vBZAyYbvMeEQSUNSyVrsHJdGkwLZDx+Y9lHzMNgjt3uVSH4FQm6Pp8OP2rJWawodJ+8jaaZzwIWx4yagbq4954Wa+FWGabtMz0N07wdBXTT6qTSq+1VSzree0JwCXgZVeRM+IJ28q2Jvg0c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.133.74]) by mx.zohomail.com with SMTPS id 1651767087184275.54357233286385; Thu, 5 May 2022 09:11:27 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-516-SXS4u51_OD-_jqFnTSEFWg-1; Thu, 05 May 2022 12:11:22 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 47FC83C02B79; Thu, 5 May 2022 16:11:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32551C28119; Thu, 5 May 2022 16:11:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B467F1947047; Thu, 5 May 2022 16:11:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5F4AB1947043 for ; Thu, 5 May 2022 16:11:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2F5267AEB; Thu, 5 May 2022 16:11:18 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.193.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B3310BC86 for ; Thu, 5 May 2022 16:11:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651767086; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=8pFUGlovvr8Q+aruXmH1NTLsT1vqJHZ6UBiVroupZs4=; b=N2xEyju6UY/TRKhV6Zwj015URs6EakGMBI8xNMvw2hsWyBZ2tEI7kSArK8nfe7L28BIGHy ROMPjHBT4AxSlsrsX2Ll6ZwmcMSIWgQRMLOP+CxOOiE5u/43n7uXwoV2wLjADJ+GcXH54i Q+gruIecBdb6Zf7S8PnNueNLpClauJ8= X-MC-Unique: SXS4u51_OD-_jqFnTSEFWg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] meson: Don't attempt to use version scripts on macOS Date: Thu, 5 May 2022 18:10:59 +0200 Message-Id: <20220505161100.418597-3-abologna@redhat.com> In-Reply-To: <20220505161100.418597-1-abologna@redhat.com> References: <20220505161100.418597-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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) X-ZM-MESSAGEID: 1651767087817100001 Content-Type: text/plain; charset="utf-8" macOS libraries don't support symbol versioning, so the only result that we achieve by passing additional flags to the linker is a bunch of messages like ld: warning: ignoring file .../libvirt/build/src/libvirt.syms, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x23 0x20 0x57 0x41 ... ) being produced during the build. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- meson.build | 3 +++ src/admin/meson.build | 14 ++++++++------ src/meson.build | 42 ++++++++++++++++++++++++------------------ tools/nss/meson.build | 18 ++++++++++++------ 4 files changed, 47 insertions(+), 30 deletions(-) diff --git a/meson.build b/meson.build index 17cc829543..5787397dcd 100644 --- a/meson.build +++ b/meson.build @@ -510,6 +510,9 @@ libvirt_no_indirect =3D cc.get_supported_link_arguments= ([ =20 if host_machine.system() =3D=3D 'windows' version_script_flags =3D '-Wl,' +elif host_machine.system() =3D=3D 'darwin' + # macOS libraries don't support symbol versioning + version_script_flags =3D '' else test_file =3D '@0@/src/libvirt_qemu.syms'.format(meson.source_root()) if cc.has_link_argument('-Wl,--version-script=3D@0@'.format(test_file)) diff --git a/src/admin/meson.build b/src/admin/meson.build index cacd6feb25..692cc128a3 100644 --- a/src/admin/meson.build +++ b/src/admin/meson.build @@ -92,14 +92,16 @@ endif =20 libvirt_admin_link_args =3D [ libvirt_nodelete, - '@0@@1@'.format( +] +libvirt_admin_link_depends =3D [] + +if version_script_flags !=3D '' + libvirt_admin_link_args +=3D '@0@@1@'.format( version_script_flags, libvirt_admin_syms_path, - ), -] -libvirt_admin_link_depends =3D [ - libvirt_admin_syms_file, -] + ) + libvirt_admin_link_depends +=3D libvirt_admin_syms_file +endif =20 if conf.has('WITH_REMOTE') admin_driver_lib =3D static_library( diff --git a/src/meson.build b/src/meson.build index ca0e756e5c..88a6f15760 100644 --- a/src/meson.build +++ b/src/meson.build @@ -379,14 +379,16 @@ libvirt_link_args =3D [ libvirt_flat_namespace, libvirt_no_undefined, libvirt_nodelete, - '@0@@1@'.format( +] +libvirt_link_depends =3D [] + +if version_script_flags !=3D '' + libvirt_link_args +=3D '@0@@1@'.format( version_script_flags, libvirt_syms_path, - ), -] -libvirt_link_depends =3D [ - libvirt_syms_file, -] + ) + libvirt_link_depends +=3D libvirt_syms_file +endif =20 libvirt_lib =3D shared_library( 'virt', @@ -431,14 +433,16 @@ endif =20 libvirt_qemu_link_args =3D [ libvirt_nodelete, - '@0@@1@'.format( +] +libvirt_qemu_link_depends =3D [] + +if version_script_flags !=3D '' + libvirt_qemu_link_args +=3D '@0@@1@'.format( version_script_flags, libvirt_qemu_syms_path, - ), -] -libvirt_qemu_link_depends =3D [ - libvirt_qemu_syms_file, -] + ) + libvirt_qemu_link_depends +=3D libvirt_qemu_syms_file +endif =20 libvirt_qemu_sources =3D files( 'libvirt-qemu.c', @@ -488,14 +492,16 @@ endif =20 libvirt_lxc_link_args =3D [ libvirt_nodelete, - '@0@@1@'.format( +] +libvirt_lxc_link_depends =3D [] + +if version_script_flags !=3D '' + libvirt_lxc_link_args +=3D '@0@@1@'.format( version_script_flags, libvirt_lxc_syms_path, - ), -] -libvirt_lxc_link_depends =3D [ - libvirt_lxc_syms_file, -] + ) + libvirt_lxc_link_depends +=3D libvirt_lxc_syms_file +endif =20 libvirt_lxc_sources =3D files( 'libvirt-lxc.c', diff --git a/tools/nss/meson.build b/tools/nss/meson.build index c827b865b3..85e2838fb7 100644 --- a/tools/nss/meson.build +++ b/tools/nss/meson.build @@ -55,11 +55,14 @@ nss_libvirt_syms_path =3D nss_libvirt_syms_file nss_libvirt_link_args =3D [ libvirt_export_dynamic, coverage_flags, - '@0@@1@'.format( +] + +if version_script_flags !=3D '' + nss_libvirt_link_args +=3D '@0@@1@'.format( version_script_flags, nss_libvirt_syms_path, - ), -] + ) +endif =20 nss_libvirt_lib =3D shared_library( 'nss_libvirt', @@ -79,11 +82,14 @@ nss_libvirt_guest_syms_path =3D nss_libvirt_guest_syms_= file nss_libvirt_guest_link_args =3D [ libvirt_export_dynamic, coverage_flags, - '@0@@1@'.format( +] + +if version_script_flags !=3D '' + nss_libvirt_guest_link_args +=3D '@0@@1@'.format( version_script_flags, nss_libvirt_guest_syms_path, - ), -] + ) +endif =20 nss_libvirt_guest_lib =3D shared_library( 'nss_libvirt_guest', --=20 2.35.1 From nobody Wed Apr 24 03:31:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.74 as permitted sender) client-ip=170.10.129.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.74 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=1651767125; cv=none; d=zohomail.com; s=zohoarc; b=I2UtbWWzePf3qRnU4NegWuQtEJIHaM1VQSBNOm13pKSqrTS9XpE3Ip9tv53Ak5oQ72Hiiikg/00HzYNZ3NfHQXSKBx+suFvZ4UQCOYQAe2E2hHGUdmOJA1E+FhfRD80VtIqoFG0m0ja7ytpoQQmttUg9Ciz708HVeNPKytofm9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651767125; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0Ees/hMLaFZVmuIAGYt4YSzVFebG/jsDLnaQ1EuElKg=; b=WrrFrmK5DW2ls8EsW36TDRAii8QL5LpOCIKGQak6SVUAkq+qz6T8j8Kas06ufiyeJuFFl9JjXPGQXCU7velrsFZf460UTWtxfrSmGnOFnJzmZ5RqJbT2YHJQQNNvVIWpt50pf1N3nXtZVqPncnC4t6Fb9x6ejLxCb/7pVOKLlao= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.129.74]) by mx.zohomail.com with SMTPS id 1651767125855528.7685048161237; Thu, 5 May 2022 09:12:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-643-WvfJK1ycOrKR7--H_SRnuA-1; Thu, 05 May 2022 12:11:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3CC1018A6585; Thu, 5 May 2022 16:11:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6F5B4010E36; Thu, 5 May 2022 16:11:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5CD791947047; Thu, 5 May 2022 16:11:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 43FE61947043 for ; Thu, 5 May 2022 16:11:28 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 247C79D61; Thu, 5 May 2022 16:11:28 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.193.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A79C89E8B for ; Thu, 5 May 2022 16:11:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651767124; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0Ees/hMLaFZVmuIAGYt4YSzVFebG/jsDLnaQ1EuElKg=; b=TUeNFaqKXKUStZfkYHNA0gC76Xm5oBqWAT1df0Oh7nVmxLNWL/uMgYXPBjnIt+LPumEFrL AJPxzA6ZPQI78HszO8O7RREzTbyvNWL7fqsPEvuCOOyKHK4hTlJDRjh0TIisYpcvHYfiYk WRyLNowLtLnayjSvItNyPoNG21D1s5k= X-MC-Unique: WvfJK1ycOrKR7--H_SRnuA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] meson: Drop support for -Wl,-M Date: Thu, 5 May 2022 18:11:00 +0200 Message-Id: <20220505161100.418597-4-abologna@redhat.com> In-Reply-To: <20220505161100.418597-1-abologna@redhat.com> References: <20220505161100.418597-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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) X-ZM-MESSAGEID: 1651767127818100001 Content-Type: text/plain; charset="utf-8" This was originally introduced in c2fb8bfee309, reportedly to support symbol versioning on Solaris; more recently, 30b301c6eaa9 ported it to meson. Up until the previous commit this has resulted in passing -M .../libvirt/build/src/libvirt.syms to the linker on macOS, but the implementation of the -M option on that platform's linker is literally else if ( strcmp(arg, "-M") =3D=3D 0 ) { // FIX FIX } so in practice we've been providing an additional input file, which the linker understandably ignores after printing a warning since it's not in any format that it recognizes. Considering that LLVM's linker, which is now used by default on FreeBSD, supports the same --version-script option as the GNU linker, that we have introduced special handling for macOS, and that we don't target Solaris, we can simply drop the branch at this point. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- meson.build | 2 -- 1 file changed, 2 deletions(-) diff --git a/meson.build b/meson.build index 5787397dcd..a1c802b00d 100644 --- a/meson.build +++ b/meson.build @@ -517,8 +517,6 @@ else test_file =3D '@0@/src/libvirt_qemu.syms'.format(meson.source_root()) if cc.has_link_argument('-Wl,--version-script=3D@0@'.format(test_file)) version_script_flags =3D '-Wl,--version-script=3D' - elif cc.has_link_argument('-Wl,-M,') - version_script_flags =3D '-Wl,-M,' else error('No supported version script link argument found.') endif --=20 2.35.1