You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Fred Moyer <fr...@redhotpenguin.com> on 2010/02/24 09:07:14 UTC

Re: Error: `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC

On Tue, Feb 23, 2010 at 10:53 PM, David E. Wheeler <da...@kineticode.com> wrote:
> Fellow mod_perlers,
>
> I found myself getting this error with mod_perl 2 on 64 bit CentOS this evening:
>
> bash-3.2# make test
> cd "src/modules/perl" && make
> make[1]: Entering directory `/home/dwheeler/mod_perl-2.0.4/src/modules/perl'
> rm -f mod_perl.so
> cc -shared -O2 -L/usr/local/lib -fstack-protector \
>         \
>        mod_perl.lo modperl_interp.lo modperl_tipool.lo modperl_log.lo modperl_config.lo modperl_cmd.lo modperl_options.lo modperl_callback.lo modperl_handler.lo modperl_gtop.lo modperl_util.lo modperl_io.lo modperl_io_apache.lo modperl_filter.lo modperl_bucket.lo modperl_mgv.lo modperl_pcw.lo modperl_global.lo modperl_env.lo modperl_cgi.lo modperl_perl.lo modperl_perl_global.lo modperl_perl_pp.lo modperl_sys.lo modperl_module.lo modperl_svptr_table.lo modperl_const.lo modperl_constants.lo modperl_apache_compat.lo modperl_error.lo modperl_debug.lo modperl_common_util.lo modperl_common_log.lo modperl_hooks.lo modperl_directives.lo modperl_flags.lo modperl_xsinit.lo modperl_exports.lo  -Wl,-E  -fstack-protector -L/usr/local/lib  -L/usr/local/lib/perl5/5.10.1/x86_64-linux/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lc \
>        -o mod_perl.so
> /usr/bin/ld: /usr/local/lib/perl5/5.10.1/x86_64-linux/CORE/libperl.a(op.o): relocation R_X86_64_32S against `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC
> /usr/local/lib/perl5/5.10.1/x86_64-linux/CORE/libperl.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make[1]: *** [mod_perl.so] Error 1
> make[1]: Leaving directory `/home/dwheeler/mod_perl-2.0.4/src/modules/perl'
> make: *** [modperl_lib] Error 2
>
> Really annoying. A Googling turned up this post from January:
>
>  http://www.gossamer-threads.com/lists/modperl/modperl/100854
>
> Too bad there was never a reply. Anyway, I can say that I set
>
>    export CFLAGS=-fPIC
>
> Before I built everything on this box, including Perl and Apache 2. Perl says:
>
>    bash-3.2# perl -V | grep PIC
>        cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
>
> So I'm at a loss here. Any ideas? mod_perl 2.04, perl 5.10.1, apache 2.2.14, all compiled from source.

Haven't tried with 5.10.1, but here's my 5.8.8/2.0.4/2.2.8 settings:

perl -V | grep -i fpic
    cc='cc', ccflags ='-fPIC -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    cppflags='-fPIC -I/usr/include/gdbm'
    cccdlflags='-fpic', lddlflags='-shared'

Have you tried passing -fPIC at perl configure time when it asks for
additional CFLAGS?

Re: Error: `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC

Posted by "David E. Wheeler" <da...@kineticode.com>.
On Feb 25, 2010, at 3:30 PM, Fred Moyer wrote:

> On Thu, Feb 25, 2010 at 3:11 PM, David E. Wheeler <da...@kineticode.com> wrote:
>> On Feb 25, 2010, at 3:03 PM, Fred Moyer wrote:
>> 
>>> Absolute - maybe in the INSTALL file?  You have commit access right?
>> 
>> Only to documentation IIRC. I got it just about the time I stopped writing docs. ;-)
> 
> I'd suggest either of these pod files:
> 
> "For an even more detailed documentation refer to:
> 
>  docs/user/install/install.pod
>  docs/user/config/config.pod"

Done in r921489. config.pod looks like it's only for configuring mod_perl2 to run, not for building mod_perl (or Perl), so I've only added a note to install.pod.

BTW, that doc looks different than what's on the site. Does the site need to be updated?

Best,

David


Re: Error: `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC

Posted by Fred Moyer <fr...@redhotpenguin.com>.
On Thu, Feb 25, 2010 at 3:11 PM, David E. Wheeler <da...@kineticode.com> wrote:
> On Feb 25, 2010, at 3:03 PM, Fred Moyer wrote:
>
>> Absolute - maybe in the INSTALL file?  You have commit access right?
>
> Only to documentation IIRC. I got it just about the time I stopped writing docs. ;-)

I'd suggest either of these pod files:

"For an even more detailed documentation refer to:

  docs/user/install/install.pod
  docs/user/config/config.pod"

Re: Error: `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC

Posted by "David E. Wheeler" <da...@kineticode.com>.
On Feb 25, 2010, at 3:03 PM, Fred Moyer wrote:

> Absolute - maybe in the INSTALL file?  You have commit access right?

Only to documentation IIRC. I got it just about the time I stopped writing docs. ;-)

Best,

David

Re: Error: `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC

Posted by Fred Moyer <fr...@redhotpenguin.com>.
On Thu, Feb 25, 2010 at 1:55 PM, David E. Wheeler <da...@kineticode.com> wrote:
> On Feb 24, 2010, at 11:31 AM, David E. Wheeler wrote:
>
>>> export CFLAGS='-m64 -mtune=nocona'; export LDFLAGS='-L/usr/lib64'
>>> ./Configure -des -A ccflags=-fPIC -Dprefix=/opt/perl
>>> -Dinstallprefix=/opt/perl
>>
>> Is that for Perl or for mod_perl? Looks like Perl.
>
> seems to have worked by rebuilding Perl with:
>
>    CFLAGS='-m64 -mtune=nocona' ./Configure -des -A ccflags=-fPIC
>
> Should this perhaps be documented somewhere?

Absolute - maybe in the INSTALL file?  You have commit access right?

>
> I did get a couple of test failures though:
>
> t/hooks/authen_basic.t ..................
> 1..4
> # Running under perl version 5.010001 for linux
> # Current time local: Thu Feb 25 16:50:03 2010
> # Current time GMT:   Thu Feb 25 21:50:03 2010
> # Using Test.pm version 1.25_02
> # Using Apache/Test.pm version 1.31
> ok 1
> ok 2
> ok 3
> not ok 4
> # Failed test 4 in t/hooks/authen_basic.t at line 26
> Failed 1/4 subtests
> ...
> t/hooks/authz.t .........................
> 1..4
> # Running under perl version 5.010001 for linux
> # Current time local: Thu Feb 25 16:50:04 2010
> # Current time GMT:   Thu Feb 25 21:50:04 2010
> # Using Test.pm version 1.25_02
> # Using Apache/Test.pm version 1.31
> ok 1
> ok 2
> ok 3
> not ok 4
> # Failed test 4 in t/hooks/authz.t at line 19
> Failed 1/4 subtests
>
> Error log attached.
>
> Thanks,
>
> David
>
>
>
>
>
>

Re: Error: `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC

Posted by "David E. Wheeler" <da...@kineticode.com>.
On Feb 24, 2010, at 11:31 AM, David E. Wheeler wrote:

>> export CFLAGS='-m64 -mtune=nocona'; export LDFLAGS='-L/usr/lib64'
>> ./Configure -des -A ccflags=-fPIC -Dprefix=/opt/perl
>> -Dinstallprefix=/opt/perl
> 
> Is that for Perl or for mod_perl? Looks like Perl.

seems to have worked by rebuilding Perl with:

    CFLAGS='-m64 -mtune=nocona' ./Configure -des -A ccflags=-fPIC

Should this perhaps be documented somewhere?

I did get a couple of test failures though:

t/hooks/authen_basic.t .................. 
1..4
# Running under perl version 5.010001 for linux
# Current time local: Thu Feb 25 16:50:03 2010
# Current time GMT:   Thu Feb 25 21:50:03 2010
# Using Test.pm version 1.25_02
# Using Apache/Test.pm version 1.31
ok 1
ok 2
ok 3
not ok 4
# Failed test 4 in t/hooks/authen_basic.t at line 26
Failed 1/4 subtests 
...
t/hooks/authz.t ......................... 
1..4
# Running under perl version 5.010001 for linux
# Current time local: Thu Feb 25 16:50:04 2010
# Current time GMT:   Thu Feb 25 21:50:04 2010
# Using Test.pm version 1.25_02
# Using Apache/Test.pm version 1.31
ok 1
ok 2
ok 3
not ok 4
# Failed test 4 in t/hooks/authz.t at line 19
Failed 1/4 subtests 

Error log attached.

Thanks,

David


Re: Error: `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC

Posted by "David E. Wheeler" <da...@kineticode.com>.
On Feb 24, 2010, at 10:19 AM, Serge Ivanchenko wrote:

> Try this:
> 
> export CFLAGS='-m64 -mtune=nocona'; export LDFLAGS='-L/usr/lib64'
> ./Configure -des -A ccflags=-fPIC -Dprefix=/opt/perl
> -Dinstallprefix=/opt/perl

Is that for Perl or for mod_perl? Looks like Perl.

Best,

David

Re: Error: `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC

Posted by "David E. Wheeler" <da...@kineticode.com>.
On Feb 24, 2010, at 12:07 AM, Fred Moyer wrote:

> Haven't tried with 5.10.1, but here's my 5.8.8/2.0.4/2.2.8 settings:
> 
> perl -V | grep -i fpic
>    cc='cc', ccflags ='-fPIC -D_LARGEFILE_SOURCE
> -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
>    cppflags='-fPIC -I/usr/include/gdbm'
>    cccdlflags='-fpic', lddlflags='-shared'
> 
> Have you tried passing -fPIC at perl configure time when it asks for
> additional CFLAGS?

I've been using -des, but I'll have a look at it. How are you configuring?

Best,

David