mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-17 07:24:34 +00:00
103a6eb94f
Symbols of pretty much all member functions of types that are meant to be "private" to translation units that contribute to libabigail.so were exported because we didn't do much to prevent that. This patch starts controlling the set of symbols that are exported. By default, symbols of any entity declared in a translation unit that contributes to libabigail.so are hidden by default. Only symbols of entities declared in public headers (headers in include/*.h) are exported. There are many ways to achieve that. This patch chooses to avoid cluttering declarations of entities in the public header by adding __attribute__((visibility="default")) to every declared type of function in there. Rather, the patch uses "#pragma GCC visibility push(default)" before entities declared on those headers. By doing so, all those entities have their symbol marked as "visible" by the compiler. Once the header are #included, the #pragma GCC visibility pop" is used, so that anything else has its symbol be hidden from that point on. Note that for ease of maintenance the patch uses the macros ABG_BEGIN_EXPORT_DECLARATIONS and ABG_END_EXPORT_DECLARATIONS rather than using the pragma directive directly. I believe this is a more elegant way of handling visibility, compared to cluttering every single declaration in public headers with a "__attribute__((visibility=("default")))" or with a macro which expands to it. This reduces the the set of symbols exported by libabigail.so from 20000+ to less than 5000. * VISIBILITY: New documentation about this visiblity business. * CONTRIBUTING: Update the "contributing guide" to refer to symbol visibility issues. * configure.ac: Define a variable VISIBILITY_FLAGS that is set to the -fvisibility=hidden flag to pass to GCC, when its available. * src/Makefile.am: Add VISIBILITY to source distribution. Also add COMPILING and COMMIT-LOG-GUIDELINES that were missing. * src/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding the library. * tests/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding tests. * tools/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding tools. * src/abg-comp-filter.cc: Enclose inclusion of public headers in ABG_BEGIN_EXPORT_DECLARATIONS and ABG_END_EXPORT_DECLARATIONS to export the symbols of entities declared in there. * src/abg-comparison.cc: Likewise. * src/abg-config.cc: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-diff-utils.cc: Likewise. * src/abg-dwarf-reader.cc: Likewise. * src/abg-hash.cc: Likewise. * src/abg-ini.cc: Likewise. * src/abg-ir.cc: Likewise. * src/abg-libxml-utils.cc: Likewise. * src/abg-libzip-utils.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-suppression.cc: Likewise. * src/abg-tools-utils.cc: Likewise. * src/abg-traverse.cc: Likewise. * src/abg-viz-common.cc: Likewise. * src/abg-viz-dot.cc: Likewise. * src/abg-viz-svg.cc: Likewise. * src/abg-workers.cc: Likewise. * src/abg-writer.cc: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
76 lines
1.7 KiB
Makefile
76 lines
1.7 KiB
Makefile
SUBDIRS = include src tools tests doc bash-completion
|
|
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
|
headers = config.h
|
|
|
|
m4datadir = $(datadir)/aclocal
|
|
m4data_DATA = $(srcdir)/abigail.m4
|
|
|
|
pkgconfigdir = $(libdir)/pkgconfig
|
|
pkgconfig_DATA = libabigail.pc
|
|
|
|
dist_noinst_DATA = default.abignore
|
|
abigaillibdir = $(pkglibdir)
|
|
abigaillib_DATA = default.abignore
|
|
|
|
#bashcompletiondir = $(datadir)/bash-completion/completions
|
|
#dist_bashcompletion_DATA =
|
|
|
|
EXTRA_DIST = \
|
|
autoconf-archive/ax_check_python_modules.m4 \
|
|
autoconf-archive/ax_prog_python_version.m4 \
|
|
autoconf-archive/ax_compare_version.m4 \
|
|
NEWS README COPYING COMPILING \
|
|
COMMIT-LOG-GUIDELINES VISIBILITY \
|
|
ChangeLog COPYING-LGPLV2 COPYING-LGPLV3 \
|
|
COPYING-GPLV3 gen-changelog.py \
|
|
$(headers) $(m4data_DATA) \
|
|
libabigail.pc.in
|
|
|
|
# automake already tells which subdir is being entered.
|
|
# Don't make make repeat.
|
|
AM_MAKEFLAGS = --no-print-directory
|
|
|
|
.PHONY: doc
|
|
|
|
doc: html-doc man info
|
|
|
|
html-doc:
|
|
$(MAKE) -C doc html-doc
|
|
$(MAKE) -C doc/manuals html-doc
|
|
|
|
man:
|
|
$(MAKE) -C doc/manuals man
|
|
|
|
info:
|
|
$(MAKE) -C doc/manuals info
|
|
|
|
check-valgrind:
|
|
$(MAKE) -C tests check-valgrind
|
|
|
|
check-valgrind-recursive:
|
|
$(MAKE) -C tests check-valgrind-memcheck-recursive
|
|
|
|
update-changelog:
|
|
python $(srcdir)/gen-changelog.py > $(srcdir)/ChangeLog
|
|
|
|
TARBALL = $(PACKAGE_NAME)-$(VERSION).tar.gz
|
|
RELEASED_BRANCH = master
|
|
|
|
$(TARBALL): distcheck
|
|
|
|
tag-release-only:
|
|
git tag -m "$(PACKAGE_NAME) release $(VERSION)" \
|
|
"$(PACKAGE_NAME)-$(VERSION)" $(RELEASED_BRANCH)
|
|
|
|
tag-release: tag-release-only
|
|
|
|
upload-release-only:
|
|
scp $(TARBALL) sourceware.org:~ftp/pub/libabigail
|
|
|
|
tarball: $(TARBALL)
|
|
|
|
upload-release: tag-release
|
|
$(MAKE) tarball upload-release-only
|
|
|
|
release: upload-release
|