I have a program that currently has to be compiled in 32 bit mode (for now) and needs to be linked against a version of openSSL with the experimental ciphers included. Therefore I need to compile a 32 bit openSSL. Using
./config -m32
results in both -m32 and -m64 being included in the compiler flags.
The tumbleweed badge reminded me to come back and answer it myself! The way I got this to work was to use:
setarch i386 ./config -m32
Unfortunately for me, setarch was not a valid command on my LFS system, so I had to do it in a different way:
./Configure shared threads zlib-dynamic --prefix=/usr --openssldir=/etc/ssl -m32 linux-generic32
Note: this is the minimal example to make it work as OP wishes:
./Configure -m32 linux-generic32
I had a similar problem, except I was trying to compile on a Solaris x86 machine. setarch is not available in Solaris, so I could not use the simpler approach suggested in one of the other answers here.
The 'config' script for OpenSSL is a shell wrapper which determines what it thinks is the target system, then calls the 'Configure' perl script, which does the heavy lifting. Configure has a lot of built in targets: you can use 'perl Configure TABLE' to get a list of all of them. It is a case of selecting the target you need from the available list.
So, if you want to force it to build for a target other than the one it thinks you should, you can call 'Configure' directly, passing the name of the target you want. For example, to get my Solaris 32 bit build to work, I used:
./Configure solaris-x86-cc --shared
or, in the case of the original question, if it was a Linux system you could use:
./Configure linux-generic32 --shared
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With