[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] Check for private symbols presence as well



Currently, we are checking if libvirt.so contains public symbols.
However, sometimes we rename an internal symbol and forget to
change libvirt_private.syms accordingly. Hence, it's safer to check
for internal symbols as well.
---
 src/Makefile.am      |    7 ++++++-
 src/check-symfile.pl |    2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index ae3d491..c5840c0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -318,8 +318,13 @@ if WITH_LINUX
 check-symfile: libvirt.syms libvirt.la
 	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
 	  .libs/libvirt.so
+
+check-private-symfile: libvirt_private.syms libvirt.la
+	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt_private.syms \
+	  .libs/libvirt.so
 else
 check-symfile:
+check-private-symfile:
 endif
 
 PROTOCOL_STRUCTS = \
@@ -344,7 +349,7 @@ else !WITH_REMOTE
 check-protocol:
 endif
 EXTRA_DIST += $(PROTOCOL_STRUCTS) check-symfile.pl
-check-local: check-protocol check-symfile
+check-local: check-protocol check-symfile check-private-symfile
 .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
 
 # Mock driver, covering domains, storage, networks, etc
diff --git a/src/check-symfile.pl b/src/check-symfile.pl
index ac37b46..435e045 100755
--- a/src/check-symfile.pl
+++ b/src/check-symfile.pl
@@ -44,7 +44,7 @@ foreach my $elflib (@elflibs) {
     close NM;
 }
 
-foreach my $sym (@wantsyms) {
+foreach my $sym (keys(%wantsyms)) {
     next if exists $gotsyms{$sym};
 
     print STDERR "Expected symbol $sym is not in ELF library\n";
-- 
1.7.8.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]