You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Michael Powe <mi...@trollope.org> on 2010/11/18 15:10:24 UTC

[users@httpd] Module Compiles, Won't Load

Hello,

RedHat Linux 64-bit.  IHS 7.0, which is based on Apache 2.2.x and uses
APR 1.2.

I have a module which compiles on this system but loading fails with
the error 'wrong ELF class: ELFCLASS64'.

'file' indicates that this module and other modules in the directory
are 64-bit.  Other modules load correctly.

According to my research, this error should result when the module is
called in a 32-bit context but was built in 64-bit.  This does not
seem to fit the facts in this case.

What other cases will generate this error?  What are some
troubleshooting steps?

Thanks.

mp

-- 
Michael Powe		michael@trollope.org		Naugatuck CT USA
"...we built a new continent in cyberspace where we could go live and be
free. And the nice thing is that, because we built it, we didn't have
to steal it from aboriginal peoples. It was completely empty, and we
invite everyone to live there with us. No immigration restrictions.
There's room for everyone in the world. Come live in the free world
and be free. That's our idea."  -- Richard Stallman

Re: [users@httpd] Module Compiles, Won't Load

Posted by Eric Covener <co...@gmail.com>.
On Thu, Nov 18, 2010 at 12:02 PM, Michael Powe <mi...@trollope.org> wrote:
> On Thu, Nov 18, 2010 at 09:17:13AM -0500, Eric Covener wrote:
>> On Thu, Nov 18, 2010 at 9:10 AM, Michael Powe <mi...@trollope.org> wrote:
>> > Hello,
>> >
>> > RedHat Linux 64-bit.  IHS 7.0, which is based on Apache 2.2.x and uses
>> > APR 1.2.
>> >
>> > I have a module which compiles on this system but loading fails with
>> > the error 'wrong ELF class: ELFCLASS64'.
>> >
>> > 'file' indicates that this module and other modules in the directory
>> > are 64-bit.  Other modules load correctly.
>>
>>
>> You're misreading something, your Apache 2.2 based server is 32-bit
>> (see apachectl -V) but your compiler creates 64-bit output by default.
>>
>> Try adding  -Wc,-m32 or  -Wc,-m31 (z/Linux) to your apxs  invocation.
>
> Hello,
>
> Thanks for the reply.  It is definitely the case that the module is
> being compiled as 64-bit (-m64).  What is confusing is that we did
> 'file mod_alias.so' in the modules directory and the output is 'ELF
> 64-bit' also.
>
> We did add -Wc,-m32 to apxs, however it doesn't replace the -m64, it
> adds -m32 to the command line so that both -m64 and -m32 are there,
> which then causes the compiler to self-destruct.  That's not really a
> feature, but I suppose it's not reasonable for the tool to use -Wc to
> replace existing arguments.
>
> We will use your comment as a starting point.  Thanks again.

You're probably using apxs from your distros http server instead of
the IHS you intend to be using (although this doesn't explain why you
see mod_alias as a 64-bit module.

Make sure you use an absolute path for apxs for the srver you're
installing the module to.


-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Module Compiles, Won't Load

Posted by Michael Powe <mi...@trollope.org>.
On Thu, Nov 18, 2010 at 09:17:13AM -0500, Eric Covener wrote:
> On Thu, Nov 18, 2010 at 9:10 AM, Michael Powe <mi...@trollope.org> wrote:
> > Hello,
> >
> > RedHat Linux 64-bit.  IHS 7.0, which is based on Apache 2.2.x and uses
> > APR 1.2.
> >
> > I have a module which compiles on this system but loading fails with
> > the error 'wrong ELF class: ELFCLASS64'.
> >
> > 'file' indicates that this module and other modules in the directory
> > are 64-bit.  Other modules load correctly.
> 
> 
> You're misreading something, your Apache 2.2 based server is 32-bit
> (see apachectl -V) but your compiler creates 64-bit output by default.
> 
> Try adding  -Wc,-m32 or  -Wc,-m31 (z/Linux) to your apxs  invocation.

Hello,

Thanks for the reply.  It is definitely the case that the module is
being compiled as 64-bit (-m64).  What is confusing is that we did
'file mod_alias.so' in the modules directory and the output is 'ELF
64-bit' also.  

We did add -Wc,-m32 to apxs, however it doesn't replace the -m64, it
adds -m32 to the command line so that both -m64 and -m32 are there,
which then causes the compiler to self-destruct.  That's not really a
feature, but I suppose it's not reasonable for the tool to use -Wc to
replace existing arguments.

We will use your comment as a starting point.  Thanks again.

mp

-- 
Michael Powe		michael@trollope.org		Naugatuck CT USA
Senor Castro has been accused of communist sympathies, but this means
very little since all opponents of the regime are automatically called
communists.  In fact he is further to the right than General Batista.
  -- "Cuba's Rightist Rebel", The Economist, April 26, 1958

Re: [users@httpd] Module Compiles, Won't Load

Posted by Eric Covener <co...@gmail.com>.
On Thu, Nov 18, 2010 at 9:10 AM, Michael Powe <mi...@trollope.org> wrote:
> Hello,
>
> RedHat Linux 64-bit.  IHS 7.0, which is based on Apache 2.2.x and uses
> APR 1.2.
>
> I have a module which compiles on this system but loading fails with
> the error 'wrong ELF class: ELFCLASS64'.
>
> 'file' indicates that this module and other modules in the directory
> are 64-bit.  Other modules load correctly.


You're misreading something, your Apache 2.2 based server is 32-bit
(see apachectl -V) but your compiler creates 64-bit output by default.

Try adding  -Wc,-m32 or  -Wc,-m31 (z/Linux) to your apxs  invocation.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org