mod_perl-2.0.4 for Apache httpd-2.2.17 on Solaris10 64bit - ld: wrongELF class: ELFCLASS64 - CC=&qu

mod_perl-2.0.4 for Apache httpd-2.2.17 on Solaris10 64bit - ld: wrongELF class: ELFCLASS64 - CC=&qu

am 08.12.2010 14:25:39 von kamil.stas

--Boundary_(ID_YmQ5nFo2KmtkEIU/fbSAGQ)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT

Hello,

I am trying to compile mod_perl-2.0.4 for Apache httpd-2.2.17 on Solaris10 SunOS 5.10 Generic_141414-10 sun4v sparc SUNW,SPARC-Enterprise-T5120

I am facing ld: wrong ELF class: ELFCLASS64 problem.
Everyting was compiled in m -64 mode, generated .so 64bit, with export CC="gcc -m64"

When compiling mod_perl it looks its trying to compile in 32bit mode, dont understand why.
How to forse it to compile in 64bit mode? Till now gcc -m64 was good to use, with exported LD_LIBRARY_PATH and PATH for sparcv9
CFLAGS="-L/usr/sfw/lib/sparcv9 -R/usr/sfw/lib/sparcv9"
Perl Version: perl-5.12.2

Can you advise, please?

No error log under t/logs/error_log


ld: fatal: file /pkg/products/httpd_test/httpd/httpd-2.2.17a/apr-util//lib/l ibaprutil-1.so: wrong ELF class: ELFCLASS64
ld: fatal: file /pkg/products/httpd_test/httpd/httpd-2.2.17a/apr-util//lib/l ibexpat.so: wrong ELF class: ELFCLASS64
ld: fatal: file /pkg/products/httpd_test/httpd/httpd-2.2.17a/apr/lib/libapr- 1.so: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to ../../../blib/arch/auto/APR/APR.so
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `../../../blib/arch/auto/APR/APR.so'
Current working directory /home/admin/kstas/httpd/modules/mod_perl/mod_perl-2.0.4/xs/A PR/APR
*** Error code 1
The following command caused the error:
cd APR && make -f Makefile all LIBPERL_A="libperl.a" LINKTYPE="dynamic" OPTIMIZE="-fPIC" PREFIX="/pkg/products/perl/perl-5.12.2" PASTHRU_INC=""
make: Fatal error: Command failed for target `subdirs'
Current working directory /home/admin/kstas/httpd/modules/mod_perl/mod_perl-2.0.4/xs/A PR
*** Error code 1
The following command caused the error:
cd APR && make -f Makefile all LIBPERL_A="libperl.a" LINKTYPE="dynamic" OPTIMIZE="-fPIC" PREFIX="/pkg/products/perl/perl-5.12.2" PASTHRU_INC=""
make: Fatal error: Command failed for target `subdirs'
Current working directory /home/admin/kstas/httpd/modules/mod_perl/mod_perl-2.0.4/xs
*** Error code 1
The following command caused the error:
cd xs && make -f Makefile all LIBPERL_A="libperl.a" LINKTYPE="dynamic" OPTIMIZE="-fPIC" PREFIX="/pkg/products/perl/perl-5.12.2" PASTHRU_DEFINE="" PASTHRU_INC="" PERL="/pkg/products/perl/perl-5.12.2/bin/perl" DEFINE="-DMP_HAVE_APR_LIBS"
make: Fatal error: Command failed for target `subdirs'


--Boundary_(ID_YmQ5nFo2KmtkEIU/fbSAGQ)
Content-type: text/html; charset=us-ascii
Content-transfer-encoding: quoted-printable

osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" xmlns:p=3D"urn:schemas-m=
icrosoft-com:office:powerpoint" xmlns:a=3D"urn:schemas-microsoft-com:office=
:access" xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s=3D"=
uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs=3D"urn:schemas-microsof=
t-com:rowset" xmlns:z=3D"#RowsetSchema" xmlns:b=3D"urn:schemas-microsoft-co=
m:office:publisher" xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadshee=
t" xmlns:c=3D"urn:schemas-microsoft-com:office:component:spread sheet" xmlns=
:odc=3D"urn:schemas-microsoft-com:office:odc" xmlns:oa=3D"urn:schemas-micro=
soft-com:office:activation" xmlns:html=3D"http://www.w3.org/TR/REC-html40" =
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc=3D"http://m=
icrosoft.com/officenet/conferencing" xmlns:D=3D"DAV:" xmlns:Repl=3D"http://=
schemas.microsoft.com/repl/" xmlns:mt=3D"http://schemas.microsoft.com/share=
point/soap/meetings/" xmlns:x2=3D"http://schemas.microsoft.com/office/excel=
/2003/xml" xmlns:ppda=3D"http://www.passport.com/NameSpace.xsd" xmlns:ois=
=3D"http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir=3D"http://=
schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds=3D"http://www.w3=
..org/2000/09/xmldsig#" xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint=
/dsp" xmlns:udc=3D"http://schemas.microsoft.com/data/udc" xmlns:xsd=3D"http=
://www.w3.org/2001/XMLSchema" xmlns:sub=3D"http://schemas.microsoft.com/sha=
repoint/soap/2002/1/alerts/" xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#"=
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" xmlns:sps=3D"http://=
schemas.microsoft.com/sharepoint/soap/" xmlns:xsi=3D"http://www.w3.org/2001=
/XMLSchema-instance" xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/so=
ap" xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile " xmlns:udc=
p2p=3D"http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf=3D"http:/=
/schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss=3D"http://sche=
mas.microsoft.com/office/2006/digsig-setup" xmlns:dssi=3D"http://schemas.mi=
crosoft.com/office/2006/digsig" xmlns:mdssi=3D"http://schemas.openxmlformat=
s.org/package/2006/digital-signature" xmlns:mver=3D"http://schemas.openxmlf=
ormats.org/markup-compatibility/2006" xmlns:m=3D"http://schemas.microsoft.c=
om/office/2004/12/omml" xmlns:mrels=3D"http://schemas.openxmlformats.org/pa=
ckage/2006/relationships" xmlns:spwp=3D"http://microsoft.com/sharepoint/web=
partpages" xmlns:ex12t=3D"http://schemas.microsoft.com/exchange/service s/20=
06/types" xmlns:ex12m=3D"http://schemas.microsoft.com/exchange/service s/200=
6/messages" xmlns:pptsl=3D"http://schemas.microsoft.com/sharepoint/soap/ Sli=
deLibrary/" xmlns:spsl=3D"http://microsoft.com/webservices/SharePointPor tal=
Server/PublishedLinksService" xmlns:Z=3D"urn:schemas-microsoft-com:" xmlns:=
st=3D"" xmlns=3D"http://www.w3.org/TR/REC-html40">


>









Hello,



 



I am trying to compile mod_perl-2.0.4 for Apache
httpd-2.2.17 on Solaris10 SunOS 5.10 Generic_141414-10 sun4v sparc
SUNW,SPARC-Enterprise-T5120



 



I am facing ld: wrong ELF class: ELFCLASS64 probl=
em.



Everyting was compiled in m -64 mode, generated .so 64=
bit,
with export CC=3D"gcc -m64"



 



When compiling mod_perl it looks its trying to compile=
in
32bit mode, dont understand why.



How to forse it to compile in 64bit mode? Till now gcc=
-m64
was good to use, with exported LD_LIBRARY_PATH and PATH for sparcv9 :p>



CFLAGS=3D“-L/usr/sfw/lib/sparcv9
-R/usr/sfw/lib/sparcv9“



Perl Version: perl-5.12.2



 



Can you advise, please?



 



No error log under t/logs/error_log



 



 



ld: fatal: file
/pkg/products/httpd_test/httpd/httpd-2.2.17a/apr-util//lib/l ibaprutil-1.so:
wrong ELF class: ELFCLASS64



ld: fatal: file
/pkg/products/httpd_test/httpd/httpd-2.2.17a/apr-util//lib/l ibexpat.so: wro=
ng
ELF class: ELFCLASS64



ld: fatal: file
/pkg/products/httpd_test/httpd/httpd-2.2.17a/apr/lib/libapr- 1.so: wrong ELF
class: ELFCLASS64



ld: fatal: File processing errors. No output written t=
o
.../../../blib/arch/auto/APR/APR.so



collect2: ld returned 1 exit status



*** Error code 1



make: Fatal error: Command failed for target
`../../../blib/arch/auto/APR/APR.so'



Current working directory /home/admin/kstas/httpd/modu=
les/mod_perl/mod_perl-2.0.4/xs/APR/APR



*** Error code 1



The following command caused the error:



cd APR && make -f Makefile all
LIBPERL_A=3D"libperl.a" LINKTYPE=3D"dynamic"
OPTIMIZE=3D"-fPIC" PREFIX=3D"/pkg/products/perl/perl-5.12.2&=
quot;
PASTHRU_INC=3D""



make: Fatal error: Command failed for target `subdirs'=



Current working directory
/home/admin/kstas/httpd/modules/mod_perl/mod_perl-2.0.4/xs/A PR p>

*** Error code 1



The following command caused the error:



cd APR && make -f Makefile all LIBPERL_A=3D&qu=
ot;libperl.a"
LINKTYPE=3D"dynamic" OPTIMIZE=3D"-fPIC"
PREFIX=3D"/pkg/products/perl/perl-5.12.2" PASTHRU_INC=3D"&qu=
ot;



make: Fatal error: Command failed for target `subdirs'=



Current working directory
/home/admin/kstas/httpd/modules/mod_perl/mod_perl-2.0.4/xs



*** Error code 1



The following command caused the error:



cd xs && make -f Makefile all
LIBPERL_A=3D"libperl.a" LINKTYPE=3D"dynamic"
OPTIMIZE=3D"-fPIC" PREFIX=3D"/pkg/products/perl/perl-5.12.2&=
quot;
PASTHRU_DEFINE=3D"" PASTHRU_INC=3D"" PERL=3D"/pkg/=
products/perl/perl-5.12.2/bin/perl"
DEFINE=3D"-DMP_HAVE_APR_LIBS"



make: Fatal error: Command failed for target `subdirs'=



 









--Boundary_(ID_YmQ5nFo2KmtkEIU/fbSAGQ)--

Re: mod_perl-2.0.4 for Apache httpd-2.2.17 on Solaris10 64bit - ld:wrong ELF class: ELFCLASS64 - CC=

am 08.12.2010 15:55:23 von brett.maxfield

--001485f923568f55970496e74fbc
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

The error means you are trying to link a 64 bit library with a 32 bit one,
at link time (the error comes from ld, which is the linker).

Setting -L in CFLAGS sets /usr/sfw/lib/sparcv9 at compile (not link time)
Setting -R in CFLAGS sets /usr/sfw/lib/sparcv9 at run time.

None of these help with link time, you need to use -m64 at link time also
(LDFLAGS) to link with 64 bit system libraries, and also set
LD_LIBRARY_PATH=3D/usr/sfw/lib/sparcv9 in your shell (at minimum)

All solaris tool sets default to 32 bit compile and link, unless you specif=
y
otherwise. Sigh.

You dont need to set LD_LIBRARY_PATH in your compile shell if you have the
luxury of being able to set the system default to look in
/usr/sfw/lib/sparcv9 (man crle), but there are several reasons why this may
not be possible or advisable with third party libraries, especially if you
have several different versions of a library on a system, someone will end
up getting the wrong library eventually.

Personally i think adding paths such as /usr/sfw/lib/sparcv9 as s system
default is reasonable, as it is a solaris provided (not third party)
library. I dont comprehend why sun dont configure solaris to use thier own
libraries by default.

But having said all that, you probably need to make sure Perl was compiled
with the correct 64 bit options in the first place, as most perl modules
with native code will either use these by default, or will later have link
issues if you don't already.

In other words you need to use the 64 bit compile and link options for all
options that need to link together or share libraries.

Cheers
Brett

On Wed, Dec 8, 2010 at 11:25 PM, Stas, Kamil wrote=
:

> Hello,
>
>
>
> I am trying to compile mod_perl-2.0.4 for Apache httpd-2.2.17 on Solaris1=
0
> SunOS 5.10 Generic_141414-10 sun4v sparc SUNW,SPARC-Enterprise-T5120
>
>
>
> I am facing ld: wrong ELF class: ELFCLASS64 problem.
>
> Everyting was compiled in m -64 mode, generated .so 64bit, with export
> CC=3D"gcc -m64"
>
>
>
> When compiling mod_perl it looks its trying to compile in 32bit mode, don=
t
> understand why.
>
> How to forse it to compile in 64bit mode? Till now gcc -m64 was good to
> use, with exported LD_LIBRARY_PATH and PATH for sparcv9
>
> CFLAGS=“-L/usr/sfw/lib/sparcv9 -R/usr/sfw/lib/sparcv9=93
>
> Perl Version: perl-5.12.2
>
>
>
> Can you advise, please?
>
>
>
> No error log under t/logs/error_log
>
>
>
>
>
> ld: fatal: file
> /pkg/products/httpd_test/httpd/httpd-2.2.17a/apr-util//lib/l ibaprutil-1.s=
o:
> wrong ELF class: ELFCLASS64
>
> ld: fatal: file
> /pkg/products/httpd_test/httpd/httpd-2.2.17a/apr-util//lib/l ibexpat.so:
> wrong ELF class: ELFCLASS64
>
> ld: fatal: file
> /pkg/products/httpd_test/httpd/httpd-2.2.17a/apr/lib/libapr- 1.so: wrong E=
LF
> class: ELFCLASS64
>
> ld: fatal: File processing errors. No output written to
> ../../../blib/arch/auto/APR/APR.so
>
> collect2: ld returned 1 exit status
>
> *** Error code 1
>
> make: Fatal error: Command failed for target
> `../../../blib/arch/auto/APR/APR.so'
>
> Current working directory
> /home/admin/kstas/httpd/modules/mod_perl/mod_perl-2.0.4/xs/A PR/APR
>
> *** Error code 1
>
> The following command caused the error:
>
> cd APR && make -f Makefile all LIBPERL_A=3D"libperl.a" LINKTYPE=3D"dynami=
c"
> OPTIMIZE=3D"-fPIC" PREFIX=3D"/pkg/products/perl/perl-5.12.2" PASTHRU_INC=
=3D""
>
> make: Fatal error: Command failed for target `subdirs'
>
> Current working directory
> /home/admin/kstas/httpd/modules/mod_perl/mod_perl-2.0.4/xs/A PR
>
> *** Error code 1
>
> The following command caused the error:
>
> cd APR && make -f Makefile all LIBPERL_A=3D"libperl.a" LINKTYPE=3D"dynami=
c"
> OPTIMIZE=3D"-fPIC" PREFIX=3D"/pkg/products/perl/perl-5.12.2" PASTHRU_INC=
=3D""
>
> make: Fatal error: Command failed for target `subdirs'
>
> Current working directory
> /home/admin/kstas/httpd/modules/mod_perl/mod_perl-2.0.4/xs
>
> *** Error code 1
>
> The following command caused the error:
>
> cd xs && make -f Makefile all LIBPERL_A=3D"libperl.a" LINKTYPE=3D"dynamic=
"
> OPTIMIZE=3D"-fPIC" PREFIX=3D"/pkg/products/perl/perl-5.12.2" PASTHRU_DEFI=
NE=3D""
> PASTHRU_INC=3D"" PERL=3D"/pkg/products/perl/perl-5.12.2/bin/perl"
> DEFINE=3D"-DMP_HAVE_APR_LIBS"
>
> make: Fatal error: Command failed for target `subdirs'
>
>
>

--001485f923568f55970496e74fbc
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

The error means you are trying to link a 64 bit library with a 32 bit one, =
at link time (the error comes from ld, which is the linker).

Setting=
-L in CFLAGS sets /usr/sfw/lib/sparcv9 at compile (not link time)
Setti=
ng -R in CFLAGS sets /usr/sfw/lib/sparcv9 at run time.


None of these help with link time, you need to use -m64 at link time al=
so (LDFLAGS) to link with 64 bit system libraries, and also set LD_LIBRARY_=
PATH=3D/usr/sfw/lib/sparcv9 in your shell (at minimum)

All solaris t=
ool sets default to 32 bit compile and link, unless you specify otherwise. =
Sigh.


You dont need to set LD_LIBRARY_PATH in your compile shell if you have =
the luxury of being able to set the system default to look in /usr/sfw/lib/=
sparcv9 (man crle), but there are several reasons why this may not be possi=
ble or advisable with third party libraries, especially if you have several=
different versions of a library on a system, someone will end up getting t=
he wrong library eventually.


Personally i think adding paths such as /usr/sfw/lib/sparcv9 as s syste=
m default is reasonable, as it is a solaris provided (not third party) libr=
ary. I dont comprehend why sun dont configure solaris to use thier own libr=
aries by default.


But having said all that, you probably need to make sure Perl was compi=
led with the correct 64 bit options in the first place, as most perl module=
s with native code will either use these by default, or will later have lin=
k issues if you don't already.


In other words you need to use the 64 bit compile and link options for =
all options that need to link together or share libraries.

Cheers >Brett

On Wed, Dec 8, 2010 at 11:25 PM, S=
tas, Kamil < >kamil.stas@t-systems.sk> wrote:

r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">












Hello,



=A0



I=A0am trying to compile mod_perl-2.0.4 for Apache
httpd-2.2.17 on Solaris10 SunOS 5.10 Generic_141414-10 sun4v sparc
SUNW,SPARC-Enterprise-T5120



=A0



I=A0am facing ld: wrong ELF class: ELFCLASS64 proble=
m.



Everyting was compiled in m -64 mode, generated .so =
64bit,
with export CC=3D"gcc -m64"



=A0



When compiling mod_perl it looks its trying to compi=
le in
32bit mode, dont understand why.



How to forse it to compile in 64bit mode? Till now g=
cc -m64
was good to use, with exported LD_LIBRARY_PATH and PATH for sparcv9



CFLAGS=“-L/usr/sfw/lib/sparcv9
-R/usr/sfw/lib/sparcv9=93



Perl Version: perl-5.12.2



=A0



Can you advise, please?



=A0



No error log under t/logs/error_log



=A0



=A0



ld: fatal: file
/pkg/products/httpd_test/httpd/httpd-2.2.17a/apr-util//lib/l ibaprutil-1.so:
wrong ELF class: ELFCLASS64



ld: fatal: file
/pkg/products/httpd_test/httpd/httpd-2.2.17a/apr-util//lib/l ibexpat.so: wro=
ng
ELF class: ELFCLASS64



ld: fatal: file
/pkg/products/httpd_test/httpd/httpd-2.2.17a/apr/lib/libapr- 1.so: wrong ELF
class: ELFCLASS64



ld: fatal: File processing errors. No output written=
to
.../../../blib/arch/auto/APR/APR.so



collect2: ld returned 1 exit status



*** Error code 1



make: Fatal error: Command failed for target
`../../../blib/arch/auto/APR/APR.so'



Current working directory /home/admin/kstas/httpd/mo=
dules/mod_perl/mod_perl-2.0.4/xs/APR/APR



*** Error code 1



The following command caused the error:



cd APR && make -f Makefile all
LIBPERL_A=3D"libperl.a" LINKTYPE=3D"dynamic"
OPTIMIZE=3D"-fPIC" PREFIX=3D"/pkg/products/perl/perl-5.12.2&=
quot;
PASTHRU_INC=3D""



make: Fatal error: Command failed for target `subdir=
s'



Current working directory
/home/admin/kstas/httpd/modules/mod_perl/mod_perl-2.0.4/xs/A PR



*** Error code 1



The following command caused the error:



cd APR && make -f Makefile all LIBPERL_A=3D&=
quot;libperl.a"
LINKTYPE=3D"dynamic" OPTIMIZE=3D"-fPIC"
PREFIX=3D"/pkg/products/perl/perl-5.12.2" PASTHRU_INC=3D"&qu=
ot;



make: Fatal error: Command failed for target `subdir=
s'



Current working directory
/home/admin/kstas/httpd/modules/mod_perl/mod_perl-2.0.4/xs



*** Error code 1



The following command caused the error:



cd xs && make -f Makefile all
LIBPERL_A=3D"libperl.a" LINKTYPE=3D"dynamic"
OPTIMIZE=3D"-fPIC" PREFIX=3D"/pkg/products/perl/perl-5.12.2&=
quot;
PASTHRU_DEFINE=3D"" PASTHRU_INC=3D"" PERL=3D"/pkg/=
products/perl/perl-5.12.2/bin/perl"
DEFINE=3D"-DMP_HAVE_APR_LIBS"



make: Fatal error: Command failed for target `subdir=
s'



=A0











--001485f923568f55970496e74fbc--