Commit Graph

7 Commits

Author SHA1 Message Date
Dodji Seketeli
103a6eb94f Control symbols exported from libabigail.so
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>
2016-07-27 12:51:02 +02:00
Dodji Seketeli
5faf6e9a68 Document how to handle regression tests in CONTRIBUTING
There was not user documentation about how to execute regression
tests.  This patch fixes that by adding a description of the
regression tests and how to launch them.

I have also added a new "make check-valgrind-recursive" target that
execute the tests under memcheck by tracing children processes too,
notably libabigail command line tool processes.

	* CONTRIBUTING: Add a section about regression tests.
	* Makefile.am: Add a check-valgrind-recursive target.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-23 00:10:07 +02:00
Dodji Seketeli
e5cc86a9b7 Update the CONTRIBUTING file
I felt this file needed a little bit of clean-up.  There we go.

	* CONTRIBUTING: Cleanup.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-22 23:20:12 +02:00
Dodji Seketeli
9dbd3bb90a Update the CONTRIBUTING file
I have just added information for how to checkout the web site source
code.

	* CONTRIBUTING: How to check out the web pages.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-03-19 12:47:59 +01:00
Jonathan Wakely
22f6a640e7 Fix checkout & build instructions
* CONTRIBUTING: Fix Git repository url.
	* doc/website/mainpage.txt: Add elfutils into the dependencies
	list and fix the repository directory name.  Also use autoreconf
	-i.
	* include/abg-fwd.h: Fix Git repository URL.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-01-14 15:39:34 +01:00
Dodji Seketeli
56253ee20a Fix typo in CONTRIBUTING file
* CONTRIBUTING: Fix typo, courtesy of Mark Wielaard.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-21 11:53:12 +02:00
Dodji Seketeli
921f0d36ea Prepare for publishing
* COMMIT-LOG-GUIDELINES: New file.
	* CONTRIBUTING: New file.
	* README: Amended to refer to the first files above.
2013-07-23 23:13:55 +02:00