You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Marc Gràcia <mg...@oasyssoft.com> on 2005/05/02 09:53:18 UTC

Re: [mp2] modperl2 compile error

I had some problems like this on my new x86_64 machine with mod_perl2,
seems that not only perl must be compiled with -fPIC , also apache and
all libraries or modules you plan to use. I think it's a general issue
with this architecture, not mod_perl related.
If not, there are runtime linking relocation errors everywhere.. (I also
had to recompile with -fPIC db and libz, for example)
Maybe that's the problem...

El dv 29 de 04 del 2005 a les 23:25 -0700, en/na Stas Bekman va
escriure:

> Tom Caldwell wrote:
> > Stas,
> > 
> > I forgot to mention that apache usually runs under a different account
> > than nobody (I use - apache), in case that matters.
> 
> Of course. In which case you need to check 'apache' instead of 'nobody'.
> 
> > Also, I apologize for not cc'ing the list on the last message but I
> > normally use the mail client from my desktop machine instead of this
> > Ximian client on red hat and I am not used to the client not doing the
> > cc for me.
> 
> No worries.
> 
>  > Yes, I noticed that nobody was having trouble finding libperl.so, but it
>  > seemed very strange that none of the other tests failed.
>  >
>  > Anyway, I tried to
>  > su - nobody
>  > which failed because the shell was set to /sbin/nologin.
> 
> su - apache
> 
>  > So I fixed that (set shell to bash) and set the .bashrc file to set the
>  > LD_LIBRARY_PATH to
>  > /opt/perl/lib/5.8.6/x86_64-linux/CORE:/opt/apache2/server/lib/:/usr/lib64
>  > so it can find libperl.so
>  > /opt/perl/bin/perl -V then ran correctly from the nobody account.
>  >
>  > Then I reran the tests and got the same failures here is the test report
>  > (see below).
>  >
>  > Also, I was able to run the 4 scripts in t/htdocs/util - argv.pl
>  > env.pl  in_err.pl  in_out.pl
>  >
>  > They seemed to work fine except env.pl did not print anything.
>  >
>  > Thanks for looking into this,
>  >
>  > Tom
>  >
>  > P.S. Here is the other info you asked for.
>  >
>  > First line of t/TEST is
>  > #!/opt/perl/bin/perl
>  >
>  > ldd /opt/perl/bin/perl
>  >         libperl.so => /opt/perl/lib/5.8.6/x86_64-linux/CORE/libperl.so
>  > (0x0000002a9566d000)
> 
> is it possible that this path it not readable by user 'apache'? I doubt 
> so, since all other tests run just fine.
> 
> what if you change one of these scripts (.e.g. t/htdocs/argv.pl) to be:
> 
> #!/bin/sh
> 
> printenv > /tmp/dump
> ldd /opt/perl/bin/perl >> /tmp/dump
> 
> and run the subprocess test? This will show what the environment this 
> subprocess script is running under.
> 

Re: [mp2] modperl2 compile error

Posted by Marc Gràcia <mg...@oasyssoft.com>.
El dc 04 de 05 del 2005 a les 10:09 -0500, en/na Tom Caldwell va
escriure:

> I have to concur with Marc - that there was no -fPIC and the 
> necessary libraries were missing as well on my x86_64 red hat box. 
> This seems to be happening with all the builds - perl, mod_perl, 
> and probably apache too.

Ok,
If Perl is configured OK, mod_perl gets the args from Perl and
everytning goes well, the same on all normal Makefile.PL building
modules. 
But you must take care that the rests of things you had to use are
compiled also with -fPIC.
All RedHat or Fedora default builds seems to have been compiled that
way, so no problems for default libs.

>  (I haven't had a chance to get back to 
> rebuilding apache as last suggested.) Different from Marc, I have 
> been working as root, but still experiencing the same problems.
> 
> The other thing I noticed was that a random directory (from the src 
> tree) was added to the CCDLFLAGS when I added  '-rdynamic -W1' 
> during configure (as per the rpm version of perl). I had to remove 
> this manually from the Makefile.
> 
> Tom
> 
> --On Wednesday, May 04, 2005 12:09 PM +0200 Marc Gràcia 
> <mg...@oasyssoft.com> wrote:
> 
> > El dl 02 de 05 del 2005 a les 10:05 -0700, en/na Stas Bekman va
> > escriure:
> >
> >
> >
> > Marc Gràcia wrote:
> >> I had some problems like this on my new x86_64 machine with
> >> mod_perl2, seems that not only perl must be compiled with -fPIC
> >> , also apache and all libraries or modules you plan to use. I
> >> think it's a general issue with this architecture, not mod_perl
> >> related.
> >
> > That's correct, Marc.
> >
> >> If not, there are runtime linking relocation errors everywhere..
> >> (I also had to recompile with -fPIC db and libz, for example)
> >> Maybe that's the problem...
> >
> > I supposed that Tom has recompiled everything after rebuilding
> > perl.
> > mod_perl will pick up -fPIC automatically at compile time, if
> > perl was
> > compiled with it.
> >
> >
> > Yes that's Ok for all perl modules.
> > But BTW, my Perl Compilation did not put automaticaly the -fPIC
> > flag when configuring and also didn't detect the needed libraries
> > (The line when Config script lets you add additional libraries
> > was empty except for the ones i compiled for myself, see below).
> > I had to put all that manually (After a lot of recompilations
> > trying to find what was happening)
> >
> > I was using a closed environment in a user with no root
> > permissions. All dependencies except most basic ones
> > (libc,lpthreads,etc..) are compiled and self contained in the
> > user's home (I'm doing a untar-and-forget instalation for our
> > product).
> > The same procedure went OK on all other kind of machines... so
> > maybe perl Config has some problem with x86_64.
> > The base system was a Fedora Core 3 EM64T version with no 32bits
> > compatibility packages installed.
> > But everything is running OK after all, only the Configure script
> > failed..
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > Marc Gràcia <mg...@oasyssoft.com>
> 
> 
> 
> 
> Tom Caldwell
> Vanderbilt University Medical Center
> 
> 

Re: [mp2] modperl2 compile error

Posted by Tom Caldwell <to...@vanderbilt.edu>.
I have to concur with Marc - that there was no -fPIC and the 
necessary libraries were missing as well on my x86_64 red hat box. 
This seems to be happening with all the builds - perl, mod_perl, 
and probably apache too. (I haven't had a chance to get back to 
rebuilding apache as last suggested.) Different from Marc, I have 
been working as root, but still experiencing the same problems.

The other thing I noticed was that a random directory (from the src 
tree) was added to the CCDLFLAGS when I added  '-rdynamic -W1' 
during configure (as per the rpm version of perl). I had to remove 
this manually from the Makefile.

Tom

--On Wednesday, May 04, 2005 12:09 PM +0200 Marc Gràcia 
<mg...@oasyssoft.com> wrote:

> El dl 02 de 05 del 2005 a les 10:05 -0700, en/na Stas Bekman va
> escriure:
>
>
>
> Marc Gràcia wrote:
>> I had some problems like this on my new x86_64 machine with
>> mod_perl2, seems that not only perl must be compiled with -fPIC
>> , also apache and all libraries or modules you plan to use. I
>> think it's a general issue with this architecture, not mod_perl
>> related.
>
> That's correct, Marc.
>
>> If not, there are runtime linking relocation errors everywhere..
>> (I also had to recompile with -fPIC db and libz, for example)
>> Maybe that's the problem...
>
> I supposed that Tom has recompiled everything after rebuilding
> perl.
> mod_perl will pick up -fPIC automatically at compile time, if
> perl was
> compiled with it.
>
>
> Yes that's Ok for all perl modules.
> But BTW, my Perl Compilation did not put automaticaly the -fPIC
> flag when configuring and also didn't detect the needed libraries
> (The line when Config script lets you add additional libraries
> was empty except for the ones i compiled for myself, see below).
> I had to put all that manually (After a lot of recompilations
> trying to find what was happening)
>
> I was using a closed environment in a user with no root
> permissions. All dependencies except most basic ones
> (libc,lpthreads,etc..) are compiled and self contained in the
> user's home (I'm doing a untar-and-forget instalation for our
> product).
> The same procedure went OK on all other kind of machines... so
> maybe perl Config has some problem with x86_64.
> The base system was a Fedora Core 3 EM64T version with no 32bits
> compatibility packages installed.
> But everything is running OK after all, only the Configure script
> failed..
>
>
>
>
>
>
>
>
> --
> Marc Gràcia <mg...@oasyssoft.com>




Tom Caldwell
Vanderbilt University Medical Center


Re: [mp2] modperl2 compile error

Posted by Stas Bekman <st...@stason.org>.
Tom Caldwell wrote:
> Stas and Marc,
> 
> So after a week hiatus I was finally able to return to my 
> Perl/ModPerl2/Apache2 woes on my Dell 64bit box running redhat linux.
> 
> When we last left the main saga, I had just rebuilt perl and modperl 
> with the -fPIC flag only to find that the tests for subprocess.t would 
> not work. I tried several suggestions from Stas but nothing worked. Mark 
> suggested recompiling apache as well and that was to be my next step 
> before I was sidelined by other issues.
> 
> When I rebuilt apache today, the modperl tests still failed at 
> subprocess.t even after another modperl rebuild. So I did another 
> reinstall of perl. This time during the configure operation when the 
> script prompted for directories to search for standard libs the defaults 
> were /usr/local/lib /lib /usr/lib (as before). After checking out the 
> original redhat installed version of perl (from rpm vesion 5.8.0), I 
> noticed that it used mostly libs from /lib64 and /usr/lib64. So I 
> overrode the defaults for this question with - /lib /usr/lib /lib64 
> /usr/lib64. Then when I got to the prompt for default libs it had all 
> the ones I needed as the default value which it had failed to do before. 
> I still had to change the link flags from -fpic to -fPIC and replace the 
> default link switches with values I found in the redhat perl, but then 
> all of the tests for perl and modperl passed.
> 
> I did not even have to rebuild apache after that.

Great. Tom any chance you could write a simple step by step document of 
what you have done, including commands for other users who will hit the 
same problem? we can add it to the troubleshooting docs. Thanks!

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: [mp2] modperl2 compile error

Posted by Tom Caldwell <to...@vanderbilt.edu>.
Stas and Marc,

So after a week hiatus I was finally able to return to my 
Perl/ModPerl2/Apache2 woes on my Dell 64bit box running redhat 
linux.

When we last left the main saga, I had just rebuilt perl and 
modperl with the -fPIC flag only to find that the tests for 
subprocess.t would not work. I tried several suggestions from Stas 
but nothing worked. Mark suggested recompiling apache as well and 
that was to be my next step before I was sidelined by other issues.

When I rebuilt apache today, the modperl tests still failed at 
subprocess.t even after another modperl rebuild. So I did another 
reinstall of perl. This time during the configure operation when 
the script prompted for directories to search for standard libs the 
defaults were /usr/local/lib /lib /usr/lib (as before). After 
checking out the original redhat installed version of perl (from 
rpm vesion 5.8.0), I noticed that it used mostly libs from /lib64 
and /usr/lib64. So I overrode the defaults for this question with - 
/lib /usr/lib /lib64 /usr/lib64. Then when I got to the prompt for 
default libs it had all the ones I needed as the default value 
which it had failed to do before. I still had to change the link 
flags from -fpic to -fPIC and replace the default link switches 
with values I found in the redhat perl, but then all of the tests 
for perl and modperl passed.

I did not even have to rebuild apache after that.

So, thanks for all your help,

Tom

--On Thursday, May 05, 2005 10:23 PM -0700 Stas Bekman 
<st...@stason.org> wrote:

> Marc Gràcia wrote:
>> El dl 02 de 05 del 2005 a les 10:05 -0700, en/na Stas Bekman va
>> escriure:
>>
>>
>>> Marc Gràcia wrote:
>>>
>>>> I had some problems like this on my new x86_64 machine with
>>>> mod_perl2, seems that not only perl must be compiled with
>>>> -fPIC , also apache and all libraries or modules you plan to
>>>> use. I think it's a general issue with this architecture, not
>>>> mod_perl related.
>>>
>>> That's correct, Marc.
>>>
>>>
>>>> If not, there are runtime linking relocation errors
>>>> everywhere.. (I also had to recompile with -fPIC db and libz,
>>>> for example) Maybe that's the problem...
>>>
>>> I supposed that Tom has recompiled everything after rebuilding
>>> perl.  mod_perl will pick up -fPIC automatically at compile
>>> time, if perl was  compiled with it.
>>
>>
>> Yes that's Ok for all perl modules.
>> But BTW, my Perl Compilation did not put automaticaly the -fPIC
>> flag when configuring and also didn't detect the needed
>> libraries (The line when Config script lets you add additional
>> libraries was empty except for the ones i compiled for myself,
>> see below).
>> I had to put all that manually (After a lot of recompilations
>> trying to find what was happening)
>>
>> I was using a closed environment in a user with no root
>> permissions. All dependencies except most basic ones
>> (libc,lpthreads,etc..) are compiled and self contained in the
>> user's home (I'm doing a untar-and-forget instalation for our
>> product).
>> The same procedure went OK on all other kind of machines... so
>> maybe perl Config has some problem with x86_64.
>> The base system was a Fedora Core 3 EM64T version with no 32bits
>> compatibility packages installed.
>> But everything is running OK after all, only the Configure script
>> failed..
>
> Marc, you may want to ask perl5-porters to help you with this
> issue. As you have figured out, mod_perl just picks perl's flags,
> so it's a perl issue.
>
> --
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com




Tom Caldwell
Vanderbilt University Medical Center


Re: [mp2] modperl2 compile error

Posted by Stas Bekman <st...@stason.org>.
Marc Gràcia wrote:
> El dl 02 de 05 del 2005 a les 10:05 -0700, en/na Stas Bekman va
> escriure:
> 
> 
>>Marc Gràcia wrote:
>>
>>>I had some problems like this on my new x86_64 machine with mod_perl2,
>>>seems that not only perl must be compiled with -fPIC , also apache and
>>>all libraries or modules you plan to use. I think it's a general issue
>>>with this architecture, not mod_perl related.
>>
>>That's correct, Marc.
>>
>>
>>>If not, there are runtime linking relocation errors everywhere.. (I also
>>>had to recompile with -fPIC db and libz, for example)
>>>Maybe that's the problem...
>>
>>I supposed that Tom has recompiled everything after rebuilding perl. 
>>mod_perl will pick up -fPIC automatically at compile time, if perl was 
>>compiled with it.
> 
> 
> Yes that's Ok for all perl modules.
> But BTW, my Perl Compilation did not put automaticaly the -fPIC flag
> when configuring and also didn't detect the needed libraries (The line
> when Config script lets you add additional libraries was empty except
> for the ones i compiled for myself, see below).
> I had to put all that manually (After a lot of recompilations trying to
> find what was happening)
> 
> I was using a closed environment in a user with no root permissions. All
> dependencies except most basic ones (libc,lpthreads,etc..) are compiled
> and self contained in the user's home (I'm doing a untar-and-forget
> instalation for our product).
> The same procedure went OK on all other kind of machines... so maybe
> perl Config has some problem with x86_64.
> The base system was a Fedora Core 3 EM64T version with no 32bits
> compatibility packages installed.
> But everything is running OK after all, only the Configure script
> failed..

Marc, you may want to ask perl5-porters to help you with this issue. As 
you have figured out, mod_perl just picks perl's flags, so it's a perl issue.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: [mp2] modperl2 compile error

Posted by Marc Gràcia <mg...@oasyssoft.com>.
El dl 02 de 05 del 2005 a les 10:05 -0700, en/na Stas Bekman va
escriure:

> Marc Gràcia wrote:
> > I had some problems like this on my new x86_64 machine with mod_perl2,
> > seems that not only perl must be compiled with -fPIC , also apache and
> > all libraries or modules you plan to use. I think it's a general issue
> > with this architecture, not mod_perl related.
> 
> That's correct, Marc.
> 
> > If not, there are runtime linking relocation errors everywhere.. (I also
> > had to recompile with -fPIC db and libz, for example)
> > Maybe that's the problem...
> 
> I supposed that Tom has recompiled everything after rebuilding perl. 
> mod_perl will pick up -fPIC automatically at compile time, if perl was 
> compiled with it.

Yes that's Ok for all perl modules.
But BTW, my Perl Compilation did not put automaticaly the -fPIC flag
when configuring and also didn't detect the needed libraries (The line
when Config script lets you add additional libraries was empty except
for the ones i compiled for myself, see below).
I had to put all that manually (After a lot of recompilations trying to
find what was happening)

I was using a closed environment in a user with no root permissions. All
dependencies except most basic ones (libc,lpthreads,etc..) are compiled
and self contained in the user's home (I'm doing a untar-and-forget
instalation for our product).
The same procedure went OK on all other kind of machines... so maybe
perl Config has some problem with x86_64.
The base system was a Fedora Core 3 EM64T version with no 32bits
compatibility packages installed.
But everything is running OK after all, only the Configure script
failed..



> 

-- 
Marc Gràcia <mg...@oasyssoft.com>

Re: [mp2] modperl2 compile error

Posted by Stas Bekman <st...@stason.org>.
Marc Gràcia wrote:
> I had some problems like this on my new x86_64 machine with mod_perl2,
> seems that not only perl must be compiled with -fPIC , also apache and
> all libraries or modules you plan to use. I think it's a general issue
> with this architecture, not mod_perl related.

That's correct, Marc.

> If not, there are runtime linking relocation errors everywhere.. (I also
> had to recompile with -fPIC db and libz, for example)
> Maybe that's the problem...

I supposed that Tom has recompiled everything after rebuilding perl. 
mod_perl will pick up -fPIC automatically at compile time, if perl was 
compiled with it.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com