在 OS X 上编译 mod_auth_kerb

在 OS X 上编译 mod_auth_kerb

我正在尝试安装 mod_auth_kerb,但似乎找不到有关在 OS X 上编译它的任何信息。当我尝试编译时,出现以下信息:

./apxs.sh "-I. -Ispnegokrb5 -I/include  " "-dynamic -g -O2 -arch x86_64 -Wl,-search_paths_first -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv  -lresolv" "" "/Applications/XAMPP/xamppfiles/bin/apxs" "-c" "src/mod_auth_kerb.c"
/Applications/XAMPP/xamppfiles/build/libtool --silent --mode=compile gcc -prefer-pic -I/Applications/XAMPP/xamppfiles/include -L/Applications/XAMPP/xamppfiles/lib -mmacosx-version-min=10.4 -arch i386 -arch ppc  -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp  -I/Applications/XAMPP/xamppfiles/include  -I/Applications/XAMPP/xamppfiles/include   -I/Applications/XAMPP/xamppfiles/include -I/Applications/XAMPP/xamppfiles/include -I. -Ispnegokrb5 -I/include  -c -o src/mod_auth_kerb.lo src/mod_auth_kerb.c && touch src/mod_auth_kerb.slo
src/mod_auth_kerb.c: In function ‘authenticate_user_krb5pwd’:
src/mod_auth_kerb.c:1030: warning: passing argument 8 of ‘verify_krb5_user’ discards qualifiers from pointer target type
src/mod_auth_kerb.c: In function ‘authenticate_user_krb5pwd’:
src/mod_auth_kerb.c:1030: warning: passing argument 8 of ‘verify_krb5_user’ discards qualifiers from pointer target type
/Applications/XAMPP/xamppfiles/build/libtool --silent --mode=link gcc -o src/mod_auth_kerb.la -dynamic -g -O2 -arch x86_64 -Wl,-search_paths_first -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv -lresolv  -rpath /Applications/XAMPP/xamppfiles/modules -module -avoid-version    src/mod_auth_kerb.lo
ld: warning: in src/.libs/mod_auth_kerb.o, missing required architecture x86_64 in file
warning: no debug symbols in executable (-arch x86_64)

我的配置如下:

./configure --with-krb4=no CFLAGS='-g -O2 -arch x86_64'

我应该提到我在这台机器上使用带有开发包的 XAMPP。

答案1

如果没有更多的输出,很难 100% 确定,但很有可能某些依赖项在 64 位架构下不可用。

最简单的解决方法是将 CFLAGS 更改为:-g -O2 -arch i386

这将以 32 位模式进行编译。


让我改进一下这个仓促且有些不正确的答案。

此问题是由代码编译不匹配引起的。有些代码是针对 64 位编译的,有些是针对 32 位编译的。

我最近在编写程序时遇到了这个问题。我已将 CFLAGS 设置为“-arch i386 -arch ppc”以获得 32 位通用版本,但我忘记设置 CPPLFAGS。不幸的是,程序的一部分是用 C 编写的,另一部分是用 C++ 编写的。所以我最终遇到了同样的错误。一旦我设置 CPPFLAGS 以便所有文件都编译为 32 位,错误就解决了。

我看到您的输出中有一些文件带有 -arch i386,还有一些带有 -arch x86_64。这就像您问题的根源。

相关内容