GNOME Bugzilla – Bug 346559
static build has issues with the "perf" directory
Last modified: 2011-06-07 00:36:18 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 ..."
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/.
That can't be the right fix. Why does the perf directory contain duplicate marshallers in the first place ?
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.
I'm blocking this bug on bug 346531 as I think the ENABLE_SHARED flag is what we want here too.
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
While I still don't agree that this is entirely the right fix, just go ahead and commit it if you want.
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?
Hello, the patch attached is a bit old. Is still a valid patch?
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'
Created attachment 147921 [details] [review] Don't build perf in static builds due to duplication of marshallers.v3
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