Shipping GNU/Linux Firefox plugin with shared libraries (for installation with no root access)

旧街凉风 提交于 2019-12-21 05:31:19

问题


The application is a Firefox plugin (loaded from $HOME/.mozilla/plugins), so wrapper script that sets LD_LIBRARY_PATH is not an easy option.

RPATH, as far as I know, cannot refer to $HOME and can be only absolue path.

Firefox tries to dlopen it's plugin from ~/.mozilla/plugins but fails (because it depends on shared libraries installed somewhere in the user home directory).

Modifying Firefox menu item to provide a wrapper (with LD_LIBRARY_PATH) around Firefox is too hacky.

What should installer script do (without root access) to make standard firefox load plug-ins that depends on out shared library?

  1. Should I just try to make embed everything into that .so to remove dependencies?
  2. Should I try to make installer script to finish linking or patch RPATH during the installation phase?

回答1:


Set RPATH to $ORIGIN/lib so the loader will look for libraries relative to the my file.

Script just unpacks the plugin to $HOME/.mozilla/plugins/myplugin.so and libraries to $HOME/.mozilla/plugins/lib/

rpath can be specified to linker though the gcc by adding Wl,-rpath,'$ORIGIN/lib' ($ should be doubled in a Makefile) and can also be changed after compilation by patchelf.



来源:https://stackoverflow.com/questions/3015411/shipping-gnu-linux-firefox-plugin-with-shared-libraries-for-installation-with-n

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!