After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768198 - Can't build glib with systemtap enabled
Can't build glib with systemtap enabled
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: build
2.49.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-06-29 17:26 UTC by Timm Bäder
Modified: 2016-08-13 07:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Full build and configure output (lots of gcc warnings...) (191.54 KB, text/plain)
2016-06-29 17:26 UTC, Timm Bäder
  Details
build: Fix SystemTap build to disable semaphores as before (2.88 KB, patch)
2016-08-07 10:30 UTC, Philip Withnall
committed Details | Review

Description Timm Bäder 2016-06-29 17:26:33 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.
Comment 1 Philip Withnall 2016-07-01 11:34:00 UTC
Does it build if you revert commits
 • 7563ab473468fecefc388ae2ed06afab8ead6211
 • 8c6d08ab1b8ec57b81d77d44820f40625009b2cc

?
Comment 2 Timm Bäder 2016-07-01 17:14:17 UTC
Reverting the first one doesn't help alone, the second commit hash is not valid here.
Comment 3 Philip Withnall 2016-07-01 17:58:22 UTC
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.
Comment 4 Philip Withnall 2016-08-07 10:24:28 UTC
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.
Comment 5 Philip Withnall 2016-08-07 10:30:05 UTC
(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.
Comment 6 Philip Withnall 2016-08-07 10:30:35 UTC
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.
Comment 7 Timm Bäder 2016-08-12 22:06:27 UTC
FWIW, the build succeeds for me with that patch applied.
Comment 8 Colin Walters 2016-08-13 01:23:26 UTC
Review of attachment 332881 [details] [review]:

LGTM.
Comment 9 Philip Withnall 2016-08-13 07:33:00 UTC
Thanks for the review; pushed.

Attachment 332881 [details] pushed as a5044a8 - build: Fix SystemTap build to disable semaphores as before