Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you compile OpenSSL for x64?

After following the instructions in INSTALL.W64 I have two problems:

  • The code is still written to the "out32" folder. I need to be able to link to both 32-bit and 64-bit versions of the library on my workstation, so I don't want the 64-bit versions to clobber the 32-bit libs.
  • The output is still 32-bit! This means that I get "unresolved external symbol" errors when trying to link to the libraries from an x64 app.
like image 883
kgriffs Avatar asked Oct 01 '08 15:10

kgriffs


People also ask

How do I compile OpenSSL source code?

Compiling OpenSSL for Linux on Ubuntu 20.04 In addition to the more advanced . configure script provided with the source, OpenSSL's source directory includes a friendlier . config script with common defaults. Make this script executable and run it.


1 Answers

To compile the static libraries (both release and debug), this is what you need to do:

  1. Install Perl - www.activestate.com
  2. Run the "Visual Studio 2008 x64 Cross Tools Command Prompt" (Note: The regular command prompt WILL NOT WORK.)
  3. Configure with perl Configure VC-WIN64A no-shared no-idea
  4. Run: ms\do_win64a
  5. EDIT ms\nt.mak and change "32" to "64" in the output dirs:
    # The output directory for everything intersting
    OUT_D=out64.dbg
    # The output directory for all the temporary muck
    TMP_D=tmp64.dbg
    # The output directory for the header files
    INC_D=inc64
    INCO_D=inc64\openssl
  1. EDIT ms\nt.mak and remove bufferoverflowu.lib from EX_LIBS if you get an error about it.
  2. Run: nmake -f ms\nt.mak
  3. EDIT the ms\do_win64a file and ADD "debug" to all lines, except the "ml64" and the last two lines
  4. Run: ms\do_win64a
  5. Repeat steps 4 and 5
  6. EDIT the ms\nt.mak file and ADD /Zi to the CFLAG list!
  7. Run: nmake -f ms\nt.mak
like image 176
kgriffs Avatar answered Oct 09 '22 08:10

kgriffs