gpt4 book ai didi

macos - 如何在 Mac OS X 上将 OpenSSL 构建为 32 位 (i386)?

转载 作者:IT老高 更新时间:2023-10-28 11:20:54 25 4
gpt4 key购买 nike

我下载了 OpenSSL 源码,做了 configmakesudo make install 三部曲。

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

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 位的。

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

最佳答案

$ 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

关于macos - 如何在 Mac OS X 上将 OpenSSL 构建为 32 位 (i386)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4084210/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com