有没有建立一个没有在Linux上的文字定位信息的libxml2的一种方式?
题
下午好,
我有libxml2的困难。
我试图建立Perl的模块XML-的libxml这是我们的标准的运行时环境的一部分。不过,这一次在RHEL5箱安装失败,因为在生成过程抱怨缺少的libxml2:
$> perl Makefile.PL LIB=/foo/lib/perl PREFIX=/foo INSTALLDIRS=site enable native perl UTF8 running xml2-config...ok (2.7.6) looking for -lxml2... no looking for -llibxml2... no libxml2 not found
但是,该文件是可用的。与开始构建
perl Makefile.PL LIB=/usr/inform/target/lib/perl PREFIX=/usr/inform/target INSTALLDIRS=site
导致真正的问题的更多证据:
[...] Can't load 'blib/arch/auto/Conftest/Conftest.so' for module Conftest: /usr/inform/target/lib/libxml2.so.2: cannot restore segment prot after reloc: Permission denied at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230. at test.pl line 2 [...]
一些调查后我发现,这个问题似乎是libxml2.so
与文本搬迁创建的:
[tess91@INF-AW] lib$ eu-findtextrel libxml2.so.2.7.6 the file containing the function 'get_crc_table' is not compiled with -fpic/-fPIC the file containing the function 'crc32' is not compiled with -fpic/-fPIC the file containing the function 'gzerror' is not compiled with -fpic/-fPIC [...]
答,因为我们有SELinux的目标计算机上的活动,链接到的libxml.2失败!
是否有可能正确地创建libxml2
,还是我要问管理员扭曲SELinux的允许重定位?
我真的不敢相信我有SELinux的活跃在Linux上这个问题olny之一。我缺少什么?
任何帮助apprecitated!
此致 斯蒂芬
解决方案 2
我刚刚找到一个可能的解释:
期间的libxml2的版本所编译器标志-fPIC确实使用,所以代码被创建位置独立的,的 BUT 强>:
当创建的共享库,静态libz进行抵抗它的联系。那是我的问题的根源?使得包括在共享可执行静态库通过引入非重定位代码玷污库?
这符号EU-findtextrel应该已经指出我在该方向上,由于crc32
,get_crc_table
等看起来像加密居中代码的事实...
其他提示
最简单的方法是让你的管理员yum install libxml2-devel
甚至yum install perl-XML-LibXML
。否则,看你能不能在-fPIC
添加Makefile.PL
到CFLAGS。
我想你是在32位的x86,任何其它架构不会没有-fPIC
工作。
不隶属于 StackOverflow