我如何编译一个64位平台上的32位Apache模块? [英] How do I compile a 32 bit apache module for a 64 bit platform?
问题描述
我想COMPLE mod_auth_kerb所为Apache在Mac OS X 10.5.7。我没有得到任何编译错误,但是当Apache试图加载它:
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的:在/private/etc/apache2/httpd.conf线160语法错误:无法加载/usr/libexec/apache2/mod_auth_kerb.so到服务器:的dlopen(/ USR /libexec/apache2/mod_auth_kerb.so,10):找不到合适的图像。确实发现:\ñ\ t在/ usr / libexec中/的Apache2 / mod_auth_kerb.so:Mach-O的,但错误的体系结构
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
我曾尝试在make文件以下内容:
I have tried the following in the make file:
ARCHFLAGS =' - 拱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
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
我已经看过这些主题:
http://lists.apple.com/archives/ UNIX的移植/ 2008 /三月/ msg00061.html
的http:// objectmix。 COM /阿帕奇/ 690208-再mod_auth_kerb所-MAC-OS-X-10-5-client.html
我也改变了这个源代码中:
I also changed this in the source:
从
krb5_rc_resolve_full
至
__KerberosInternal_krb5_rc_resolve_full
from
krb5_rc_resolve_full
to
__KerberosInternal_krb5_rc_resolve_full
我不能让Apache来加载它,它声称它是错误的架构。我认为Apache是64位从地上爬起来在这个版本的Mac服务器,所以这可能是问题。我只是不知道怎么熬过来的。
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.
行160是红鲱鱼在httpd.conf文件(它有##)。
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.
我有一个G5的PPC 64。
I have a G5 PPC 64.
感谢你。
编辑:
奇怪的是这样的:
otool -hv mod_auth_kerb.so mod_auth_kerb.so:马赫头 魔术CPUTYPE cpusubtype帽文件类型ncmds sizeofcmds标志
otool -hv mod_auth_kerb.so mod_auth_kerb.so: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC_64 PPC64全部为0x00束10 1328 NOUNDEFS DYLDLINK TWOLEVEL
MH_MAGIC_64 PPC64 ALL 0x00 BUNDLE 10 1328 NOUNDEFS DYLDLINK TWOLEVEL
所以,我不知道什么是错。
So I don't know what's wrong.
我在PPC64,这就是它看起来像我编了。
I am on the PPC64 and that's what it looks like I have compiled.
推荐答案
如果我是正确以下的问题,我的认为的,你将需要建立/安装的交叉编译工具链从PPC建立它的x86_64或其他非PPC架构,甚至在某些情况下,竞价排名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.
我不会建议这个,如果你不熟悉GCC,Unix的工具链和达尔文基金会的东西一般。
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:
- http://lists.apple.com/archives/达尔文开发/ 2002 / DEC / msg00062.html
- http://ranger.befunk.com/fink/darwin-cross/
- http://myownlittleworld.com/miscellaneous/computers/darwin-cross- distcc.html
- http://www.google.com/search?q=Darwin+十字+编译
- http://lists.apple.com/archives/darwin-development/2002/Dec/msg00062.html
- http://ranger.befunk.com/fink/darwin-cross/
- http://myownlittleworld.com/miscellaneous/computers/darwin-cross-distcc.html
- http://www.google.com/search?q=Darwin+cross+compilation
这篇关于我如何编译一个64位平台上的32位Apache模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!