附带共享库的 GNU/Linux Firefox 插件(用于无需 root 访问权限的安装)
该应用程序是一个 Firefox 插件(从 $HOME/.mozilla/plugins 加载),因此设置 LD_LIBRARY_PATH 的包装脚本不是一个简单的选择。
据我所知,RPATH 不能引用 $HOME,只能是绝对路径。
Firefox 尝试从 ~/.mozilla/plugins 中 dlopen 它的插件,但失败了(因为它依赖于安装在用户主目录中某处的共享库)。
修改 Firefox 菜单项以提供围绕 Firefox 的包装器(使用 LD_LIBRARY_PATH)太hacky了。
安装程序脚本应该做什么(没有 root 访问权限)才能使标准的 Firefox 加载依赖于共享库的插件?
- 我是否应该尝试将所有内容嵌入到 .so 中以删除依赖项?
- 我应该在安装阶段尝试制作安装程序脚本来完成链接或修补 RPATH 吗?
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?
- Should I just try to make embed everything into that .so to remove dependencies?
- Should I try to make installer script to finish linking or patch RPATH during the installation phase?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 RPATH 设置为 $ORIGIN/lib ,以便加载器将查找与 my 文件相关的库。
脚本只是将插件解压到
$HOME/.mozilla/plugins/myplugin.so
并将库解压到$HOME/.mozilla/plugins/lib/
rpath 可以指定给链接器尽管 gcc 通过添加
Wl,-rpath,'$ORIGIN/lib'
($
应在 Makefile 中加倍),并且也可以在编译后通过进行更改补丁。
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 bypatchelf
.