diff options
author | Modestas Vainius <modestas@vainius.eu> | 2009-06-20 01:28:57 +0300 |
---|---|---|
committer | Raphael Hertzog <hertzog@debian.org> | 2009-06-20 19:31:39 +0200 |
commit | 5dec937e782343fb810a237fddfef3660bddfea9 (patch) | |
tree | 3a3827f593e130a65f0e7dd7c8323c3b5e481471 /scripts/Makefile.am | |
parent | e8698e08a1cca4949020cf12e26c4d189e3ba306 (diff) | |
download | dpkg-5dec937e782343fb810a237fddfef3660bddfea9.tar.gz |
Symbol tagging support and implementation of optional and arch tags
Symbols might be tagged with arbitary number of tags which are separated by '|'
(aka pipe) character. Tags (only if there are any) must be enclosed in the ()
brackets right before a symbol name. Each tag can appear only once in the tag
specification for each symbol. A tag can optionally have a value. The tag value
is separated from the tag name by character '='. Tag names and values can be
arbitrary strings except they cannot contain any of the special ()|=
characters. A name of the tagged symbol can optionally be quoted with either '
or " characters (e.g. to allow whitespaces in the symbol name). If there are no
tags specified, symbol name cannot be quoted and symbol name continues up until
the first whitespace.
Example of the quoted symbol with 2 tags (the first tag has a value while the
second does not):
(tag1=value of the first tag|tag2)"Foo::Bar::foobar()"@Base 1.0 1
Tags serve two purposes:
* they can be used for symbol marking (e.g. when a symbol must be treated
specially under certain circumstances);
* they tell the parser that the specified symbol name must be processed in
certain way to become a raw symbol name as found in the object files.
Such tags are processed in the order they are specified.
Symbol files with tags are not backwards compatible, so a new parameter
'template_mode' has been added to SymbolFile::dump(). If template_mode is not
set (default), dump() emits a fully post-processed symbol specifications as
directed by their tags. Tags themselves are ommited from output and unknown
tags are ignored. If template_mode is set, dump() keeps tags in the output and
emits symbol specifications as they were read from the symbol file.
As a result, a new parameter -t was added to dpkg-gensymbols to support writing
the symbol file in template mode. Default is to write in non-template mode.
(tag|...|tagN)#include "file_to_include"
All symbols in the "file_to_include" will be tagged with #include tags by
default. A symbol in "file_to_include" can specify additional tags in its tag
specification or even override the tag value inherited from #include tags by
specifying another one in its own tag specifaction. There is no way for the
symbol to untag itself, even if the tag was inherited from #include. #include
tags are assumed to go always before (in tagorder) symbol specific tags even if
the symbol overrides the tag. Recursive tagged #includes are supported.
The patch also adds support for 2 tags:
* optional - a symbol marked as optional can disappear from the object file at
any time and that will never cause dpkg-gensymbols to fail (just emit the
diff). If optional symbol disappears, it is dumped as MISSING with
deprecated string set to the current package version (hence it always appears
in the dpkg-gensymbols diff). If optional symbol reappears, it gets
undeprecated but its minver is kept unchanged (contrary to reappearing
MISSING symbols).
Example: C++ template instantiation which disappearance is not ABI breaking
(i.e. basically it is a private symbol).
(optional)_ZN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE0EE11qt_metacastEPKc@Base 4:4.2.0
* arch=<list of architectures as in Build-Depend dep> - allows to
mark a symbol as arch-specific. When dumping in non-templace mode, only
symbols concerned for the current host architecture are dumped. When dumping
in template mode, all arch-specific symbols are always dumped (including
proper tags). If arch-specific symbol appears on the arch that it is not
supposed to appear, it is made arch neutral (hence it appears in the
dpkg-gensymbols diff). If arch-specific symbol disappears from its arch, it
gets declared as MISSING.
Example: armel specific symbol due to qreal mangling as float on arm(el)
and double on other arches.
(arch=arm armel)_ZN6Phonon11AudioOutput13volumeChangedEd@Base 4:4.2.0
(arch=!armel !arm)_ZN6Phonon11AudioOutput13volumeChangedEf@Base 4:4.2.0
Diffstat (limited to 'scripts/Makefile.am')
-rw-r--r-- | scripts/Makefile.am | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 61e33ab22..bec817c60 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -53,6 +53,9 @@ EXTRA_DIST = \ t/200_Dpkg_Shlibs/symbols.fake-2 \ t/200_Dpkg_Shlibs/symbols.include-1 \ t/200_Dpkg_Shlibs/symbols.include-2 \ + t/200_Dpkg_Shlibs/symbols.include-3 \ + t/200_Dpkg_Shlibs/symbols.tags.in \ + t/200_Dpkg_Shlibs/symboltags.c \ t/200_Dpkg_Shlibs/ld.so.conf \ t/200_Dpkg_Shlibs/ld.so.conf_2 \ t/200_Dpkg_Shlibs/ld.so.conf.d/normal.conf \ @@ -63,6 +66,8 @@ EXTRA_DIST = \ t/200_Dpkg_Shlibs/objdump.libc6-2.6 \ t/200_Dpkg_Shlibs/objdump.dbd-pg \ t/200_Dpkg_Shlibs/objdump.ls \ + t/200_Dpkg_Shlibs/objdump.tags-amd64 \ + t/200_Dpkg_Shlibs/objdump.tags-i386 \ t/300_Dpkg_BuildOptions.t \ t/400_Dpkg_Deps.t \ t/500_Dpkg_Path.t \ @@ -100,6 +105,7 @@ nobase_dist_perllib_DATA = \ Dpkg/Path.pm \ Dpkg/Shlibs.pm \ Dpkg/Shlibs/Objdump.pm \ + Dpkg/Shlibs/Symbol.pm \ Dpkg/Shlibs/SymbolFile.pm \ Dpkg/Source/Archive.pm \ Dpkg/Source/CompressedFile.pm \ @@ -170,8 +176,20 @@ clean-local: [ ! -d t.tmp ] || chmod -R +w t.tmp rm -fr t.tmp -check: $(TEST_FILES) $(wildcard $(srcdir)/t/200_Dpkg_Shlibs/ld.so.conf*) -# a bit hacky... +mkdir_t_tmp: $(mkdir_p) t.tmp + +check: $(TEST_FILES) $(wildcard $(srcdir)/t/200_Dpkg_Shlibs/ld.so.conf*) mkdir_t_tmp +# a bit hacky... cp -dRl $(srcdir)/t/200_Dpkg_Shlibs/ld.so.conf* t.tmp/ PATH="$(top_builddir)/src:$(top_builddir)/scripts:$(PATH)" srcdir=$(srcdir) PERL5LIB=$(srcdir) DPKG_DATADIR=$(srcdir)/.. PERL_DL_NONLAZY=1 $(PERL) -I$(srcdir) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '.')" $(TEST_FILES) + +objdump_lib_name = lib$(shell basename $@).so +$(srcdir)/t/200_Dpkg_Shlibs/objdump.tags-amd64 $(srcdir)/t/200_Dpkg_Shlibs/objdump.tags-i386: $(srcdir)/t/200_Dpkg_Shlibs/symboltags.c + $(CC) $(CFLAGS) -shared -fPIC -Wl,-soname -Wl,libsymboltags.so.1 $< \ + $(if $(findstring amd64,$@),-DAMD64,) -o $(objdump_lib_name) + objdump -w -f -p -T -R $(objdump_lib_name) | sed 's/$(objdump_lib_name)/libsymboltags.so.1/g' > $@ + rm -f $(objdump_lib_name) + +update-objdumps .PHONY: $(srcdir)/t/200_Dpkg_Shlibs/objdump.tags-amd64 +update-objdumps .PHONY: $(srcdir)/t/200_Dpkg_Shlibs/objdump.tags-i386 |