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

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

am 24.02.2010 07:53:03 von david

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=20

export CFLAGS=3D-fPIC

Before I built everything on this box, including Perl and Apache 2. Perl =
says:

bash-3.2# perl -V | grep PIC
cccdlflags=3D'-fPIC', lddlflags=3D'-shared -O2 -g -pipe -Wall =
-Wp,-D_FORTIFY_SOURCE=3D2 -fexceptions -fstack-protector =
--param=3Dssp-buffer-size=3D4 -m64 -mtune=3Dgeneric'

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.

Thanks,

David

Re: Error: `PL_sv_yes" can not be used when making a shared object;

am 24.02.2010 09:07:14 von Fred Moyer

On Tue, Feb 23, 2010 at 10:53 PM, David E. Wheeler w=
rote:
> Fellow mod_perlers,
>
> I found myself getting this error with mod_perl 2 on 64 bit CentOS this e=
vening:
>
> bash-3.2# make test
> cd "src/modules/perl" && make
> make[1]: Entering directory `/home/dwheeler/mod_perl-2.0.4/src/modules/pe=
rl'
> rm -f mod_perl.so
> cc -shared -O2 -L/usr/local/lib -fstack-protector \
> =A0 =A0 =A0 =A0 \
> =A0 =A0 =A0 =A0mod_perl.lo modperl_interp.lo modperl_tipool.lo modperl_lo=
g.lo modperl_config.lo modperl_cmd.lo modperl_options.lo modperl_callback.l=
o 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_xsi=
nit.lo modperl_exports.lo =A0-Wl,-E =A0-fstack-protector -L/usr/local/lib =
=A0-L/usr/local/lib/perl5/5.10.1/x86_64-linux/CORE -lperl -lnsl -ldl -lm -l=
crypt -lutil -lc \
> =A0 =A0 =A0 =A0-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 s=
ymbols: 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/per=
l'
> make: *** [modperl_lib] Error 2
>
> Really annoying. A Googling turned up this post from January:
>
> =A0http://www.gossamer-threads.com/lists/modperl/modperl/100 854
>
> Too bad there was never a reply. Anyway, I can say that I set
>
> =A0 =A0export CFLAGS=3D-fPIC
>
> Before I built everything on this box, including Perl and Apache 2. Perl =
says:
>
> =A0 =A0bash-3.2# perl -V | grep PIC
> =A0 =A0 =A0 =A0cccdlflags=3D'-fPIC', lddlflags=3D'-shared -O2 -g -pipe -W=
all -Wp,-D_FORTIFY_SOURCE=3D2 -fexceptions -fstack-protector --param=3Dssp-=
buffer-size=3D4 -m64 -mtune=3Dgeneric'
>
> 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=3D'cc', ccflags =3D'-fPIC -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=3D64 -I/usr/include/gdbm',
cppflags=3D'-fPIC -I/usr/include/gdbm'
cccdlflags=3D'-fpic', lddlflags=3D'-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

am 24.02.2010 17:01:23 von david

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

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

am 24.02.2010 20:31:00 von david

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

am 25.02.2010 22:55:49 von david

--Apple-Mail-1-1064940906
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii

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


--Apple-Mail-1-1064940906
Content-Disposition: attachment;
filename=error_log.gz
Content-Type: application/x-gzip;
x-unix-mode=0644;
name="error_log.gz"
Content-Transfer-Encoding: base64

H4sICHPxhksAA2Vycm9yX2xvZwDtnW1v2zgSgL/3V/CKw9UpElmSLb/o0AWC ttsWSLtBmn65NvDR
Em0RkUktSTnxHe6/31CSX+LIb7HiZFtigcLryDPPzHBImuTQ3y+jFP1O+sj1 kNPyPdd3m8i1HfsK
fadswK/QJ0aVj74SElI2ROcXXz6gG6oiZKP+RBGJ+AARpgRPJi++bynsA2FE YKXlKTJKuMBigi6+
nqJE0DFWBF2TiUQ1z3Hrjg0i+lTJo/2kv/uIEizwiCgidhN9gwWbe0FKyhl6 i4OIICoR4woFnA3o
MBUkRN8jyvRjX8+KJ7MHr7ZG1/9SHNP/aPjamAqV4vgISSLGGnvAhZa9hbgR D3tSxnXXci2nCYij
hMYAiIeYMqnAEC3RR6eJBiweO0ZntK+95aM/EsJAU922ulaHnAxoIk9ERGLv xfsv7xBlWkFCRNwj
t0pgK4mPUULDNw3H69hr8cBhNCBX6B0dEgkWD+fBkiQQRGVGhtlfEU5VBG2L BvAAeN2yrJ1kh5yR
rV3/6zbwv1gDLNHtTXWHpJ8Or8DL/HbSSxWNraDmdOzWkZ+/B+1N4H4fOGTA BelzLOBlDEls60Yd
RDQOkW7EnczUGy6uiUCRUolfr8c8wHHEpbKyVyEfgSl+x3O79Utob7/TGFzf 6/W5inpSiZ4gf/Zy
EughFDSh+u7sXdeds9NpcDQ/BCgmuu9hJMiyo4AtNaRWyl7aLCrwpbPGl/lH BdHNqTQ5q/ZHKUzt
9QNsb3edue6qmwbCsSA4nCwaZRANokE0iAbRIBpEg2gQDaJBNIgG0SAaRINo EA2iQTSIBnHP1f7u
M1nt77jec3fv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2934PL8DpMFLo
66cPl+8vPh8jGaUqc2PIb9hmk5ov/g+QKsWBDaUAAA==

--Apple-Mail-1-1064940906
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii




--Apple-Mail-1-1064940906--

Re: Error: `PL_sv_yes" can not be used when making a shared object;

am 26.02.2010 00:03:10 von Fred Moyer

On Thu, Feb 25, 2010 at 1:55 PM, David E. Wheeler wr=
ote:
> On Feb 24, 2010, at 11:31 AM, David E. Wheeler wrote:
>
>>> export CFLAGS=3D'-m64 -mtune=3Dnocona'; export LDFLAGS=3D'-L/usr/lib64'
>>> ./Configure -des -A ccflags=3D-fPIC -Dprefix=3D/opt/perl
>>> -Dinstallprefix=3D/opt/perl
>>
>> Is that for Perl or for mod_perl? Looks like Perl.
>
> seems to have worked by rebuilding Perl with:
>
> =A0 =A0CFLAGS=3D'-m64 -mtune=3Dnocona' ./Configure -des -A ccflags=3D-fPI=
C
>
> 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: =A0 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: =A0 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

am 26.02.2010 00:11:03 von david

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;

am 26.02.2010 00:30:37 von Fred Moyer

On Thu, Feb 25, 2010 at 3:11 PM, David E. Wheeler wr=
ote:
> On Feb 25, 2010, at 3:03 PM, Fred Moyer wrote:
>
>> Absolute - maybe in the INSTALL file? =A0You have commit access right?
>
> Only to documentation IIRC. I got it just about the time I stopped writin=
g 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

am 10.03.2010 19:00:42 von david

On Feb 25, 2010, at 3:30 PM, Fred Moyer wrote:

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