GNOME Bugzilla – Bug 771920
Add --hide-internal to VALAFLAGS in build system
Last modified: 2016-10-26 08:33:38 UTC
Created attachment 336195 [details] [review] Add --hide-internal to VALAFLAGS in Vala build system The --hide-internal switch of valac add the GLib macro G_GNUC_INTERNAL before symbols that should not be exported to the dynamic symbol table of a shared object. Adding this to VALAFLAGS allows symbols to be hidden from the libvala dynamic symbol table.
To test this the .c files need to be removed from the vala build. Using: make maintainer-clean first works for me.
The --hide-internal switch went in to Vala 24 March 2014, just after the release of Vala 0.24.0. The commit for the switch is https://git.gnome.org/browse/vala/commit/?id=970f58989a2863faca11e30fdbcf4da1273a6acd This means that a minimum of Vala 0.26.0 (released 22 September 2014) would be needed to build Vala from Vala source files. Vala can still be built from the tarball with only a C compiler.
Created attachment 336201 [details] [review] Add --hide-internal to VALAFLAGS in build system when building with Vala 0.26.0+ Vala 0.26.0 introduced the --hide-internal switch. Adding this to the Vala internal build system allows symbols to be marked 'internal' and they will be removed from the dynamic symbol table of the shared object built.
Created attachment 336202 [details] [review] Add --hide-internal to VALAFLAGS in build system when building with Vala 0.25.1+ Less verbose version and changed minimum version of vala for --hide-internal to 0.25.1
That is not the diff I suggested. Not passing [] to the false-path will prompt a warning which is not wanted.
From autogen.sh without the [] for the false-path I get: configure: WARNING: no proper vala compiler found checking whether /usr/bin/valac is at least version 0.35.1... no configure: WARNING: you will not be able to compile vala source files with the [], I get: :configure: WARNING: no proper vala compiler found configure: WARNING: you will not be able to compile vala source files Maybe I should try AS_IF or AS_VERSION_COMPARE
Created attachment 337670 [details] [review] build: Conditionally adjust VALAFLAGS in case of proper bootsrapped builds This adds --hide-internal to VALAFLAGS to allow symbols to be marked 'internal' in Vala source files and not appear in the dynamic symbol table of libvala. The build system checks for minimum valac version to fullfill required support of needed VALAFLAGS.
Comment on attachment 337670 [details] [review] build: Conditionally adjust VALAFLAGS in case of proper bootsrapped builds commit fbc749bd4ec84673ace5b311ec468c75ab049e1f Author: Rico Tzschichholz <ricotz@ubuntu.com> Date: Thu Oct 13 22:25:56 2016 +0200 build: Conditionally adjust VALAFLAGS in case of proper bootsrapped builds This adds --hide-internal to VALAFLAGS to allow symbols to be marked 'internal' in Vala source files and not appear in the dynamic symbol table of libvala. The build system checks for minimum valac version to fullfill required support of needed VALAFLAGS.