[openssl-users] MinGW64 / MSYS2 and ./Configure : use of Windows style path causing failures to 'make'

Ron Gaw <ronmlgaw at yahoo dot com> ronmlgaw at yahoo.com
Tue Dec 27 05:24:04 UTC 2016


I am using a MinGW64 / MSYS2 environment to compile OpenSSL1.1.0c, but failing consistently after multiple attempts with a few variations each attempt (including deleting entire source directory and re-untar/ungzipping).   I believe there's something wrong either with my environment settings or ./Configure options.  This is the output of ./Configure after setting only the CFLAGS env var:
$ export "CFLAGS=-03"$ ./Configure mingw64 --prefix=/usr/local zlib shared
Configuring OpenSSL version 1.1.0c (0x1010003fL)
    no-asan         [default]  OPENSSL_NO_ASAN
    no-crypto-mdebug [default]  OPENSSL_NO_CRYPTO_MDEBUG
    no-crypto-mdebug-backtrace [default]  OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
    no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128
    no-egd          [default]  OPENSSL_NO_EGD
    no-fuzz-afl     [default]  OPENSSL_NO_FUZZ_AFL
    no-fuzz-libfuzzer [default]  OPENSSL_NO_FUZZ_LIBFUZZER
    no-heartbeats   [default]  OPENSSL_NO_HEARTBEATS
    no-md2          [default]  OPENSSL_NO_MD2 (skip dir)
    no-msan         [default]  OPENSSL_NO_MSAN
    no-rc5          [default]  OPENSSL_NO_RC5 (skip dir)
    no-sctp         [default]  OPENSSL_NO_SCTP
    no-ssl-trace    [default]  OPENSSL_NO_SSL_TRACE
    no-ssl3         [default]  OPENSSL_NO_SSL3
    no-ssl3-method  [default]  OPENSSL_NO_SSL3_METHOD
    no-ubsan        [default]  OPENSSL_NO_UBSAN
    no-unit-test    [default]  OPENSSL_NO_UNIT_TEST
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS
    no-zlib-dynamic [default]
Configuring for mingw64
CC            =gcc
CFLAG         =-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall -O3 -D_MT
SHARED_CFLAG  =-D_WINDLL
DEFINES       =ZLIB DSO_WIN32 NDEBUG OPENSSL_THREADS OPENSSL_NO_STATIC_ENGINE OPENSSL_PIC OPENSSL_IA32_SSE2 OPENSSL_BN_ASM_MONT OPENSSL_BN_ASM_MONT5 OPENSSL_BN_ASM_GF2m SHA1_ASM SHA256_ASM SHA512_ASM RC4_ASM MD5_ASM AES_ASM VPAES_ASM BSAES_ASM GHASH_ASM ECP_NISTZ256_ASM POLY1305_ASM
LFLAG         =
PLIB_LFLAG    =
EX_LIBS       =-lz -lws2_32 -lgdi32 -lcrypt32
APPS_OBJ      =win32_init.o
CPUID_OBJ     =x86_64cpuid.o
UPLINK_OBJ    =
BN_ASM        =asm/x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o rsaz_exp.o rsaz-x86_64.o rsaz-avx2.o
EC_ASM        =ecp_nistz256.o ecp_nistz256-x86_64.o
DES_ENC       =des_enc.o fcrypt_b.o
AES_ENC       =aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o aesni-sha256-x86_64.o aesni-mb-x86_64.o
BF_ENC        =bf_enc.o
CAST_ENC      =c_enc.o
RC4_ENC       =rc4-x86_64.o rc4-md5-x86_64.o
RC5_ENC       =rc5_enc.o
MD5_OBJ_ASM   =md5-x86_64.o
SHA1_OBJ_ASM  =sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o sha1-mb-x86_64.o sha256-mb-x86_64.o
RMD160_OBJ_ASM=
CMLL_ENC      =cmll-x86_64.o cmll_misc.o
MODES_OBJ     =ghash-x86_64.o aesni-gcm-x86_64.o
PADLOCK_OBJ   =e_padlock-x86_64.o
CHACHA_ENC    =chacha-x86_64.o
POLY1305_OBJ  =poly1305-x86_64.o
BLAKE2_OBJ    =
PROCESSOR     =
RANLIB        =ranlib
ARFLAGS       =
PERL          =C:\msys64\mingw64\bin\perl.exe

SIXTY_FOUR_BIT mode

Configured for mingw64.

$ make
C:\msys64\mingw64\bin\perl.exe "-I." -Mconfigdata "util\dofile.pl" \
    "-oMakefile" crypto\include\internal\bn_conf.h.in > crypto\include\internal\bn_conf.h
/bin/sh: C:msys64mingw64binperl.exe: command not found
make: *** [Makefile:701: crypto\include\internal\bn_conf.h] Error 127


It seems the "\" is the culprit here, since the execution of the make command appears to strip those out and then (as expected) the /bin/sh cannot recognize that large hash of what should have been the path to Perl.  I did edit the first Makefile above to :    Change the base PERL to "C:/msys64/mingw64/bin/perl.exe", *and*
    crypto/include/internal/bin_conf.h.in > crypto/include/internal/bin_conf.h
The above worked, but *only* for that line of the make file (as I expected).  It then fails at the very next line because I didn't edit every "\" to become "/" instead.  I'm not sure I'm willing to do that much editing... seems there's got to be a better way to make this work.

I realize this has something to do with specifying ./Configure mingw64 .... and how it's populating the Makefiles using Windows-style paths, but I'm not sure it's safe / okay to fake having a Unix build target instead, since this will likely create new / other problems with libraries, etc.
Am I missing a ./Configure option, an environment variable I should preset, or something else altogether?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20161227/6744c147/attachment.html>


More information about the openssl-users mailing list