GNOME Bugzilla – Bug 768198
Can't build glib with systemtap enabled
Last modified: 2016-08-13 07:33:08 UTC
Created attachment 330604 [details] Full build and configure output (lots of gcc warnings...) I'm running Arch linux and since I installed systemtap system-wide, I can't build glib anymore (in a jhbuild env). The errors are similar to: /tmp/ccpwxbxU.ltrans8.ltrans.o:(.note.stapsdt+0x24): undefined reference to `glib_thread__spawned_semaphore' so the bug seems related to https://bugzilla.gnome.org/show_bug.cgi?id=691446 but this is while linking the normal shared library as far as I understand. I've attached a full log of ./configure && make V=1. It contains lots of gcc warnings due to my CFLAGS though. Building with --disable-trace --disable-systemtap works.
Does it build if you revert commits • 7563ab473468fecefc388ae2ed06afab8ead6211 • 8c6d08ab1b8ec57b81d77d44820f40625009b2cc ?
Reverting the first one doesn't help alone, the second commit hash is not valid here.
The second one (‘build: Simplify dtrace configuration’) was an extension of the first, so if reverting the first didn’t help, the second wouldn’t either. I’ll have a think and come back to this later.
Taking another look at this, I think it’s caused by -flto, which you are passing, and I am not. If I add -flto to my CFLAGS, I get the same failure. Looking at the generated *_probes.h files, they define _SDT_HAS_SEMAPHORES, and undefine STAP_HAS_SEMAPHORES, saying it’s deprecated. Changing the Makefiles to apply the same #undef to _SDT_HAS_SEMAPHORES fixes the build with -flto — I assume either semaphores are broken with LTO, or the mismatch between STAP_HAS_SEMAPHORES and _SDT_HAS_SEMAPHORES was causing the breakage. Patch coming.
(In reply to Philip Withnall from comment #4) > I assume either semaphores are broken with LTO, or > the mismatch between STAP_HAS_SEMAPHORES and _SDT_HAS_SEMAPHORES was causing > the breakage. Enabling semaphores unconditionally (removing both #undefs) causes the build to break the same way, so it looks like semaphores are broken with LTO. Doesn’t really matter, since we don’t want semaphores.
Created attachment 332881 [details] [review] build: Fix SystemTap build to disable semaphores as before At some point, upstream SystemTap changed from using a STAP_HAS_SEMAPHORES preprocessor variable for this, to using _SDT_HAS_SEMAPHORES instead. We need to update our build system to disable that as well. The original discussion about use of semaphores is here: https://bugzilla.gnome.org/show_bug.cgi?id=606044 This was breaking the build with -flto enabled, either because -flto doesn’t work with semaphores.
FWIW, the build succeeds for me with that patch applied.
Review of attachment 332881 [details] [review]: LGTM.
Thanks for the review; pushed. Attachment 332881 [details] pushed as a5044a8 - build: Fix SystemTap build to disable semaphores as before