RESOLVED FIXED Bug 132220
[GTK] GObject introspection links to installed libs when using jhbuild
https://bugs.webkit.org/show_bug.cgi?id=132220
Summary [GTK] GObject introspection links to installed libs when using jhbuild
Carlos Garcia Campos
Reported 2014-04-26 03:16:00 PDT
See: /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/Source/WebKit2/tmp-introspecttMzAlB/WebKit2WebExtension-3.0.o:(.data+0x4b8): referencia a `webkit_dom_vtt_cue_get_type' sin definir (this is undefined reference in English) collect2: error: ld returned 1 exit status linking of temporary binary failed: Command '['/home/cgarcia/src/git/icecream/bin/cc', '-o', '/home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/Source/WebKit2/tmp-introspecttMzAlB/WebKit2WebExtension-3.0', '-Wno-deprecated-declarations', '-L/home/cgarcia/gnome/lib64', '/home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/Source/WebKit2/tmp-introspecttMzAlB/WebKit2WebExtension-3.0.o', '-L.', '-Wl,-rpath=.', '-Wl,--no-as-needed', '-lwebkit2gtk-3.0', '-ljavascriptcoregtk-3.0', '-L/home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib', '-Wl,-rpath=/home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib', '-Wl,--export-dynamic', '-pthread', '-L/home/cgarcia/gnome/lib64', '-lgmodule-2.0', '-lgtk-3', '-lgdk-3', '-latk-1.0', '-lpangocairo-1.0', '-lgdk_pixbuf-2.0', '-lcairo-gobject', '-lpango-1.0', '-lcairo', '-lsoup-2.4', '-lgio-2.0', '-lgobject-2.0', '-lglib-2.0']' returned non-zero exit status 1 As you can see there's two -L/home/cgarcia/gnome/lib64, and the first one is very early an takes precedence. That first one comes from the LDFLAGS env varaibles that jhbuild sets. The other one, which is correctly set after the builddir paths, is deduced by g-ir-scanner from the lib arguments passed using ldd. This didn't happen with autotools because g-ir-scanner used libtool. This is not a problem when using the internal jhbuild because we never run make install for webkit, only for the dependencies, so the linker never finds a installed webkit in jhbuild env. Since we are already overriding the CFLAGS env var we can simply override LDFLAGS as well to unset it, since g-ir-scanner will do the right thing deducing all library paths using ldd.
Attachments
Patch (2.04 KB, patch)
2014-04-26 03:22 PDT, Carlos Garcia Campos
mrobinson: review+
Carlos Garcia Campos
Comment 1 2014-04-26 03:22:03 PDT
Martin Robinson
Comment 2 2014-04-26 08:27:01 PDT
Comment on attachment 230240 [details] Patch Seems reasonable, though I wonder if some flags should be passed through. What is the value of LDFLAGS that is causing the incorrect link.
Carlos Garcia Campos
Comment 3 2014-04-26 12:03:20 PDT
(In reply to comment #2) > (From update of attachment 230240 [details]) > Seems reasonable, though I wonder if some flags should be passed through. What is the value of LDFLAGS that is causing the incorrect link. $ jhbuild run env | grep LDFLAGS LDFLAGS=-L/home/cgarcia/gnome/lib64 That's added later guessed from the deps. We are already overriding the CFLAGS as well. jhbuild sets the LDFLAGS env var to make sure the programs compiled during configure build against the jhbuild environment. Note that this only affects the temporary files compiled by gobject-introspection to generate the gir files, so I'm pretty sure it's safe to override the LDFLAGS.
Carlos Garcia Campos
Comment 4 2014-04-28 00:52:17 PDT
Ting-Wei Lan
Comment 5 2014-08-06 11:25:57 PDT
Ignoring LDFLAGS causes build failure on FreeBSD because it cannot find libintl via LDFLAGS.
Note You need to log in before you can comment on or make changes to this bug.