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

Fred Moyer <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On Tue, Feb 23, 2010 at 10:53 PM, David E. Wheeler <[email protected]> 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?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.