The agent is statically linked so that it doesn't require using a properly
working libsysprof to be installed. This ensures that it continues to build
properly in that case so it can be used from org.gnome.Sdk.
Only some situations can use this properly without libunwind, so make
sure that we have it available unless -Dlibunwind=false.
Distributors, please be kind, use libunwind!
This release fixes an issue created during GNOME 40 development where the
libsysprof-capture-4.a library could leak symbols into a shared library
that consumed it (such as Pango, GTK 4, and GLib).
This fixes that by removing symbol visibility from libsysprof-capture.a.
Distributions are encouraged to rebuild their libraries that consume
Sysprof's libsysprof-capture-4.a.
The visibility of symbols was getting extracted from the .a into the
libraries that link_whole the archive. We can simply disable the visibility
from the .a with a custom config.h.meson which avoids it for the capture
library. Since we already double-compile those sources for the shared
library, the shared library visibility is not affected.
This was tested by compiling a simple library which calls
sysprof_clock_init() and ensuring that no extra symbols were found with
`nm libfoo.so | grep ' T '`.
Fixes#60
Check for -fstack-protector-strong availability through
has_link_argument as some compilers could missed the needed library
(-lssp or -lssp_nonshared) at linking step resulting in a build failure.
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Rather than defining them piecemeal in each C and H file, and having
problems with headers being included in different orders so that
`_POSIX_C_SOURCE` gets a value which is too low, just define the feature
test flags in `meson.build`.
See `man 7 feature_test_macros`.
This is useful for when building sysprof as a subproject beneath a
project which doesn’t define these macros, or which targets an older C
standard than `gnu11`.
Signed-off-by: Philip Withnall <withnall@endlessm.com>