如何在 Mac OS X 上将 OpenSSL 构建为 32 位 (i386)? [英] How do I build OpenSSL as 32-bit (i386) on Mac OS X?

查看:41
本文介绍了如何在 Mac OS X 上将 OpenSSL 构建为 32 位 (i386)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了 OpenSSL 源代码,并完成了 configmakesudo make install 三部曲.

I downloaded OpenSSL sources, and did the config, make, sudo make install trilogy.

然后我构建了我的项目,在 libcrypto.a 和 libssl.a 中链接,但是得到:

I then built my project, linking in libcrypto.a and libssl.a, but got:

ld: warning: in /usr/local/ssl/lib/libcrypto.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: in /usr/local/ssl/lib/libssl.a, file was built for unsupported file format which is not the architecture being linked (x86_64)

我很确定我想将 OpenSSL 重新构建为 32 位 (i386),因为(出于与此问题无关的原因)我的项目需要是 32 位的.

I'm pretty sure I want to re-build OpenSSL as 32-bit (i386), because (for reasons not pertinent to this question) my project needs to be 32-bit.

如何在 Mac OS X 上将 OpenSSL 构建为 32 位?(我在安装"文件中没有看到任何关于此的内容.)

How do I build OpenSSL as 32-bit on Mac OS X? (I didn't see anything about this in the "INSTALL" file.)

推荐答案

$ curl https://www.openssl.org/source/openssl-1.0.0a.tar.gz | tar xz
$ cd openssl-1.0.0a
$ export CFLAGS="-arch i386"
$ export LDFLAGS="-arch i386"
$ ./config
$ make
$ lipo -info libssl.a
input file libssl.a is not a fat file
Non-fat file: libssl.a is architecture: i386
$ lipo -info libcrypto.a
input file libcrypto.a is not a fat file
Non-fat file: libcrypto.a is architecture: i386

这篇关于如何在 Mac OS X 上将 OpenSSL 构建为 32 位 (i386)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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