如何将共享库列入黑名单以避免加载程序将其获取? [英] How to blacklist a shared library to avoid it being fetched by the loader?

查看:51
本文介绍了如何将共享库列入黑名单以避免加载程序将其获取?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图强制用于内置源的内部编译器不依赖主机中安装的共享库,而不必卸载它们.

I'm trying to force a build internal pre-processor used for built-sources to not rely on shared libraries installed in my host machine without having to uninstall them.

尽管存在一个 LD_PRELOAD 环境变量,该变量强制加载程序(ld-linux)在执行其他操作之前先获取指定的共享库,但我想做相反的事情,迫使加载程序<强烈建议不要在设置过程中获取指定的库(种类为 LD_NEVERLOAD 变量).

Although there is a LD_PRELOAD environment variable which forces the loader (ld-linux) to fetch the specified shared libraries before anything else, I'd like to do quite the opposite, forcing the loader not to fetch the specified libraries during the setup process (kind of LD_NEVERLOAD variable).

是否有某种方法可以在不破坏我的整个系统的情况下(也就是删除此类库)?

Is there some way to do so without breaking my entire system (aka, removing such libraries)?

PS:我已重命名系统库以测试此特定用例,但这绝对不是一种优雅的方法.

PS: I've renamed my system libraries to test this specific use case, but this is definitely not an elegant way of doing so.

推荐答案

阅读手册页 ld(1) ld.so(8)您可以尝试播放在两个手册中都有与相关的 LD_LIBRARY_PATH LD_RUNPATH 和选项.

Reading the manual pages ld(1) and ld.so(8) you might try playing with LD_LIBRARY_PATH, LD_RUNPATH and options in both manuals which are related to "rpath".

这篇关于如何将共享库列入黑名单以避免加载程序将其获取?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆