Skip to content

meson, autotools: Hide non-exported symbols by default

Marco Trevisan requested to merge 3v1n0/gjs:hide-private-symbols into master

Move jsapi generic symbols to a private static library and hide all the symbols by default, except the ones marked with GJS_EXPORT that is now setting the default visibility. Use then this static library to link dependent tools with (using the libgjs_dep definition in meson, instead of manually set the link_with).

In order not to get C++ symbols exported we still need to use a map file to whitelist the gjs_ prefixed symbols.

Fixes #194 (closed)


Ensuring we only export public gjs_* symbols in both meson and auto-tools.

NOTE: While the exported symbols table is different, this is not an break because none of the now hidden symbols were previously exported by any header and so considered public (and so not-accessible, unless someone tried with dlsym or export).

NOTE2: Ideally I wanted to move all the stuff related to GjsContextPrivate in a context-private.cpp file, part of another private static library, but this is something that would need to move lots of code (while not many changes), and given that there's some circular dependency between it and the gjs_context_get_instance_private this is not soooo easy, so for now I'd just proceed this way.

Merge request reports