How do I compile a 32 bit apache module for a 64 bit platform?

假如想象 提交于 2019-12-25 01:34:47

问题


I am trying to comple mod_auth_kerb for apache on mac os x 10.5.7. I get no compilation errors, but when apache tries to load it:

org.apache.httpd[95092]: httpd: Syntax error on line 160 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/mod_auth_kerb.so into server: dlopen(/usr/libexec/apache2/mod_auth_kerb.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/mod_auth_kerb.so: mach-o, but wrong architecture

I have tried the following in the make file:

ARCHFLAGS='-arch ppc64' CPPFLAGS = -I. -Ispnegokrb5 $(KRB5_CPPFLAGS) $(KRB4_CPPFLAGS) $(DEFS) -mpowerpc64 -mcpu=G5 -mtune=G5 -arch ppc64 LDFLAGS = $(KRB5_LDFLAGS) $(KRB4_LDFLAGS) $(LIB_resolv) -mpowerpc64 -mcpu=G5 -mtune=G5 -arch ppc64 CFLAGS = -mpowerpc64 -mcpu=G5 -mtune=G5 -arch ppc64

I have looked in these threads:

http://lists.apple.com/archives/unix-porting/2008/Mar/msg00061.html

http://objectmix.com/apache/690208-re-mod_auth_kerb-mac-os-x-10-5-client.html

I also changed this in the source:

from krb5_rc_resolve_full
to __KerberosInternal_krb5_rc_resolve_full

I cannot get apache to load it and it claims it is the wrong architecture. I think apache is 64 bit from the ground up in this version of mac server so that is probably the problem. I just don't know how to get through it.

Line 160 is a red herring in the httpd.conf file (it has ##).

I don't know how to compile it correctly and was hoping for help.

I have a G5 PPC 64.

Thank you.

EDIT:

What is odd is this:

otool -hv mod_auth_kerb.so mod_auth_kerb.so: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags

MH_MAGIC_64 PPC64 ALL 0x00 BUNDLE 10 1328 NOUNDEFS DYLDLINK TWOLEVEL

So I don't know what's wrong.

I am on the PPC64 and that's what it looks like I have compiled.


回答1:


If i'm following the question correctly, I think you will need to build/install a cross compiling toolchain to build it from PPC to x86_64 or another non-PPC architecture, or even in some cases, PPC to PPC64 and vice-versa.

I would not advise this if you are unfamiliar with GCC, the Unix toolchain and the Darwin foundation stuff in general.

You might be able to find Darwin toolchain setups on the web. Some links in the right direction:

  1. http://lists.apple.com/archives/darwin-development/2002/Dec/msg00062.html
  2. http://ranger.befunk.com/fink/darwin-cross/
  3. http://myownlittleworld.com/miscellaneous/computers/darwin-cross-distcc.html
  4. http://www.google.com/search?q=Darwin+cross+compilation


来源:https://stackoverflow.com/questions/1145728/how-do-i-compile-a-32-bit-apache-module-for-a-64-bit-platform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!