You are not logged in.

#1 2010-04-09 03:22:00

ConnorBehan
Package Maintainer (PM)
From: Long Island NY
Registered: 2007-07-05
Posts: 1,359
Website

Does xulrunner depend on GNOME or not?

Hi... I have two questions (the rest is just me talking about how confused I am):

1. How is mozilla getting its files to use shared libraries even when they aren't linked against those shared libraries?
2. How can I tell if it's safe to delete a shared library that is used in only this way?

=====

I know xulrunner comes with two files in /usr/lib/xulrunner-1.9.2/components that bring in gnome dependencies: libmozgnome.so and libnkgnomevfs.so. Firefox also comes with libnkgnomevfs.so but according to this bug https://bugzilla.mozilla.org/show_bug.cgi?id=512671 it's not supposed to.

I'm wondering how these libraries actually get used.

[root@connors-laptop firefox-3.6]# cd /usr/lib/firefox-3.6
[root@connors-laptop firefox-3.6]# ldd firefox | grep gnome
[root@connors-laptop firefox-3.6]# cd /usr/lib/xulrunner-1.9.2/
[root@connors-laptop xulrunner-1.9.2]# ldd libxul.so | grep gnome
[root@connors-laptop xulrunner-1.9.2]# ldd libxpcom.so | grep gnome
[root@connors-laptop xulrunner-1.9.2]# ldd libmozjs.so | grep gnome
[root@connors-laptop xulrunner-1.9.2]#

As far as I can tell... NOTHING is linked against them. However the situation gets even weirder. I know that libxul and libxpcom are essential for firefox, yet firefox seems not to be linked against them either:

[root@connors-laptop firefox-3.6]# ldd firefox | grep libxul
[root@connors-laptop firefox-3.6]# ldd firefox | grep libxpcom
[root@connors-laptop firefox-3.6]# grep libxul firefox
Binary file firefox matches
[root@connors-laptop firefox-3.6]# grep libxpcom firefox
Binary file firefox matches
[root@connors-laptop firefox-3.6]#

The binary seems to contain references to them but they are runtime references, not compile time references? It dynamically decides whether or not it should use those libraries when you start it? I tried figuring out where the gnome libraries are used this way and I think I found it:

[root@connors-laptop firefox-3.6]# cd /usr/lib/xulrunner-1.9.2/
[root@connors-laptop xulrunner-1.9.2]# grep gnome libxul.so 
Binary file libxul.so matches

Thunderbird is causing similar confusion with me. It is of course independent from xulrunner but it comes with a libmozgnome.so and I can't tell how it's used. Anecdotally everyone says it's safe to delete libmozgnome and libnkgnomevfs but how do I know this? If I deleted orphan libraries that things aren't linked against I would delete libxul, libxpcom and libmozjs which is obviously NOT okay to do.


6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.

Offline

#2 2010-04-09 07:22:53

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: Does xulrunner depend on GNOME or not?

first i find your investigation a bit confusing  and you seem to hate gnome a lot since you starting to search on your system for files with gnome names in it.

the simple fact that xulrunner and thunderbird have those is because we compiled the support for it.
http://repos.archlinux.org/wsvn/package … k/PKGBUILD

libgnomeui is a makedepends and an optional dependency.


Give what you have. To someone, it may be better than you dare to think.

Offline

#3 2010-04-09 21:46:29

ConnorBehan
Package Maintainer (PM)
From: Long Island NY
Registered: 2007-07-05
Posts: 1,359
Website

Re: Does xulrunner depend on GNOME or not?

Yes, this was what originally made me want to rid my system of libgnome: http://bbs.archlinux.org/viewtopic.php?id=87490 so I'm glad that xulrunner doesn't absolutely require it.

But I still have no idea how firefox uses the file "libxul.so". I know it does but here according to ldd, the only library dependencies of firefox are:

linux-gate.so.1 =>  (0xb77c7000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7791000)
libdl.so.2 => /lib/libdl.so.2 (0xb778d000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7696000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb7679000)
libc.so.6 => /lib/libc.so.6 (0xb7532000)
/lib/ld-linux.so.2 (0xb77c8000)
libm.so.6 => /lib/libm.so.6 (0xb750b000)

It is using xulrunner somehow but it must involve some programming technique I have never learned.


6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.

Offline

#4 2010-04-09 22:17:19

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: Does xulrunner depend on GNOME or not?

checking only firefox binary is like scratching the surface. do a pacman -Ql firefox and you'll see a lot more files.

/usr/lib/firefox-3.6/components/libbrowsercomps.so is currently linking to libxul.so and i remember that firefox is loading all this stuff at runtime with LD_PRELOAD.


Give what you have. To someone, it may be better than you dare to think.

Offline

#5 2010-04-09 22:59:24

ConnorBehan
Package Maintainer (PM)
From: Long Island NY
Registered: 2007-07-05
Posts: 1,359
Website

Re: Does xulrunner depend on GNOME or not?

Ok so when I start the code... it is "deciding" whether to be linked against libmozgnome.so or not. Sounds a bit like self-modifying code to me. I was wondering because if I made a program that used gconf for example, even if I wanted it to be "optional" and put it in a section of the program that I considered "unimportant"... if I didn't have gconf installed I would absolutely get an undefined reference to symbol and nothing would work... even if I think it's "not a big deal."

I guess this LD_PRELOAD stuff is the solution. Firefox can first check if the right gnome deps are installed. If they are, it will load them at run time, if they are missing it will just move on. I guess this is how openoffice uses the "optional" gconf. It comes with a file called gconfbe1.uno.so but nothing is linked (at compile time) to it. This must mean it is loaded while openoffice runs because openoffice detected at runtime that I have gconf but if I didn't it would've skipped this dependency.

So ldd is not a good way to check if a program does this. I should use lsof to see if a program is dynamically loading libraries? And if I want to confirm my suspicions about how it does so I should grep the executable for phrases like "LD_PRELOAD", "LD_LIBRARY_PATH" or "dlopen"? I guess the ultimate way would be checking the source code if I have time.


6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.

Offline

#6 2010-04-10 22:57:35

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: Does xulrunner depend on GNOME or not?

take firefox from AUR/ABS
modify mozconfig (get rid of gnome)
Install new firefox and remove gnome. Since I don't have any use for gnome, it is gone from my system

Offline

#7 2010-04-15 03:38:57

smakked
Member
From: Gold Coast , Australia
Registered: 2008-08-14
Posts: 420

Re: Does xulrunner depend on GNOME or not?

broch wrote:

take firefox from AUR/ABS
modify mozconfig (get rid of gnome)
Install new firefox and remove gnome. Since I don't have any use for gnome, it is gone from my system

Just to clarify this, is this what you do

ac_add_options --disable-gnomeui
ac_add_options --disable-gnomevfs

Add that to mozconfig ?


Certified Android Junkie
Arch 64

Offline

#8 2010-04-15 12:45:32

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: Does xulrunner depend on GNOME or not?

smakked wrote:
broch wrote:

take firefox from AUR/ABS
modify mozconfig (get rid of gnome)
Install new firefox and remove gnome. Since I don't have any use for gnome, it is gone from my system

Just to clarify this, is this what you do

ac_add_options --disable-gnomeui
ac_add_options --disable-gnomevfs

Add that to mozconfig ?

yes,
also remove libgnomeui from dependencies in PKGBUILD

you can then get:
[~]$pacman -Q | grep gnome
[~]$
[~]$ pacman -Q | grep gtk
gtk2 2.20.0-2
gtkimageview 1.6.4-1
gtkmm 2.20.1-1
kdemod-extragear-gtk-qt-engine 1.1-6
pygtk 2.17.0-1

or less depending on your needs.

Offline

#9 2010-04-15 15:33:40

ConnorBehan
Package Maintainer (PM)
From: Long Island NY
Registered: 2007-07-05
Posts: 1,359
Website

Re: Does xulrunner depend on GNOME or not?

You can delete libgnomeui even without rebuilding firefox and xulrunner because it's only in makedepends and optdepends. But if you do this you will have the gnome components of mozilla on your system not being used. So a *cleaner* way to get rid of gnome is to modify the mozconfig if you have the time. It's kind of like disabling safebrowsing in about:config can stop google from seeing your history but recompiling firefox with --disable-safe-browsing will stop google from seeing your history AND make the firefox binary a bit lighter.


6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.

Offline

#10 2010-04-15 19:30:05

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: Does xulrunner depend on GNOME or not?

if you remove libgnomeui from system but not from PKGBUILD, then obviously compilation will fail.
Whole point is that to clean gnome from the system, you need to keep track of both mozconfig and PKGBUILD.
removing gnome dependencies from mozconfig only and leaving gnome installed does not seem to make much sense.

Offline

#11 2010-04-15 23:56:43

smakked
Member
From: Gold Coast , Australia
Registered: 2008-08-14
Posts: 420

Re: Does xulrunner depend on GNOME or not?

Thanks broch, worked like a charm

[root@]# pacman -Q | grep gnome
[root@]# pacman -Q | grep gtk
gtk-engine-equinox 1.1-1
gtk-engine-murrine-git 20100415-1
gtk-engines 2.20.0-1
gtk2 2.20.0-2
gtk2-perl 1.221-1
gtkmm 2.20.1-1
perl-gtk2-trayicon 0.06-3
pygtk 2.17.0-1
[root@ ]#

Certified Android Junkie
Arch 64

Offline

Board footer

Powered by FluxBB