From nobody Sun Feb 8 06:22:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1594894208; cv=none; d=zohomail.com; s=zohoarc; b=Ot9agdL5oFXycmTbihZ2B/a4VPXG7+/Jhl/NoYhzLvP7dmo0FqI+euZFkVnR9EKyN1d2kjC9lJONvMwe+i5NG7QSkiS4XBnVUUpsGHaJlXpCz1+Nn2qm4TPFdEU2Ftr9yia5pcFJ2K1xBpkbmV4+94xOqlruNXyh5YnHBClB/sM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594894208; 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=zoJAfRLapDVc4iEB4LoCCWGsruwdNpsF9kQc8effplo=; b=fMABOpxrHNHgQR4onwuyP5Hds+p1mHaMqo92U9kV4JRLjJ55bGJxL9JLGxYBIcal7q5qV/NjtwvRz/qrlJjvGSl8vOydXo7DF0uvluJ3Hrm7UFTgpE/Eyqt88VIdGR+lKmGNsECB8IPkEWKfKqEmHsd9Dqa6CKWKVovQ6vqokmk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 159489420854916.44414140509093; Thu, 16 Jul 2020 03:10:08 -0700 (PDT) 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-249-1Ijk6ZHlNLqnUmkPYlvK3Q-1; Thu, 16 Jul 2020 06:07:59 -0400 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 A21B68015F7; Thu, 16 Jul 2020 10:07:52 +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 832FD78A5C; Thu, 16 Jul 2020 10:07:52 +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 50CB7180531E; Thu, 16 Jul 2020 10:07:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GA40W6017591 for ; Thu, 16 Jul 2020 06:04:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5E39E2B6DB; Thu, 16 Jul 2020 10:04:00 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC4012DE6B for ; Thu, 16 Jul 2020 10:03:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594894207; 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=zoJAfRLapDVc4iEB4LoCCWGsruwdNpsF9kQc8effplo=; b=O9lnaTadsfx+xeHPxH+WLuei0MDJG9VtJzwQzhKLBagmgbVBjDsVYAp/TuVlYW9C3cg5HN F7HUlwW7GDnHpEyTOlB27WzkLaOMmfofatLJWjrBX10VOVfs4wW6pjLlH0lCz+2JPpefWd tSfgE/VAhjvOFW3O4IhhGSb1jdRwyTY= X-MC-Unique: 1Ijk6ZHlNLqnUmkPYlvK3Q-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 151/351] meson: src: build libvirt.syms and libvirt.def symbol files Date: Thu, 16 Jul 2020 11:56:27 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 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" Signed-off-by: Pavel Hrdina --- m4/virt-win-symbols.m4 | 3 -- src/Makefile.am | 53 +-------------------------- src/access/Makefile.inc.am | 22 ----------- src/access/meson.build | 14 +++++++ src/esx/Makefile.inc.am | 7 ---- src/esx/meson.build | 6 +++ src/meson.build | 75 ++++++++++++++++++++++++++++++++++++++ src/openvz/Makefile.inc.am | 7 ---- src/openvz/meson.build | 6 +++ src/remote/Makefile.inc.am | 6 --- src/remote/meson.build | 6 +++ src/vmware/Makefile.inc.am | 7 ---- src/vmware/meson.build | 6 +++ src/vmx/Makefile.inc.am | 7 ---- src/vmx/meson.build | 6 +++ 15 files changed, 120 insertions(+), 111 deletions(-) delete mode 100644 src/esx/Makefile.inc.am delete mode 100644 src/openvz/Makefile.inc.am delete mode 100644 src/vmware/Makefile.inc.am delete mode 100644 src/vmx/Makefile.inc.am diff --git a/m4/virt-win-symbols.m4 b/m4/virt-win-symbols.m4 index eba5596e4b4..f7b8e612a8d 100644 --- a/m4/virt-win-symbols.m4 +++ b/m4/virt-win-symbols.m4 @@ -18,7 +18,6 @@ dnl . dnl =20 AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [ - LIBVIRT_SYMBOL_FILE=3Dlibvirt.syms LIBVIRT_ADMIN_SYMBOL_FILE=3Dadmin/libvirt_admin.syms LIBVIRT_LXC_SYMBOL_FILE=3D'$(srcdir)/libvirt_lxc.syms' LIBVIRT_QEMU_SYMBOL_FILE=3D'$(srcdir)/libvirt_qemu.syms' @@ -27,13 +26,11 @@ AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [ # Also set the symbol file to .def, so src/Makefile generates libvir= t.def # from libvirt.syms and passes libvirt.def instead of libvirt.syms t= o the # linker - LIBVIRT_SYMBOL_FILE=3Dlibvirt.def LIBVIRT_ADMIN_SYMBOL_FILE=3Dadmin/libvirt_admin.def LIBVIRT_LXC_SYMBOL_FILE=3Dlibvirt_lxc.def LIBVIRT_QEMU_SYMBOL_FILE=3Dlibvirt_qemu.def ;; esac - AC_SUBST([LIBVIRT_SYMBOL_FILE]) AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE]) AC_SUBST([LIBVIRT_LXC_SYMBOL_FILE]) AC_SUBST([LIBVIRT_QEMU_SYMBOL_FILE]) diff --git a/src/Makefile.am b/src/Makefile.am index b0990e94ec1..3ad565f7775 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -74,11 +74,7 @@ include access/Makefile.inc.am include logging/Makefile.inc.am include locking/Makefile.inc.am include admin/Makefile.inc.am -include esx/Makefile.inc.am -include vmx/Makefile.inc.am -include vmware/Makefile.inc.am include vbox/Makefile.inc.am -include openvz/Makefile.inc.am include qemu/Makefile.inc.am include bhyve/Makefile.inc.am include libxl/Makefile.inc.am @@ -218,9 +214,8 @@ check-local: check-protocol check-symfile check-symsort= ing \ # All .syms files should be placed in exactly one of these three lists, # depending on whether they are stored in git and/or used in the build. SYM_FILES +=3D $(USED_SYM_FILES) -USED_SYM_FILES +=3D $(srcdir)/libvirt_private.syms GENERATED_SYM_FILES +=3D \ - libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \ + libvirt_qemu.def libvirt_lxc.def \ $(NULL) =20 =20 @@ -242,52 +237,6 @@ check-augeas: $(augeas_DATA) $(augeastest_DATA) AUG_GENTEST_SCRIPT =3D $(top_srcdir)/scripts/augeas-gentest.py AUG_GENTEST =3D $(RUNUTF8) $(PYTHON) $(AUG_GENTEST_SCRIPT) =20 - -# -# Build our version script. This is composed of three parts: -# -# 1. libvirt_public.syms - public API. These functions are always -# present in the library and should never change incompatibly. -# -# 2. libvirt_private.syms - private API. These symbols are private and -# semantics may change on every release, hence the version number is -# spliced in at build time. This ensures that if libvirtd, virsh, or a -# driver module was built against one libvirt release, it will refuse to -# load with another where symbols may have same names but different -# semantics. Such symbols should never be visible in an (installed) -# public header file. -# -# 3. libvirt_*.syms - dynamic private API. Like libvirt_private.syms, -# except that build options (such as --enable-debug) can mean these -# symbols aren't present at all. -# - -USED_SYM_FILES +=3D $(srcdir)/libvirt_driver_modules.syms - -if WITH_LINUX -USED_SYM_FILES +=3D $(srcdir)/libvirt_linux.syms -else ! WITH_LINUX -SYM_FILES +=3D $(srcdir)/libvirt_linux.syms -endif ! WITH_LINUX - -if WITH_SASL -USED_SYM_FILES +=3D $(srcdir)/libvirt_sasl.syms -else ! WITH_SASL -SYM_FILES +=3D $(srcdir)/libvirt_sasl.syms -endif ! WITH_SASL - -if WITH_SSH2 -USED_SYM_FILES +=3D $(srcdir)/libvirt_libssh2.syms -else ! WITH_SSH2 -SYM_FILES +=3D $(srcdir)/libvirt_libssh2.syms -endif ! WITH_SSH2 - -if WITH_LIBSSH -USED_SYM_FILES +=3D $(srcdir)/libvirt_libssh.syms -else ! WITH_LIBSSH -SYM_FILES +=3D $(srcdir)/libvirt_libssh.syms -endif ! WITH_LIBSSH - # Empty source list - it merely links a bunch of convenience libs together libvirt_la_SOURCES =3D libvirt_la_LDFLAGS =3D \ diff --git a/src/access/Makefile.inc.am b/src/access/Makefile.inc.am index da9b5ef31b3..bd1d51dd777 100644 --- a/src/access/Makefile.inc.am +++ b/src/access/Makefile.inc.am @@ -1,11 +1,5 @@ # vim: filetype=3Dautomake =20 -ACCESS_DRIVER_SYM_FILES =3D \ - libvirt_access.syms \ - libvirt_access_qemu.syms \ - libvirt_access_lxc.syms \ - $(NULL) - ACCESS_DRIVER_API_FILES =3D \ libvirt_access.xml \ libvirt_access_qemu.xml \ @@ -14,8 +8,6 @@ ACCESS_DRIVER_API_FILES =3D \ =20 ACCESS_DRIVER_POLKIT_POLICY =3D access/org.libvirt.api.policy =20 -GENERATED_SYM_FILES +=3D $(ACCESS_DRIVER_SYM_FILES) - libvirt_la_BUILT_LIBADD +=3D libvirt_driver_access.la =20 $(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \ @@ -31,20 +23,6 @@ polkitaction_DATA =3D $(ACCESS_DRIVER_POLKIT_POLICY) endif WITH_LIBVIRTD endif ! WITH_POLKIT =20 - -libvirt_access.syms: $(srcdir)/rpc/gendispatch.pl \ - $(REMOTE_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=3Daclsym \ - remote REMOTE $(REMOTE_PROTOCOL) > $@ -libvirt_access_qemu.syms: $(srcdir)/rpc/gendispatch.pl \ - $(QEMU_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=3Daclsym \ - qemu QEMU $(QEMU_PROTOCOL) > $@ -libvirt_access_lxc.syms: $(srcdir)/rpc/gendispatch.pl \ - $(LXC_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=3Daclsym \ - lxc LXC $(LXC_PROTOCOL) > $@ - libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \ $(REMOTE_PROTOCOL) Makefile.am $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=3Daclapi \ diff --git a/src/access/meson.build b/src/access/meson.build index c5784fa4a98..dc962166873 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -13,14 +13,17 @@ remote_path =3D meson.source_root() / 'src' / 'remote' =20 access_gen_headers =3D [] access_gen_sources =3D [] +access_gen_sym =3D [] =20 foreach name : [ 'remote', 'qemu', 'lxc' ] if name =3D=3D 'remote' header_file =3D 'viraccessapicheck.h' source_file =3D 'viraccessapicheck.c' + syms_file =3D 'libvirt_access.syms' else header_file =3D 'viraccessapicheck@0@.h'.format(name) source_file =3D 'viraccessapicheck@0@.c'.format(name) + syms_file =3D 'libvirt_access_@0@.syms'.format(name) endif protocol_file =3D remote_path / '@0@_protocol.x'.format(name) =20 @@ -42,6 +45,15 @@ foreach name : [ 'remote', 'qemu', 'lxc' ] ], capture: true, ) + + access_gen_sym +=3D custom_target( + syms_file, + output: syms_file, + capture: true, + command: [ + gendispatch_prog, '--mode=3Daclsym', name, name.to_upper(), protocol= _file, + ] + ) endforeach =20 if conf.has('WITH_POLKIT') @@ -70,3 +82,5 @@ access_dep =3D declare_dependency( include_directories: access_inc_dir, sources: access_gen_headers, ) + +generated_sym_files +=3D access_gen_sym diff --git a/src/esx/Makefile.inc.am b/src/esx/Makefile.inc.am deleted file mode 100644 index 2e776d1ebec..00000000000 --- a/src/esx/Makefile.inc.am +++ /dev/null @@ -1,7 +0,0 @@ -# vim: filetype=3Dautomake - -if WITH_ESX -USED_SYM_FILES +=3D $(srcdir)/libvirt_esx.syms -else ! WITH_ESX -SYM_FILES +=3D $(srcdir)/libvirt_esx.syms -endif ! WITH_ESX diff --git a/src/esx/meson.build b/src/esx/meson.build index 6d7e2311bff..08d8a542498 100644 --- a/src/esx/meson.build +++ b/src/esx/meson.build @@ -55,3 +55,9 @@ if conf.has('WITH_ESX') ], ) endif + +if conf.has('WITH_ESX') + used_sym_files +=3D 'libvirt_esx.syms' +else + sym_files +=3D 'libvirt_esx.syms' +endif diff --git a/src/meson.build b/src/meson.build index 753d93253ea..257cdbe4090 100644 --- a/src/meson.build +++ b/src/meson.build @@ -76,6 +76,44 @@ if conf.has('WITH_DTRACE_PROBES') endif =20 =20 +# symbol files + +public_sym_file =3D 'libvirt_public.syms' + +used_sym_files =3D [ + 'libvirt_private.syms', + 'libvirt_driver_modules.syms', +] + +generated_sym_files =3D [] + +sym_files =3D [] + +if host_machine.system() =3D=3D 'linux' + used_sym_files +=3D 'libvirt_linux.syms' +else + sym_files +=3D 'libvirt_linux.syms' +endif + +if conf.has('WITH_SASL') + used_sym_files +=3D 'libvirt_sasl.syms' +else + sym_files +=3D 'libvirt_sasl.syms' +endif + +if conf.has('WITH_LIBSSH') + used_sym_files +=3D 'libvirt_libssh.syms' +else + sym_files +=3D 'libvirt_libssh.syms' +endif + +if conf.has('WITH_SSH2') + used_sym_files +=3D 'libvirt_libssh2.syms' +else + sym_files +=3D 'libvirt_libssh2.syms' +endif + + # list subdirectories =20 subdir('util') @@ -140,3 +178,40 @@ driver_lib =3D static_library( conf_inc_dir, ], ) + + +# symbol files for libvirt.so + +# Build our version script. This is composed of three parts: +# +# 1. libvirt_public.syms - public API. These functions are always +# present in the library and should never change incompatibly. +# +# 2. libvirt_private.syms - private API. These symbols are private and +# semantics may change on every release, hence the version number is +# spliced in at build time. This ensures that if libvirtd, virsh, or a +# driver module was built against one libvirt release, it will refuse to +# load with another where symbols may have same names but different +# semantics. Such symbols should never be visible in an (installed) +# public header file. +# +# 3. libvirt_*.syms - dynamic private API. Like libvirt_private.syms, +# except that build options (such as --enable-debug) can mean these +# symbols aren't present at all. + +libvirt_syms =3D custom_target( + 'libvirt.syms', + input: [ public_sym_file ] + used_sym_files + generated_sym_files, + output: 'libvirt.syms', + command: [ gen_sym_files_prog, 'LIBVIRT_PRIVATE_' + meson.project_versio= n(), '@INPUT@' ], + capture: true, +) +if host_machine.system() =3D=3D 'windows' + libvirt_def =3D custom_target( + 'libvirt.def', + input: libvirt_syms, + output: 'libvirt.def', + command: [ gen_def_files_prog, '@INPUT@' ], + capture: true, + ) +endif diff --git a/src/openvz/Makefile.inc.am b/src/openvz/Makefile.inc.am deleted file mode 100644 index c01e33124ac..00000000000 --- a/src/openvz/Makefile.inc.am +++ /dev/null @@ -1,7 +0,0 @@ -# vim: filetype=3Dautomake - -if WITH_OPENVZ -USED_SYM_FILES +=3D $(srcdir)/libvirt_openvz.syms -else ! WITH_OPENVZ -SYM_FILES +=3D $(srcdir)/libvirt_openvz.syms -endif ! WITH_OPENVZ diff --git a/src/openvz/meson.build b/src/openvz/meson.build index b4e3befccb5..427b25fed1c 100644 --- a/src/openvz/meson.build +++ b/src/openvz/meson.build @@ -18,3 +18,9 @@ if conf.has('WITH_OPENVZ') ], ) endif + +if conf.has('WITH_OPENVZ') + used_sym_files +=3D 'libvirt_openvz.syms' +else + sym_files +=3D 'libvirt_openvz.syms' +endif diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 1dff8ec67e1..421f7337217 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -127,12 +127,6 @@ REMOTE_DRIVER_PROTOCOL =3D \ $(LXC_PROTOCOL) \ $(NULL) =20 -if WITH_REMOTE -USED_SYM_FILES +=3D $(srcdir)/libvirt_remote.syms -else ! WITH_REMOTE -SYM_FILES +=3D $(srcdir)/libvirt_remote.syms -endif ! WITH_REMOTE - if WITH_LIBVIRTD =20 sbin_PROGRAMS +=3D libvirtd virtproxyd diff --git a/src/remote/meson.build b/src/remote/meson.build index 383b265ea21..f029edefd7e 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -57,3 +57,9 @@ if conf.has('WITH_REMOTE') ], ) endif + +if conf.has('WITH_REMOTE') + used_sym_files +=3D 'libvirt_remote.syms' +else + sym_files +=3D 'libvirt_remote.syms' +endif diff --git a/src/vmware/Makefile.inc.am b/src/vmware/Makefile.inc.am deleted file mode 100644 index 125e0304618..00000000000 --- a/src/vmware/Makefile.inc.am +++ /dev/null @@ -1,7 +0,0 @@ -# vim: filetype=3Dautomake - -if WITH_VMWARE -USED_SYM_FILES +=3D $(srcdir)/libvirt_vmware.syms -else ! WITH_VMWARE -SYM_FILES +=3D $(srcdir)/libvirt_vmware.syms -endif ! WITH_VMWARE diff --git a/src/vmware/meson.build b/src/vmware/meson.build index 285cc5eb9a3..dc2a32a1610 100644 --- a/src/vmware/meson.build +++ b/src/vmware/meson.build @@ -16,3 +16,9 @@ if conf.has('WITH_VMWARE') ], ) endif + +if conf.has('WITH_VMWARE') + used_sym_files +=3D 'libvirt_vmware.syms' +else + sym_files +=3D 'libvirt_vmware.syms' +endif diff --git a/src/vmx/Makefile.inc.am b/src/vmx/Makefile.inc.am deleted file mode 100644 index 8912f6ee21c..00000000000 --- a/src/vmx/Makefile.inc.am +++ /dev/null @@ -1,7 +0,0 @@ -# vim: filetype=3Dautomake - -if WITH_VMX -USED_SYM_FILES +=3D $(srcdir)/libvirt_vmx.syms -else ! WITH_VMX -SYM_FILES +=3D $(srcdir)/libvirt_vmx.syms -endif ! WITH_VMX diff --git a/src/vmx/meson.build b/src/vmx/meson.build index 8bed1fac9fa..25e3d1a6fca 100644 --- a/src/vmx/meson.build +++ b/src/vmx/meson.build @@ -18,3 +18,9 @@ if conf.has('WITH_VMX') endif =20 vmx_inc_dir =3D include_directories('.') + +if conf.has('WITH_VMX') + used_sym_files +=3D 'libvirt_vmx.syms' +else + sym_files +=3D 'libvirt_vmx.syms' +endif --=20 2.26.2