GNOME Bugzilla – Bug 561524
gjs-console also needs rpath for libmozjs.so
Last modified: 2010-02-16 23:32:36 UTC
$ ldd /usr/bin/gjs-console libgjs.so.0 => /usr/lib/libgjs.so.0 (0xb7f6f000) libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb7f6a000) libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb7f2c000) libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7e75000) libmozjs.so => not found libplds4.so.0d => /usr/lib/libplds4.so.0d (0xb7e71000) libplc4.so.0d => /usr/lib/libplc4.so.0d (0xb7e6c000) libnspr4.so.0d => /usr/lib/libnspr4.so.0d (0xb7e35000) libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7e1c000) libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7e18000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7cba000) libmozjs.so => /usr/lib/xulrunner-1.9.0.4/libmozjs.so (0xb7c26000) libpcre.so.3 => /lib/libpcre.so.3 (0xb7bfb000) /lib/ld-linux.so.2 (0xb7fa3000) libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7bd5000)
Created attachment 123037 [details] [review] add ldflags for gjs-console Should "-R $(FIREFOX_JS_LIBDIR) -rdynamic" actually be in gjs-1.0.pc.in as part of "Libs:"?
From libtool manual, `-R LIBDIR' If OUTPUT-FILE is a program, add LIBDIR to its run-time path. If OUTPUT-FILE is a library, add -RLIBDIR to its DEPENDENCY_LIBS, so that, whenever the library is linked into a program, LIBDIR will be added to its run-time path. So if we have -R for libgjs, gjs-console should not require it, as I read that ... The other thing we could do is install gjs-console as a wrapper script that sets LD_LIBRARY_PATH.
I think this patch should go in, I ended up writing an identical in my tree. For some reason -rpath/-R is not working properly with our libtool/automake combination.
Err, considering that 1) it breaks only in some exceptional cases and 2) according to documentation we're doing the right thing, shouldn't that be considered a bug in libtool/automake (until proven otherwise at which point we can fix gjs) ?
Tommi: It breaks for all known users of gjs, including gnome-shell and at litl. All of them currently set LD_LIBRARY_PATH to xulrunners libdir, which is broken, it should just run out of the box. Yes it might be a big in libtool/automake but we can fix it instead of waiting for the long cycle of them to be fixed & released & included in stable distributions.
Ping? I still want this to go in, this happens on all my machines (which are Ubuntu based). There are no downsides of adding LD_LIBRARY_PATH, it won't do anything nasty on working machines, just adding a bit of ugliness to an imperfect world.
Tommi, whats the "exceptional cases" you are refering to? I also still like to commit this.
Created attachment 153981 [details] [review] [gjs-console] Add -rpath for libmozjs.so This should not be needed by libtool, but as libtool is broken we need to pass it in anyway. This has been done in practice by both gnome-shell and other projects using gjs.
The following fix has been pushed: db40281 [gjs-console] Add -rpath for libmozjs.so
Created attachment 153982 [details] [review] [gjs-console] Add -rpath for libmozjs.so This should not be needed by libtool, but as libtool is broken we need to pass it in anyway. This has been done in practice by both gnome-shell and other projects using gjs.