unable to compile perl under perl 5.10.1

unable to compile perl under perl 5.10.1

am 11.01.2010 16:23:41 von morten.bjornsvik

Hi all
I'm unable to compile mod_perl-2.0.x from svn(trunk 2.0.5-dev) or =
cpan(2.0.4) on perl 5.10.1, do anyone have some
black belt options that make it works, I believed the -fPIC now is =
embedded in the -Dusethreads, because
I see it appear lots of places in the perl compile output

I've tried compiling perl 5.10.1 with the following options

../Configure -des -A ccflags=3D"-O2 -DPERL_USE_SAFE_PUTENV -fPIC" =
-Dusethreads -Duse64bitall \
-Dprefix=3D/opt/perl -Dinstallprefix=3D/opt/perl

../Configure -des -A ccflags=3D-DPERL_USE_SAFE_PUTENV -Accflags=3D"-fPIC" =
-Dusethreads \
-Duse64bitall -Dprefix=3D/opt/perl -Dinstallprefix=3D/opt/perl

../Configure -des -A -Dusethreads -Duse64bitall =
-Dinstallprefix=3D/opt/perl

perl always compiles and seem to work fine with other modules.

Mod_perl2.0 build:
Both cpan and and the svn checkout version, shows the same error:
build cmd: cd '/usr/tmp/cpan_extract/mod_perl-2.0'; /opt/perl/bin/perl =
Makefile.PL MP_APXS=3D/opt/apache/bin/apxs

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/opt/perl/lib/5.10.1/x86_64-linux-thread-multi/CORE =
-lperl -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc \
-o mod_perl.so
/usr/bin/ld: =
/opt/perl/lib/5.10.1/x86_64-linux-thread-multi/CORE/libperl. a(op.o): =
relocation R_X86_64_32 against `a local symbol' can not be used when =
making a shared object; recompile with -fPIC
/opt/perl/lib/5.10.1/x86_64-linux-thread-multi/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 =
`/var/tmp/cpan_extract/mod_perl-2.0/src/modules/perl'
make: *** [modperl_lib] Error 2


Any ideas greatly appreciated.

Thanks
------------------------------------------------------------ ----
Morten Bj=F8rnsvik, Experian Decision Analytics AS, Oslo, Norway
------------------------------------------------------------ ----

Re: unable to compile perl under perl 5.10.1

am 11.01.2010 22:28:56 von Fred Moyer

Have you verified perl was actually compiled with fpic? perl -V

On Mon, Jan 11, 2010 at 7:23 AM, Morten Bj=F8rnsvik
wrote:
> Hi all
> I'm unable to compile mod_perl-2.0.x from svn(trunk 2.0.5-dev) or cpan(2.=
0.4) on perl 5.10.1, do anyone have some
> black belt options that make it works, I believed the -fPIC now is embedd=
ed in the -Dusethreads, because
> I see it appear lots of places in the perl compile output
>
> I've tried compiling perl 5.10.1 with the following options
>
> ./Configure -des -A ccflags=3D"-O2 -DPERL_USE_SAFE_PUTENV -fPIC" -Dusethr=
eads -Duse64bitall \
> =A0 =A0 =A0-Dprefix=3D/opt/perl -Dinstallprefix=3D/opt/perl
>
> ./Configure -des -A ccflags=3D-DPERL_USE_SAFE_PUTENV -Accflags=3D"-fPIC" =
-Dusethreads \
> =A0 =A0 =A0-Duse64bitall -Dprefix=3D/opt/perl -Dinstallprefix=3D/opt/perl
>
> ./Configure -des -A -Dusethreads -Duse64bitall -Dinstallprefix=3D/opt/per=
l
>
> perl always compiles and seem to work fine with other modules.
>
> Mod_perl2.0 build:
> Both cpan and and the svn checkout version, shows the same error:
> build cmd: cd '/usr/tmp/cpan_extract/mod_perl-2.0'; /opt/perl/bin/perl Ma=
kefile.PL MP_APXS=3D/opt/apache/bin/apxs
>
> 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/opt/perl/lib/5.10.1/x86_64-linux-thread-multi/CORE -lperl -lnsl -ldl =
-lm -lcrypt -lutil -lpthread -lc \
> =A0 =A0 =A0 =A0-o mod_perl.so
> /usr/bin/ld: /opt/perl/lib/5.10.1/x86_64-linux-thread-multi/CORE/libperl. =
a(op.o): relocation R_X86_64_32 against `a local symbol' can not be used wh=
en making a shared object; recompile with -fPIC
> /opt/perl/lib/5.10.1/x86_64-linux-thread-multi/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 `/var/tmp/cpan_extract/mod_perl-2.0/src/module=
s/perl'
> make: *** [modperl_lib] Error 2
>
>
> Any ideas greatly appreciated.
>
> Thanks
> ------------------------------------------------------------ ----
> Morten Bj=F8rnsvik, Experian Decision Analytics AS, Oslo, Norway
> ------------------------------------------------------------ ----
>
>
>

RE: unable to compile mod_perl under perl 5.10.1

am 12.01.2010 09:11:00 von morten.bjornsvik

Hi Fred

Thanks for the answer. getting correct -fPIC is probably the solution, =
but how?

On perl 5.10.0 it turned up under config flags, but here it does not, =
but under cccdlflags in dynamic linking?
There is probably some parsing in the Configure script that rearrange =
it.

platform is CentOS 5.2 (latest patches)

Summary of my perl5 (revision 5 version 10 subversion 1) configuration:
Platform:
osname=3Dlinux, osvers=3D2.6.18-164.9.1.el5, =
archname=3Dx86_64-linux-thread-multi
uname=3D'linux mortenb5.secana.local 2.6.18-164.9.1.el5 #1 smp tue =
dec 15 20:57:57 est 2009 x86_64 x86_64 x86_64 gnulinux '
config_args=3D'-des -A ccflags=3D-DPERL_USE_SAFE_PUTENV -Dusethreads =
-Dprefix=3D/opt/perl -Dinstallprefix=3D/opt/perl'
hint=3Drecommended, useposix=3Dtrue, d_sigaction=3Ddefine
useithreads=3Ddefine, usemultiplicity=3Ddefine
useperlio=3Ddefine, d_sfio=3Dundef, uselargefiles=3Ddefine, =
usesocks=3Dundef
use64bitint=3Ddefine, use64bitall=3Ddefine, uselongdouble=3Dundef
usemymalloc=3Dn, bincompat5005=3Dundef
Compiler:
cc=3D'cc', ccflags =3D'-D_REENTRANT -D_GNU_SOURCE =
-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector =
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64',
optimize=3D'-O2',
cppflags=3D'-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV =
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion=3D'', gccversion=3D'4.1.2 20080704 (Red Hat 4.1.2-46)', =
gccosandvers=3D''
intsize=3D4, longsize=3D8, ptrsize=3D8, doublesize=3D8, =
byteorder=3D12345678
d_longlong=3Ddefine, longlongsize=3D8, d_longdbl=3Ddefine, =
longdblsize=3D16
ivtype=3D'long', ivsize=3D8, nvtype=3D'double', nvsize=3D8, =
Off_t=3D'off_t', lseeksize=3D8
alignbytes=3D8, prototype=3Ddefine
Linker and Libraries:
ld=3D'cc', ldflags =3D' -fstack-protector -L/usr/local/lib'
libpth=3D/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 =
/usr/local/lib64
libs=3D-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=3D-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=3D/lib/libc-2.5.so, so=3Dso, useshrplib=3Dfalse, =
libperl=3Dlibperl.a
gnulibc_version=3D'2.5'
Dynamic Linking:
dlsrc=3Ddl_dlopen.xs, dlext=3Dso, d_dlsymun=3Dundef, =
ccdlflags=3D'-Wl,-E'
cccdlflags=3D'-fPIC', lddlflags=3D'-shared -O2 -L/usr/local/lib =
-fstack-protector'


-----Original Message-----
From: Fred Moyer [mailto:fred@redhotpenguin.com]=20
Sent: 11. januar 2010 22:29
To: Morten Bj=F8rnsvik
Cc: mod_perl list
Subject: Re: unable to compile perl under perl 5.10.1

Have you verified perl was actually compiled with fpic? perl -V

On Mon, Jan 11, 2010 at 7:23 AM, Morten Bj=F8rnsvik
wrote:
> Hi all
> I'm unable to compile mod_perl-2.0.x from svn(trunk 2.0.5-dev) or =
cpan(2.0.4) on perl 5.10.1, do anyone have some
> black belt options that make it works, I believed the -fPIC now is =
embedded in the -Dusethreads, because
> I see it appear lots of places in the perl compile output
>
> I've tried compiling perl 5.10.1 with the following options
>
> ./Configure -des -A ccflags=3D"-O2 -DPERL_USE_SAFE_PUTENV -fPIC" =
-Dusethreads -Duse64bitall \
> =A0 =A0 =A0-Dprefix=3D/opt/perl -Dinstallprefix=3D/opt/perl
>
> ./Configure -des -A ccflags=3D-DPERL_USE_SAFE_PUTENV =
-Accflags=3D"-fPIC" -Dusethreads \
> =A0 =A0 =A0-Duse64bitall -Dprefix=3D/opt/perl =
-Dinstallprefix=3D/opt/perl
>
> ./Configure -des -A -Dusethreads -Duse64bitall =
-Dinstallprefix=3D/opt/perl
>
> perl always compiles and seem to work fine with other modules.
>
> Mod_perl2.0 build:
> Both cpan and and the svn checkout version, shows the same error:
> build cmd: cd '/usr/tmp/cpan_extract/mod_perl-2.0'; /opt/perl/bin/perl =
Makefile.PL MP_APXS=3D/opt/apache/bin/apxs
>
> 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_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 =A0-Wl,-E =A0-fstack-protector =
-L/usr/local/lib =
=A0-L/opt/perl/lib/5.10.1/x86_64-linux-thread-multi/CORE -lperl -lnsl =
-ldl -lm -lcrypt -lutil -lpthread -lc \
> =A0 =A0 =A0 =A0-o mod_perl.so
> /usr/bin/ld: =
/opt/perl/lib/5.10.1/x86_64-linux-thread-multi/CORE/libperl. a(op.o): =
relocation R_X86_64_32 against `a local symbol' can not be used when =
making a shared object; recompile with -fPIC
> /opt/perl/lib/5.10.1/x86_64-linux-thread-multi/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 =
`/var/tmp/cpan_extract/mod_perl-2.0/src/modules/perl'
> make: *** [modperl_lib] Error 2
>
>
> Any ideas greatly appreciated.
>
> Thanks
> ------------------------------------------------------------ ----
> Morten Bj=F8rnsvik, Experian Decision Analytics AS, Oslo, Norway
> ------------------------------------------------------------ ----
>
>
>

Re: unable to compile mod_perl under perl 5.10.1

am 12.01.2010 09:21:57 von Fred Moyer

Here's what's on my 5.8.8 with fPIC, I haven't tried 5.10.1 on 64 bit yet.

cc=3D'cc', ccflags =3D'-fPIC -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=3D64 -I/usr/include/gdbm',

I'm not sure if the perl you showed me below has fpic configured.

I recommend that you compile a non-threaded version of perl though in
a separate installation location (with fpic configured of course), and
then build mod_perl from that. I usually use /home/app_user/perl.
There are a couple of reasons to do this:

1) If you start using CPAN with an rpm based distribution such as
centos, then you will be installing modules that should be installed
via RPM. The Fedora maintainer gave a note on this in a talk a couple
years ago at YAPC Chicago.

2) Single threaded perl binaries tend to be faster (~20%) and more
stable than threaded perl binaries. I don't have the data to post,
but I did some perlbench comparisons a few years ago with 5.8.8. This
may have changed with 5.10, but I would consider it unlikely.

3) You can ensure that you have fpic configured.


On Tue, Jan 12, 2010 at 12:11 AM, Morten Bj=F8rnsvik
wrote:
> Hi Fred
>
> Thanks for the answer. getting correct -fPIC is probably the solution, bu=
t how?
>
> On perl 5.10.0 it turned up under config flags, but here it does not, but=
under cccdlflags in dynamic linking?
> There is probably some parsing in the Configure script that rearrange it.
>
> platform is CentOS 5.2 (latest patches)
>
> Summary of my perl5 (revision 5 version 10 subversion 1) configuration:
> =A0Platform:
> =A0 =A0osname=3Dlinux, osvers=3D2.6.18-164.9.1.el5, archname=3Dx86_64-lin=
ux-thread-multi
> =A0 =A0uname=3D'linux mortenb5.secana.local 2.6.18-164.9.1.el5 #1 smp tue=
dec 15 20:57:57 est 2009 x86_64 x86_64 x86_64 gnulinux '
> =A0 =A0config_args=3D'-des -A ccflags=3D-DPERL_USE_SAFE_PUTENV -Dusethrea=
ds -Dprefix=3D/opt/perl -Dinstallprefix=3D/opt/perl'
> =A0 =A0hint=3Drecommended, useposix=3Dtrue, d_sigaction=3Ddefine
> =A0 =A0useithreads=3Ddefine, usemultiplicity=3Ddefine
> =A0 =A0useperlio=3Ddefine, d_sfio=3Dundef, uselargefiles=3Ddefine, usesoc=
ks=3Dundef
> =A0 =A0use64bitint=3Ddefine, use64bitall=3Ddefine, uselongdouble=3Dundef
> =A0 =A0usemymalloc=3Dn, bincompat5005=3Dundef
> =A0Compiler:
> =A0 =A0cc=3D'cc', ccflags =3D'-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_=
PUTENV -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D=
_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64',
> =A0 =A0optimize=3D'-O2',
> =A0 =A0cppflags=3D'-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV -fno=
-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
> =A0 =A0ccversion=3D'', gccversion=3D'4.1.2 20080704 (Red Hat 4.1.2-46)', =
gccosandvers=3D''
> =A0 =A0intsize=3D4, longsize=3D8, ptrsize=3D8, doublesize=3D8, byteorder=
=3D12345678
> =A0 =A0d_longlong=3Ddefine, longlongsize=3D8, d_longdbl=3Ddefine, longdbl=
size=3D16
> =A0 =A0ivtype=3D'long', ivsize=3D8, nvtype=3D'double', nvsize=3D8, Off_t=
=3D'off_t', lseeksize=3D8
> =A0 =A0alignbytes=3D8, prototype=3Ddefine
> =A0Linker and Libraries:
> =A0 =A0ld=3D'cc', ldflags =3D' -fstack-protector -L/usr/local/lib'
> =A0 =A0libpth=3D/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local=
/lib64
> =A0 =A0libs=3D-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
> =A0 =A0perllibs=3D-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
> =A0 =A0libc=3D/lib/libc-2.5.so, so=3Dso, useshrplib=3Dfalse, libperl=3Dli=
bperl.a
> =A0 =A0gnulibc_version=3D'2.5'
> =A0Dynamic Linking:
> =A0 =A0dlsrc=3Ddl_dlopen.xs, dlext=3Dso, d_dlsymun=3Dundef, ccdlflags=3D'=
-Wl,-E'
> =A0 =A0cccdlflags=3D'-fPIC', lddlflags=3D'-shared -O2 -L/usr/local/lib -f=
stack-protector'
>
>
> -----Original Message-----
> From: Fred Moyer [mailto:fred@redhotpenguin.com]
> Sent: 11. januar 2010 22:29
> To: Morten Bj=F8rnsvik
> Cc: mod_perl list
> Subject: Re: unable to compile perl under perl 5.10.1
>
> Have you verified perl was actually compiled with fpic? =A0perl -V
>
> On Mon, Jan 11, 2010 at 7:23 AM, Morten Bj=F8rnsvik
> wrote:
>> Hi all
>> I'm unable to compile mod_perl-2.0.x from svn(trunk 2.0.5-dev) or cpan(2=
..0.4) on perl 5.10.1, do anyone have some
>> black belt options that make it works, I believed the -fPIC now is embed=
ded in the -Dusethreads, because
>> I see it appear lots of places in the perl compile output
>>
>> I've tried compiling perl 5.10.1 with the following options
>>
>> ./Configure -des -A ccflags=3D"-O2 -DPERL_USE_SAFE_PUTENV -fPIC" -Duseth=
reads -Duse64bitall \
>> =A0 =A0 =A0-Dprefix=3D/opt/perl -Dinstallprefix=3D/opt/perl
>>
>> ./Configure -des -A ccflags=3D-DPERL_USE_SAFE_PUTENV -Accflags=3D"-fPIC"=
-Dusethreads \
>> =A0 =A0 =A0-Duse64bitall -Dprefix=3D/opt/perl -Dinstallprefix=3D/opt/per=
l
>>
>> ./Configure -des -A -Dusethreads -Duse64bitall -Dinstallprefix=3D/opt/pe=
rl
>>
>> perl always compiles and seem to work fine with other modules.
>>
>> Mod_perl2.0 build:
>> Both cpan and and the svn checkout version, shows the same error:
>> build cmd: cd '/usr/tmp/cpan_extract/mod_perl-2.0'; /opt/perl/bin/perl M=
akefile.PL MP_APXS=3D/opt/apache/bin/apxs
>>
>> 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_l=
og.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_pc=
w.lo modperl_global.lo modperl_env.lo modperl_cgi.lo modperl_perl.lo modper=
l_perl_global.lo modperl_perl_pp.lo modperl_sys.lo modperl_module.lo modper=
l_svptr_table.lo modperl_const.lo modperl_constants.lo modperl_apache_compa=
t.lo modperl_error.lo modperl_debug.lo modperl_common_util.lo modperl_commo=
n_log.lo modperl_hooks.lo modperl_directives.lo modperl_flags.lo modperl_xs=
init.lo modperl_exports.lo =A0-Wl,-E =A0-fstack-protector -L/usr/local/lib =
=A0-L/opt/perl/lib/5.10.1/x86_64-linux-thread-multi/CORE -lperl -lnsl -ldl =
-lm -lcrypt -lutil -lpthread -lc \
>> =A0 =A0 =A0 =A0-o mod_perl.so
>> /usr/bin/ld: /opt/perl/lib/5.10.1/x86_64-linux-thread-multi/CORE/libperl=
..a(op.o): relocation R_X86_64_32 against `a local symbol' can not be used w=
hen making a shared object; recompile with -fPIC
>> /opt/perl/lib/5.10.1/x86_64-linux-thread-multi/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 `/var/tmp/cpan_extract/mod_perl-2.0/src/modul=
es/perl'
>> make: *** [modperl_lib] Error 2
>>
>>
>> Any ideas greatly appreciated.
>>
>> Thanks
>> ------------------------------------------------------------ ----
>> Morten Bj=F8rnsvik, Experian Decision Analytics AS, Oslo, Norway
>> ------------------------------------------------------------ ----
>>
>>
>>
>

RE: unable to compile mod_perl under perl 5.10.1

am 12.01.2010 10:16:48 von morten.bjornsvik

Hi again

I inspected the rpm spec file we use to build perl and found some errors =
setting it to default value

config_args=3D'-des -A ccflags=3D-fPIC -Dprefix=3D/opt/perl =
-Dinstallprefix=3D/opt/perl'

Now mod_perl compiles fine, I will also try without threading based on =
your comments.
(I believed threads were more unstable but not slower).
We used 'use Thread;' in earlier version, but I could not find it in the =
code anymore.

Thanks again
for some excellent feedback.

--
MortenB



-----Original Message-----
From: Fred Moyer [mailto:fred@redhotpenguin.com]=20
Sent: 12. januar 2010 09:22
To: Morten Bj=F8rnsvik
Cc: mod_perl list
Subject: Re: unable to compile mod_perl under perl 5.10.1

Here's what's on my 5.8.8 with fPIC, I haven't tried 5.10.1 on 64 bit =
yet.

cc=3D'cc', ccflags =3D'-fPIC -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=3D64 -I/usr/include/gdbm',

I'm not sure if the perl you showed me below has fpic configured.

I recommend that you compile a non-threaded version of perl though in
a separate installation location (with fpic configured of course), and
then build mod_perl from that. I usually use /home/app_user/perl.
There are a couple of reasons to do this:

1) If you start using CPAN with an rpm based distribution such as
centos, then you will be installing modules that should be installed
via RPM. The Fedora maintainer gave a note on this in a talk a couple
years ago at YAPC Chicago.

2) Single threaded perl binaries tend to be faster (~20%) and more
stable than threaded perl binaries. I don't have the data to post,
but I did some perlbench comparisons a few years ago with 5.8.8. This
may have changed with 5.10, but I would consider it unlikely.

3) You can ensure that you have fpic configured.


On Tue, Jan 12, 2010 at 12:11 AM, Morten Bj=F8rnsvik
wrote:
> Hi Fred
>
> Thanks for the answer. getting correct -fPIC is probably the solution, =
but how?
>
> On perl 5.10.0 it turned up under config flags, but here it does not, =
but under cccdlflags in dynamic linking?
> There is probably some parsing in the Configure script that rearrange =
it.
>
> platform is CentOS 5.2 (latest patches)
>
> Summary of my perl5 (revision 5 version 10 subversion 1) =
configuration:
> =A0Platform:
> =A0 =A0osname=3Dlinux, osvers=3D2.6.18-164.9.1.el5, =
archname=3Dx86_64-linux-thread-multi
> =A0 =A0uname=3D'linux mortenb5.secana.local 2.6.18-164.9.1.el5 #1 smp =
tue dec 15 20:57:57 est 2009 x86_64 x86_64 x86_64 gnulinux '
> =A0 =A0config_args=3D'-des -A ccflags=3D-DPERL_USE_SAFE_PUTENV =
-Dusethreads -Dprefix=3D/opt/perl -Dinstallprefix=3D/opt/perl'
> =A0 =A0hint=3Drecommended, useposix=3Dtrue, d_sigaction=3Ddefine
> =A0 =A0useithreads=3Ddefine, usemultiplicity=3Ddefine
> =A0 =A0useperlio=3Ddefine, d_sfio=3Dundef, uselargefiles=3Ddefine, =
usesocks=3Dundef
> =A0 =A0use64bitint=3Ddefine, use64bitall=3Ddefine, =
uselongdouble=3Dundef
> =A0 =A0usemymalloc=3Dn, bincompat5005=3Dundef
> =A0Compiler:
> =A0 =A0cc=3D'cc', ccflags =3D'-D_REENTRANT -D_GNU_SOURCE =
-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector =
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64',
> =A0 =A0optimize=3D'-O2',
> =A0 =A0cppflags=3D'-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV =
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
> =A0 =A0ccversion=3D'', gccversion=3D'4.1.2 20080704 (Red Hat =
4.1.2-46)', gccosandvers=3D''
> =A0 =A0intsize=3D4, longsize=3D8, ptrsize=3D8, doublesize=3D8, =
byteorder=3D12345678
> =A0 =A0d_longlong=3Ddefine, longlongsize=3D8, d_longdbl=3Ddefine, =
longdblsize=3D16
> =A0 =A0ivtype=3D'long', ivsize=3D8, nvtype=3D'double', nvsize=3D8, =
Off_t=3D'off_t', lseeksize=3D8
> =A0 =A0alignbytes=3D8, prototype=3Ddefine
> =A0Linker and Libraries:
> =A0 =A0ld=3D'cc', ldflags =3D' -fstack-protector -L/usr/local/lib'
> =A0 =A0libpth=3D/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 =
/usr/local/lib64
> =A0 =A0libs=3D-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
> =A0 =A0perllibs=3D-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
> =A0 =A0libc=3D/lib/libc-2.5.so, so=3Dso, useshrplib=3Dfalse, =
libperl=3Dlibperl.a
> =A0 =A0gnulibc_version=3D'2.5'
> =A0Dynamic Linking:
> =A0 =A0dlsrc=3Ddl_dlopen.xs, dlext=3Dso, d_dlsymun=3Dundef, =
ccdlflags=3D'-Wl,-E'
> =A0 =A0cccdlflags=3D'-fPIC', lddlflags=3D'-shared -O2 -L/usr/local/lib =
-fstack-protector'
>
>
> -----Original Message-----
> From: Fred Moyer [mailto:fred@redhotpenguin.com]
> Sent: 11. januar 2010 22:29
> To: Morten Bj=F8rnsvik
> Cc: mod_perl list
> Subject: Re: unable to compile perl under perl 5.10.1
>
> Have you verified perl was actually compiled with fpic? =A0perl -V
>
> On Mon, Jan 11, 2010 at 7:23 AM, Morten Bj=F8rnsvik
> wrote:
>> Hi all
>> I'm unable to compile mod_perl-2.0.x from svn(trunk 2.0.5-dev) or =
cpan(2.0.4) on perl 5.10.1, do anyone have some
>> black belt options that make it works, I believed the -fPIC now is =
embedded in the -Dusethreads, because
>> I see it appear lots of places in the perl compile output
>>
>> I've tried compiling perl 5.10.1 with the following options
>>
>> ./Configure -des -A ccflags=3D"-O2 -DPERL_USE_SAFE_PUTENV -fPIC" =
-Dusethreads -Duse64bitall \
>> =A0 =A0 =A0-Dprefix=3D/opt/perl -Dinstallprefix=3D/opt/perl
>>
>> ./Configure -des -A ccflags=3D-DPERL_USE_SAFE_PUTENV =
-Accflags=3D"-fPIC" -Dusethreads \
>> =A0 =A0 =A0-Duse64bitall -Dprefix=3D/opt/perl =
-Dinstallprefix=3D/opt/perl
>>
>> ./Configure -des -A -Dusethreads -Duse64bitall =
-Dinstallprefix=3D/opt/perl
>>
>> perl always compiles and seem to work fine with other modules.
>>
>> Mod_perl2.0 build:
>> Both cpan and and the svn checkout version, shows the same error:
>> build cmd: cd '/usr/tmp/cpan_extract/mod_perl-2.0'; =
/opt/perl/bin/perl Makefile.PL MP_APXS=3D/opt/apache/bin/apxs
>>
>> 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_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 =A0-Wl,-E =A0-fstack-protector =
-L/usr/local/lib =
=A0-L/opt/perl/lib/5.10.1/x86_64-linux-thread-multi/CORE -lperl -lnsl =
-ldl -lm -lcrypt -lutil -lpthread -lc \
>> =A0 =A0 =A0 =A0-o mod_perl.so
>> /usr/bin/ld: =
/opt/perl/lib/5.10.1/x86_64-linux-thread-multi/CORE/libperl. a(op.o): =
relocation R_X86_64_32 against `a local symbol' can not be used when =
making a shared object; recompile with -fPIC
>> /opt/perl/lib/5.10.1/x86_64-linux-thread-multi/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 =
`/var/tmp/cpan_extract/mod_perl-2.0/src/modules/perl'
>> make: *** [modperl_lib] Error 2
>>
>>
>> Any ideas greatly appreciated.
>>
>> Thanks
>> ------------------------------------------------------------ ----
>> Morten Bj=F8rnsvik, Experian Decision Analytics AS, Oslo, Norway
>> ------------------------------------------------------------ ----
>>
>>
>>
>