3

I am trying to build openssl from the github release https://github.com/openssl/openssl/archive/OpenSSL-fips-2_0_13.tar.gz and trying to compile it manually. I am trying to compile this on a Mac OSX version 10.11.5, this is the series of steps I have taken

./Configure darwin64-x86_64-cc
make

But I get this error

bsaes-x86_64.s:580:1: error: invalid symbol redefinition
_bsaes_enc_key_convert:

When I compile normally according to the INSTALL file, I get en error in the link step, presumably because the archive file was built for a 32 bit system. This is the warning I get when running ./config

WARNING! If you wish to build 64-bit library, then you have to
         invoke './Configure darwin64-x86_64-cc' *manually*.
         You have about 5 seconds to press Ctrl-C to abort.

And then the corresponding error when linking with the archive from the ./config && make step is this

ld: warning: ld: warning: ignoring file openssl/lib/libssl.a, file was
built for archive which is not the architecture being linked (x86_64): 
openssl/lib/libssl.aignoring file openssl/lib/libcrypto.a, file was built 
for archive which is not the architecture being linked (x86_64): 
openssl/lib/libcrypto.a

Note I am building this for a C++ project using a C compiler to compile the C code and using a c++ compiler (or ld since both compilers use the same linker?) to link code (not sure if that makes a difference)

Could someone tell me how to build and link with openssl correctly?

Curious
  • 20,870
  • 8
  • 61
  • 146
  • You ***cannot*** build OpenSSL library with a C++ compiler. You must use a C compiler. Later, you ***can*** compile a user program with a C++ compiler. You can also perform `KERNEL_BITS=64 ./config shared no-ssl2 no-ssl3 enable-ec_nistp_64_gcc_128 ...`. A related question is [Build Multiarch OpenSSL on OS X](http://stackoverflow.com/q/25530429) on Stack Overflow. Also see [Compilation and Installation](https://wiki.openssl.org/index.php/Compilation_and_Installation) on the OpenSSL wiki. – jww Dec 31 '16 at 09:53
  • @jww I was wrong in saying i was using a C++ compiler, I was compiling the code using a C compiler and then linking with a C++ compiler. I will correct the question – Curious Jan 01 '17 at 03:18

1 Answers1

2

Try using the no-asm option during ./configure:

$ make clean
$ ./Configure darwin64-x86_64-cc no-asm
$ make test
$ make 
....

Elliptic curve routines seem to be broken in this version, so maybe file a bug report about that, otherwise it should compile/build without issue.

Curious
  • 20,870
  • 8
  • 61
  • 146
l'L'l
  • 44,951
  • 10
  • 95
  • 146