简体   繁体   English

如何为64位平台编译32位Apache模块?

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

I am trying to comple mod_auth_kerb for apache on mac os x 10.5.7. 我正在尝试在Mac OS X 10.5.7上为Apache填充mod_auth_kerb。 I get no compilation errors, but when apache tries to load it: 我没有编译错误,但是当apache尝试加载它时:

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. org.apache.httpd [95092]:httpd:/private/etc/apache2/httpd.conf的第160行的语法错误:无法将/usr/libexec/apache2/mod_auth_kerb.so加载到服务器中:dlopen(/ usr / libexec / apache2 / mod_auth_kerb.so,10):找不到合适的图像。 Did find:\\n\\t/usr/libexec/apache2/mod_auth_kerb.so: mach-o, but wrong architecture 确实找到了:\\ n \\ t / usr / libexec / apache2 / mod_auth_kerb.so:mach-o,但是体系结构错误

I have tried the following in the make file: 我已经在make文件中尝试了以下操作:

ARCHFLAGS='-arch ppc64' CPPFLAGS = -I. 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 -Ispnegokrb5 $(KRB5_CPPFLAGS)$(KRB4_CPPFLAGS)$(DEFS)-mpowerpc64 -mcpu = G5 -mtune = G5 -arch ppc64 LDFLAGS = $(KRB5_LDFLAGS)$(KRB4_LDFLAGS)$(LIB_resolv)-mpower 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://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 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 来自krb5_rc_resolve_full
to __KerberosInternal_krb5_rc_resolve_full 到__KerberosInternal_krb5_rc_resolve_full

I cannot get apache to load it and it claims it is the wrong architecture. 我无法让Apache加载它,它声称这是错误的体系结构。 I think apache is 64 bit from the ground up in this version of mac server so that is probably the problem. 我认为apache在此版本的mac服务器中是完全64位的,因此可能是问题所在。 I just don't know how to get through it. 我只是不知道该怎么做。

Line 160 is a red herring in the httpd.conf file (it has ##). 第160行是httpd.conf文件中的红色鲱鱼(带有##)。

I don't know how to compile it correctly and was hoping for help. 我不知道如何正确编译它,并希望获得帮助。

I have a G5 PPC 64. 我有一个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 otool -hv mod_auth_kerb.so mod_auth_kerb.so:Mach标头魔术cputype cpusubtype限制文件类型ncmds sizeofcmds标志

MH_MAGIC_64 PPC64 ALL 0x00 BUNDLE 10 1328 NOUNDEFS DYLDLINK TWOLEVEL MH_MAGIC_64 PPC64 ALL 0x00捆绑包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. 我在PPC64上,这就是我编译后的样子。

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 . 如果我正确地遵循了这个问题,我认为您将需要构建/安装交叉编译工具链,以将其从PPC 编译到x86_64或其他非PPC架构,甚至在某些情况下也将PPC 编译 到PPC64,反之亦然

I would not advise this if you are unfamiliar with GCC, the Unix toolchain and the Darwin foundation stuff in general. 如果您不熟悉GCC,Unix工具链和Darwin基础知识,我不建议您这样做。

You might be able to find Darwin toolchain setups on the web. 您也许可以在网上找到Darwin工具链设置。 Some links in the right direction: 一些正确方向的链接:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM