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 346559 - static build has issues with the "perf" directory
static build has issues with the "perf" directory
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
2.90.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 346531
Blocks:
 
 
Reported: 2006-07-04 15:53 UTC by Sebastien Bacher
Modified: 2011-06-07 00:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't build perf measurement tools in static builds (needs patch from bug 346531) (641 bytes, patch)
2006-08-15 09:54 UTC, Loïc Minier
none Details | Review
Only build perf measurement tools in shared builds (needs patch from bug 346531) (515 bytes, patch)
2007-07-09 16:18 UTC, Loïc Minier
accepted-commit_now Details | Review
Only build perf measurement tools in shared builds (needs patch from bug 346531); v2 adds some comments (630 bytes, patch)
2008-11-29 20:23 UTC, Loïc Minier
accepted-commit_now Details | Review
Don't build perf in static builds due to duplication of marshallers.v3 (1.39 KB, patch)
2009-11-16 18:09 UTC, Javier Jardón (IRC: jjardon)
none Details | Review

Description Sebastien Bacher 2006-07-04 15:53:23 UTC
during a static build with GTK 2.10.0:

"...
../gtk/.libs/libgtk-x11-2.0.a(gtkmarshalers.o): In function `_gtk_marshal_OBJECT__VOID':
/tmp/gtk/gtk+-2.10.0/gtk/gtkmarshalers.c:1160: multiple definition of `_gtk_marshal_OBJECT__VOID'
marshalers.o:/tmp/gtk/gtk+-2.10.0/perf/marshalers.c:58: first defined here
collect2: ld returned 1 exit status
make[3]: *** [testperf] Error 1
..."
Comment 1 Loïc Minier 2006-08-15 09:54:12 UTC
Created attachment 70926 [details] [review]
Don't build perf measurement tools in static builds (needs patch from bug 346531)

Proposed fix is to stop building the perf measurement tools in static builds.  Needs the ENABLE_STATIC from the patch in bug 346531.

I first looked into building a separate static libgtk without the marshallers to permit the perf tools to define them, but it was too intrusive in gtk/.
Comment 2 Matthias Clasen 2006-08-16 13:22:28 UTC
That can't be the right fix. Why does the perf directory contain duplicate 
marshallers in the first place ?
Comment 3 Loïc Minier 2006-08-16 14:02:06 UTC
I suppose it replaces the marshalling logic to permit looping on specific widget states instead of following the standard flow.  I don't understand enough of Gtk's internals to decide whether another approach was possible to implement the behavior of the pref marshaller, but I can imagine it was easy to implement in this way.  Perhaps it's also less intrusive towards other people's code to implement it in this way.

This is only a problem for static builds because symbols can't be overriden at this point.

I'm not sure there's a gain at using the static version of gtk for perf measurement except to measure the speed of the static build itself, that's why I proposed dropping the perf dir for static builds.
Comment 4 Loïc Minier 2007-07-09 15:33:13 UTC
I'm blocking this bug on bug 346531 as I think the ENABLE_SHARED flag is what we want here too.
Comment 5 Loïc Minier 2007-07-09 16:18:03 UTC
Created attachment 91505 [details] [review]
Only build perf measurement tools in shared builds (needs patch from bug 346531)

Updated patch fixes build in all cases where --enable-static is passed (with --disable-shared or --enable-shared); perf is run with --enable-static --enable-shared
Comment 6 Matthias Clasen 2008-11-29 19:35:38 UTC
While I still don't agree that this is entirely the right fix, just go ahead and commit it if you want.
Comment 7 Loïc Minier 2008-11-29 20:23:34 UTC
Created attachment 123661 [details] [review]
Only build perf measurement tools in shared builds (needs patch from bug 346531); v2 adds some comments

Matthias, here's a slightly modified patch (using SUBDIRS += and moved perf to the end) which adds a comment pointing at this bug.

I understand that you're also ok with me adding the AM_CONDITIONAL for ENABLE_SHARED from bug #346531, but I'll wait a couple of days before committing these two patches just in case.

I propose that we keep this bug open after commit as a reminder that the perf bits need to avoid duplicating marshallers like they currently do; do you have any particular recommendation on the way to avoid this?
Comment 8 Javier Jardón (IRC: jjardon) 2009-11-13 04:39:22 UTC
Hello, the patch attached is a bit old.
Is still a valid patch?
Comment 9 Emilio Pozuelo Monfort 2009-11-13 12:41:22 UTC
I just built 2.18.3 from Debian without this patch and it failed to build, so it's still valid (the patch is not the last version but it still holds):

libtool: link: gcc -DGDK_PIXBUF_DISABLE_DEPRECATED -g -O2 -Wall -g -O2 -o testperf appwindow.o gtkwidgetprofiler.o main.o marshalers.o textview.o treeview.o typebuiltins.o  ../gdk-pixbuf/.libs/libgdk_pixbuf-2.0.a ../gdk/.libs/libgdk-x11-2.0.a ../gtk/.libs/libgtk-x11-2.0.a /tmp/buildd/gtk+2.0-2.18.3/debian/build/static/gdk/.libs/libgdk-x11-2.0.a -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor /tmp/buildd/gtk+2.0-2.18.3/debian/build/static/gdk-pixbuf/.libs/libgdk_pixbuf-2.0.a /usr/lib/libpangocairo-1.0.so -lX11 -lXcomposite -lXdamage -lXfixes /usr/lib/libatk-1.0.so /usr/lib/libcairo.so /usr/lib/libgio-2.0.so /usr/lib/libpangoft2-1.0.so /usr/lib/libpango-1.0.so /usr/lib/libfreetype.so -lfontconfig /usr/lib/libgobject-2.0.so /usr/lib/libgmodule-2.0.so /usr/lib/libglib-2.0.so /usr/lib/libtiff.so -lz -lc -lpng12 /usr/lib/libjasper.so /usr/lib/libjpeg.so -lm
../gtk/.libs/libgtk-x11-2.0.a(gtkmarshalers.o): In function `_gtk_marshal_OBJECT__VOID':
/tmp/buildd/gtk+2.0-2.18.3/gtk/gtkmarshalers.c:1165: multiple definition of `_gtk_marshal_OBJECT__VOID'
marshalers.o:/tmp/buildd/gtk+2.0-2.18.3/perf/marshalers.c:58: first defined here
collect2: ld returned 1 exit status
make[4]: *** [testperf] Error 1
make[4]: Leaving directory `/tmp/buildd/gtk+2.0-2.18.3/debian/build/static/perf'
Comment 10 Javier Jardón (IRC: jjardon) 2009-11-16 18:09:41 UTC
Created attachment 147921 [details] [review]
Don't build perf in static builds due to duplication of marshallers.v3
Comment 11 Matthias Clasen 2011-06-07 00:36:18 UTC
This was fixed by renaming the marshallers, a while ago.

commit 95904a5a1bd497bc3f7606285301e1ef873ce7fc
Author: Kalev Lember <kalev@smartlink.ee>
Date:   Fri Apr 29 11:42:20 2011 +0300

    perf: Use different marshaller prefix than in gtk
    
    Avoids multiple symbol definitions in gtk/gtkmarshalers.c
    and perf/marshalers.c when both objects are linked in.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=648926