Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I build OpenSSL as 32-bit (i386) on Mac OS X?

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.)

like image 917
Daryl Spitzer Avatar asked Nov 03 '10 04:11

Daryl Spitzer


1 Answers

$ 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
like image 110
Ned Deily Avatar answered Oct 03 '22 07:10

Ned Deily