如何为 64 位平台编译 32 位 apache 模块? [英] How do I compile a 32 bit apache module for a 64 bit platform?

查看:27
本文介绍了如何为 64 位平台编译 32 位 apache 模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 mac os x 10.5.7 上为 apache 完成 mod_auth_kerb.我没有收到编译错误,但是当 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): 找不到合适的图像.确实找到了: /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: /usr/libexec/apache2/mod_auth_kerb.so: mach-o, but wrong architecture

我在 make 文件中尝试了以下内容:

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 ppc64LDFLAGS = $(KRB5_LDFLAGS) $(KRB4_LDFLAGS) $(LIB_resolv) -mpowerpc64 -mcpu=G5 -mtune=G5 -arch ppc64CFLAGS = -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-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:

来自krb5_rc_resolve_full
到__KerberosInternal_krb5_rc_resolve_full

from krb5_rc_resolve_full
to __KerberosInternal_krb5_rc_resolve_full

我无法让 apache 加载它,它声称它是错误的架构.我认为 apache 在这个版本的 mac 服务器中是 64 位的,所以这可能是问题所在.我只是不知道如何度过它.

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 caps filetype ncmds sizeofcmds flags

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

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 架构,甚至在某些情况下,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.

您或许可以在网络上找到 Darwin 工具链设置.一些正确方向的链接:

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+交叉+编译

这篇关于如何为 64 位平台编译 32 位 apache 模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆