Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Futureproof firefox rpath example #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasom
Copy link

@jasom jasom commented Jun 2, 2017

After a firefox upgrade, merely patching libxul.so was insufficient to
get apulse working on my machine.

In addition I use $LIB instead of lib so that the example can be used
unchanged for 32-bit applications on 64-bit hosts.

Also, since it uses find and file, it could theoretically be used to
patch an entire /usr tree safely. Whether or not to recommend this in
the readme I leave up to future changes.

After a firefox upgrade, merely patching libxul.so was insufficient to
get apulse working on my machine.

In addition I use $LIB instead of lib so that the example can be used
unchanged for 32-bit applications on 64-bit hosts.

Also, since it uses find and file, it could theoretically be used to
patch an entire /usr tree safely.  Whether or not to recommend this in
the readme I leave up to future changes.
@i-rinat
Copy link
Owner

i-rinat commented Jun 6, 2017

That part of README file is just an example, not a full working solution. And I'd like to keep it that way. Changing it to a larger expression encourages to copy-paste it. But despite effort of making it compatible ($LIB special value), it probably won't work for many installations. For example in Debian/Ubuntu, apulse libraries could be in triplet directories, like /usr/lib/x86_64-linux-gnu/apulse.

I also did some tests regarding RPATH. Actually, it should work if firefox binary is modified. And it kind of does. I can see in traces that the directory is probed when firefox loads other libraries. But at some point it just forgets about additional path. I think, this is somehow related to libmozsandbox.so. In trace, it starts a new namespace, which probably throws away all additional paths. Setting RPATH on libxul.so works because it's loaded after.

In tests I performed just now, setting RPATH to libxul.so is still enough for official build of Firefox 53.0.3.

@i-rinat
Copy link
Owner

i-rinat commented Jun 6, 2017

to patch an entire /usr tree

This makes no sense, as it's just equivalent of making apulse libraries accessible to any application. In that case, it's easier to just put them to /usr/lib or /usr/local/lib.

@i-rinat
Copy link
Owner

i-rinat commented Jun 6, 2017

During tests I also found another way to teach Firefox about apulse. It is sufficient to copy (or make symlinks) libpulse.so.0 and libpulse-simple.so.0 to Firefox binary directory. firefox searches for libraries in its own directory too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants