本文介绍了“您选择的CPU不支持x86-64指令集”错误Cygwin-x64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我试图通过以下说明在cygwin中安装openssl:我下载了来自此网站的最新tarball http://www.openssl.org/source/ ,并将其放在C:\cygwin64 \home中,然后从cygwin中运行这些命令 tar zxvf openssl-1.0.1e.tar.gz cd openssl-1.0.1e ./ config make 进行测试 make install (说明从这里: http://www.slideshare。 net / ganaaturuu / cygwinandopen-sslinstallguide ) 直到第三步./config it work fine我相信,至少没有报告错误,它给出的消息配置为Cygwin。到底。当我运行make虽然它给我这个输出: c / 。 * - * - cygwin_pre1.3)OUT =Cygwin-pre1.3;; * - * - cygwin)OUT =Cygwin;; I'm trying to install openssl in cygwin by following these instructions:I dowloaded the latest tarball from this site http://www.openssl.org/source/, and put it in C:\cygwin64\home, then I run these commands from cygwintar zxvf openssl-1.0.1e.tar.gzcd openssl-1.0.1e./configmakemake testmake install(Instructions from here :http://www.slideshare.net/ganaaturuu/cygwinandopen-sslinstallguide)Up to the 3rd step ./config it works fine I believe, at least there are no errors reported, and it gives the message "Configured for Cygwin." in the end. When I run make though it gives me this output:making all in crypto...make[1]: Entering directory '/home/openssl-1.0.1e/crypto'( echo "#ifndef MK1MF_BUILD"; \echo ' /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \echo ' #define CFLAGS "gcc -DOPENSSL_THREADS -DDSO_DLFCN -DHAVE_DLFCN_H -DTERM IOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -DOPENSSL_BN_ASM_PART_ WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLP OOL_ASM -DGHASH_ASM"'; \echo ' #define PLATFORM "Cygwin"'; \echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \echo '#endif' ) >buildinf.hgcc -I. -I.. -I../include -DOPENSSL_THREADS -DDSO_DLFCN -DHAVE_DLFCN_H -DTERMI OS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -DOPENSSL_BN_ASM_PART_W ORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPO OL_ASM -DGHASH_ASM -c -o cryptlib.o cryptlib.ccryptlib.c:1:0: error: CPU you selected does not support x86-64 instruction set /* crypto/cryptlib.c */ ^cryptlib.c:1:0: error: CPU you selected does not support x86-64 instruction set<builtin>: recipe for target 'cryptlib.o' failedmake[1]: *** [cryptlib.o] Error 1make[1]: Leaving directory '/home/openssl-1.0.1e/crypto'Makefile:278: recipe for target 'build_crypto' failedmake: *** [build_crypto] Error 1I searched about the "CPU you selected does not support x86-64 instruction set" and I think it has to do with CFLAGS and -march=i486 option, but I'm not at all sure as into what it should be changed.In this How to compile a C++ program as 64-bit on 64-bit machine? question there are some solutions suggested, but in my case there are nowhere in the makefile options like -m32 and -march=i686 to remove.If you could please show me the right direction to search this, if not the solution, I would be grateful.I'm working on Windows 7 64-bit, with cygwin and gcc version 4.8.2. 解决方案 Here's a "mee too" answer because things have changed a bit. Cygwin-x64 support was cut-in in May 2015 under Issue 3110: Adding support for x86_64 Cygwin.However, config still selects the i686 version of the library to build. Also see Issue #4326: Failed to configure for Cygwin-x64 in the OpenSSL bug tracker.To build OpenSSL 1.0.2 on Cygwin-x64, you have to use Configure and select the triplet. Below is the soup-to-nuts recipe.$ curl https://www.openssl.org/source/openssl-1.0.2f.tar.gz -o openssl-1.0.2f.tar.gz...$ tar -xzf openssl-1.0.2f.tar.gz...$ cd openssl-1.0.2fThen:$ ./Configure Cygwin-x86_64 shared no-ssl2 no-ssl3 --openssldir="$HOME/ssl"...$ make depend...$ make...$ make install_swinstall_sw installs the headers in $OPENSSLDIR/include, and the libraries in $OPENSSLDIR/lib. It does not install the man pages.You then compile and link with:$ gcc -I "$HOME/ssl/include" test.c -o test.exe "$HOME/ssl/lib/libcrypto.a" "$HOME/ssl/lib/libssl.a"Linking against libcrypto.a and libssl.a means you avoid library path problems. Things will "just work" for you.Also, if you need this for OpenSSL 1.0.1, then you can copy/paste the triplet's settings from 1.0.2's Configure (from line 613):$ grep "Cygwin-x86_64" Configure"Cygwin-x86_64", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall:::CYGWIN::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:mingw64:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",If you want config to "just work" for 1.0.1, then add the following. Be sure the line for Cygwin-x86_64 was added to Configure.x86_64-*-cygwin) OUT="Cygwin-x86_64" ;; <== Add this in front of the ones below*-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;*-*-cygwin) OUT="Cygwin" ;; 这篇关于“您选择的CPU不支持x86-64指令集”错误Cygwin-x64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-29 14:56