title: Is there a way to build a libxml2 without text relocations on Linux?
body: <p>Good afternoon,</p>
  
  <p>I am having difficulties with libxml2.</p>
  
  <p>I tried to build the Perl module XML-LibXML which is part of our standard runtime environment. However, this time the installation on a RHEL5 box failed, because the build process complained about missing libxml2:</p>
  
  <pre>
  $> 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
  </pre>
  
  <p>However, the file was available. Starting the build with</p>
  
  <pre>
  perl Makefile.PL LIB=/usr/inform/target/lib/perl PREFIX=/usr/inform/target INSTALLDIRS=site
  </pre>
  
  <p>led to more evidence of the real problem:</p>
  
  <pre>
  [...]
  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
  [...]
  </pre>
  
  <p>After some investigations I found that the problem appears to be that <code>libxml2.so</code> is created with text relocation:</p>
  
  <pre>
  [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
  [...]
  </pre>
  
  <p>Ans since we have SElinux active on the target machine, linking against libxml.2 failed!</p>
  
  <p>Is there any possibility to create <code>libxml2</code> properly, or do I have to ask the admin to twist SElinux to allow relocations?</p>
  
  <p>I really can't believe I am the olny one having this problem on Linux with SElinux active.  What am I missing?</p>
  
  <p>Any help apprecitated!</p>
  
  <p>Regards,
  Stefan</p>