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

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

问题描述

我下载了OpenSSL的来源,并且做了配置制作须藤使安装三部曲。

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

  LD:警告:在/usr/local/ssl/lib/libcrypto.a,文件是专为不支持的文件格式,这是不被连接的架构下(x86_64)
LD:警告:在/usr/local/ssl/lib/libssl.a,文件是专为不支持的文件格式,这是不被连接的架构下(x86_64)

我是pretty肯定,我想重新建立OpenSSL的为32位(I386),因为(原因不相关的这个问题)我的项目必须是32位的。

如何构建OpenSSL的32位Mac OS X上? (我没有看到有关此方面的安装文件什么。)


解决方案

  $卷曲http://www.openssl.org/source/openssl-1.0.0a.tar.gz |焦油XZ
$ CD的OpenSSL 1.0.0a
$出口CFLAGS = - 拱i386的
$出口LDFLAGS = - 拱i386的
$ ./config中
$化妆
$脂-info libssl.a
输入文件libssl.a不是fat文件
非FAT文件:libssl.a是架构:I386
$脂-info libcrypto.a
输入文件libcrypto.a不是fat文件
非FAT文件:libcrypto.a是架构:I386

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

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)

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.

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

解决方案

$ curl http://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天全站免登陆