在win64上构建openssl失败 [英] build openssl on win64 fail
问题描述
在openssl
源代码目录中使用msys
运行此命令时.
when run this command with msys
in openssl
source code directory.
$ ./config
Operating system: x86_64-whatever-mingw
Configuring for mingw
Configuring for mingw
no-ec_nistp_64_gcc_128 [default] OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)
no-gmp [default] OPENSSL_NO_GMP (skip dir)
no-jpake [experimental] OPENSSL_NO_JPAKE (skip dir)
no-krb5 [krb5-flavor not specified] OPENSSL_NO_KRB5
no-libunbound [experimental] OPENSSL_NO_LIBUNBOUND (skip dir)
no-md2 [default] OPENSSL_NO_MD2 (skip dir)
no-rc5 [default] OPENSSL_NO_RC5 (skip dir)
no-rfc3779 [default] OPENSSL_NO_RFC3779 (skip dir)
no-sctp [default] OPENSSL_NO_SCTP (skip dir)
no-shared [default]
no-ssl-trace [default] OPENSSL_NO_SSL_TRACE (skip dir)
no-ssl2 [default] OPENSSL_NO_SSL2 (skip dir)
no-store [experimental] OPENSSL_NO_STORE (skip dir)
no-unit-test [default] OPENSSL_NO_UNIT_TEST (skip dir)
no-weak-ssl-ciphers [default] OPENSSL_NO_WEAK_SSL_CIPHERS (skip dir)
no-zlib [default]
no-zlib-dynamic [default]
IsMK1MF=0
CC =gcc
CFLAG =-DOPENSSL_THREADS -D_MT -DDSO_WIN32 -DL_ENDIAN -DWIN32_LEAN_AND_M EAN -fomit-frame-pointer -O3 -march=i486 -Wall -DOPENSSL_BN_ASM_PART_WORDS -DOPE NSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPO OL_ASM -DGHASH_ASM
EX_LIBS =-lws2_32 -lgdi32 -lcrypt32
CPUID_OBJ =x86cpuid.o
BN_ASM =bn-586.o co-586.o x86-mont.o x86-gf2m.o
EC_ASM =
DES_ENC =des-586.o crypt586.o
AES_ENC =aes-586.o vpaes-x86.o aesni-x86.o
BF_ENC =bf-586.o
CAST_ENC =cast-586.o
RC4_ENC =rc4-586.o
RC5_ENC =rc5-586.o
MD5_OBJ_ASM =md5-586.o
SHA1_OBJ_ASM =sha1-586.o sha256-586.o sha512-586.o
RMD160_OBJ_ASM=rmd-586.o
CMLL_ENC =cmll-x86.o
MODES_OBJ =ghash-x86.o
ENGINES_OBJ =
PROCESSOR =
RANLIB =/c/Program Files (x86)/mingw-w64/i686-6.3.0-posix-dwarf-rt_v5-rev 1/mingw32/bin/ranlib.exe
ARFLAGS =
PERL =/usr/bin/perl.exe
THIRTY_TWO_BIT mode
DES_PTR used
DES_RISC1 used
DES_UNROLL used
BN_LLONG mode
RC4_INDEX mode
RC4_CHUNK is undefined
e_os2.h => include/openssl/e_os2.h
/usr/bin/sh: -c: line 0: syntax error near unexpected token `('
/usr/bin/sh: -c: line 0: `set -e; target=links; for dir in crypto ssl engines ap ps test tools; do if [ -d "$dir" ]; then ( cd $dir && echo "making $target in $dir..." && TOP= && unset TOP ${LIB+LIB} ${LIBS+LIBS} ${INCLUDE+INCLUDE} ${IN CLUDES+INCLUDES} ${DIR+DIR} ${DIRS+DIRS} ${SRC+SRC} ${LIBSRC+LIBSRC} ${LIBOBJ+LI BOBJ} ${ALL+ALL} ${EXHEADER+EXHEADER} ${HEADER+HEADER} ${GENERAL+GENERAL} ${CFLA GS+CFLAGS} ${ASFLAGS+ASFLAGS} ${AFLAGS+AFLAGS} ${LDCMD+LDCMD} ${LDFLAGS+LDFLAGS} ${SCRIPTS+SCRIPTS} ${SHAREDCMD+SHAREDCMD} ${SHAREDFLAGS+SHAREDFLAGS} ${SHARED_L IB+SHARED_LIB} ${LIBEXTRAS+LIBEXTRAS} ${APPS+APPS} && C:/Program Files (x86)/min gw-w64/i686-6.3.0-posix-dwarf-rt_v5-rev1/mingw32/bin/make -e LC_ALL=C PLATFORM=' mingw' PROCESSOR='' CC='gcc' CFLAG='-DOPENSSL_THREADS -D_MT -DDSO_WIN32 -DL_ENDI AN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall -DOPENSSL_BN _ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM' AS='gcc' ASFLAG='-DOPENSSL_THREADS -D_M T -DDSO_WIN32 -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i 486 -Wall -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM - DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -c' AR='ar r' NM= 'nm' RANLIB='/c/Program Files (x86)/mingw-w64/i686-6.3.0-posix-dwarf-rt_v5-rev1/ mingw32/bin/ranlib.exe' RC='windres' CROSS_COMPILE='' PERL='C:/Program Files/Git /usr/bin/perl.exe' ENGDIRS='ccgost' SDIRS='objects md4 md5 sha mdc2 hmac ripemd whrlpool des aes rc2 rc4 idea bf cast camellia seed modes bn ec rsa dsa ecdsa dh ecdh dso engine buffer bio stack lhash rand err evp asn1 pem x509 x509v3 conf t xt_db pkcs7 pkcs12 comp ocsp ui krb5 cms pqueue ts srp cmac' LIBRPATH='/usr/loca l/ssl/lib' INSTALL_PREFIX='' INSTALLTOP='/usr/local/ssl' OPENSSLDIR='/usr/local/ ssl' LIBDIR='lib' MAKEDEPEND='$${TOP}/util/domd $${TOP} -MD gcc' DEPFLAG='-DOPEN SSL_NO_DEPRECATED -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO _JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RF C3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_SSL2 -DOPENSSL_NO_ST ORE -DOPENSSL_NO_UNIT_TEST -DOPENSSL_NO_WEAK_SSL_CIPHERS' MAKEDEPPROG='gcc' SHAR ED_LDFLAGS='' KRB5_INCLUDES='' LIBKRB5='' ZLIB_INCLUDE='' LIBZLIB='' EXE_EXT='.e xe' SHARED_LIBS='' SHLIB_EXT='.dll.a' SHLIB_TARGET='cygwin-shared' PEX_LIBS='' E X_LIBS='-lws2_32 -lgdi32 -lcrypt32' CPUID_OBJ='x86cpuid.o' BN_ASM='bn-586.o co-5 86.o x86-mont.o x86-gf2m.o' EC_ASM='' DES_ENC='des-586.o crypt586.o' AES_ENC='ae s-586.o vpaes-x86.o aesni-x86.o' CMLL_ENC='cmll-x86.o' BF_ENC='bf-586.o' CAST_EN C='cast-586.o' RC4_ENC='rc4-586.o' RC5_ENC='rc5-586.o' SHA1_ASM_OBJ='sha1-586.o sha256-586.o sha512-586.o' MD5_ASM_OBJ='md5-586.o' RMD160_ASM_OBJ='rmd-586.o' WP _ASM_OBJ='wp_block.o wp-mmx.o' MODES_ASM_OBJ='ghash-x86.o' ENGINES_ASM_OBJ='' PE RLASM_SCHEME='coff' FIPSLIBDIR='' FIPSDIR='/usr/local/ssl/fips-2.0' FIPSCANLIB=" ${FIPSCANLIB:-}" THIS=${THIS:-links} MAKEFILE=Makefile MAKEOVERRIDES= TOP=.. DIR =$dir $target ) || exit 1; fi; done'
Makefile:438: recipe for target 'links' failed
make: *** [links] Error 1
我正在使用win64
工作站,并且尝试了INSTALL.WIN64
I'm using win64
work station,and I tried the guide in INSTALL.WIN64
You will need Microsoft Platform SDK, available for download at
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/. As per
April 2005 Platform SDK is equipped with Win64 compilers, as well
as assemblers, but it might change in the future.
但是我没有Microsoft Platform SDK,并且由于链接已被重定向,因此我不知道应该下载哪个文件.所以我尝试了INSTALL.WIN32
中的指南,然后就卡在了这里.
However I don't have Microsoft Platform SDK,and I don't know which file should I download since the link is now redirected .So I tried the guide in INSTALL.WIN32
then I am stuck here.
更新:
在将mingw移至no (
路径后,它在另一个地方失败了.
UPDATE:
After I move the mingw to a no (
path it fail in another place.
DES_INT used
RC4_CHUNK is unsigned long long
e_os2.h => include/openssl/e_os2.h
making links in crypto...
make[1]: Entering directory 'D:/Downloads/openssl-1.0.2k/crypto'
make[1]: *** No rule to make target 'links'. Stop.
make[1]: Leaving directory 'D:/Downloads/openssl-1.0.2k/crypto'
Makefile:438: recipe for target 'links' failed
make: *** [links] Error 1
另一部分与上块最相似.
the other part is most similar with upper block.
更新:使用Microsoft VisualStudio构建工具后
UPDATE :after use Microsoft VisualStudio build tool
使用Windows原生ms生成工具后,见面
After I use the windows native ms build tool.when I met
nmake -f ms\ntdll.mak
'nmake' is not recognized as an internal or external command
我在此处找到解决方案.再次我运行相同的命令.由于另一个错误,它失败了.
I find the solution here.Again I run the same command.It fails on another error.
nmake -f ms\ntdll.mak
ms\uplink.c(11) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory NMAKE : fatal error U1077: 'cl' : return code '0x2'
在我的情况下,这个 answer 几乎可以解决此问题.但是,我使用的是.net框架的其他版本,然后我借助此发布.现在我被困在这里.
In my situation this answer almost fix it.However I'm using a different version of the .net framework,then I found the detail version number with help of this post.And now I stuck here.
d:\Downloads\openssl-1.0.2k>nmake -f ms\ntdll.mak
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
Building OpenSSL
cl /Fotmp32dll\md4_dgst.obj -Iinc32 -Itmp32dll /MD /Ox -DOPENSSL_THREADS -DDSO_WIN32 -W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DOPENSSL_USE_APPLINK -I. -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_SSL2 -DOPENSSL_NO_KRB5 -DOPENSSL_NO_JPAKE -DOPENSSL_NO_WEAK_SSL_CIPHERS -DOPENSSL_NO_STATIC_ENGINE /Zi /Fdtmp32dll/lib -D_WINDLL -DOPENSSL_BUILD_SHLIBCRYPTO -c .\crypto\md4\md4_dgst.c
md4_dgst.c
.\crypto\md4\md4_dgst.c(59): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.EXE"' : return code '0x2'
Stop.
我在Makefile中的一个变量中找到了连接的感觉,但不确定是否是更改的正确位置.
I find in a variable in the Makefile which makes me feel wired.But not sure it's the right place to change.
OPENSSLDIR =/usr/local/ssl
OPENSSLDIR=/usr/local/ssl
推荐答案
要在win64上构建openssl,使用其本机此答案.如果vcvar32.bat
不起作用,请参考此处.在我完成所有这些工作之后, openssl-1.0.2k
最后在Win64/x64
上.
To build openssl on win64 it's easier to use their native Visual C++ 2015 Build Tools.Use VS native tools command
is recommended,found detail in this answer.If the vcvar32.bat
doesn't work,refer this answer to modify it.The .Net version reference is here.After all these I built openssl-1.0.2k
on Win64/x64
finally.
这篇关于在win64上构建openssl失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!