问题描述
我用自制安装GCC 4.7.0和我的项目提出的是在组装时失败。我可以成功地采取code从.C - > .S,但.S - >的.o失败
要查看用于安装GCC酿造配方,请查看:https://github.com/Homebrew/homebrew-dupes/blob/master/gcc.rb 。我也是从上游使用https://github.com/mxcl/homebrew/blob/master/Library/Formula/binutils.rb 。安装Binutils不能出现引入一个新的'为'位于/ usr / local / lib目录或相似的。
我怎么能追查该失踪指令错误?它出现的编译器是正确的,但连接器根本不支持这些指令。该指令也似乎是向量指令。
xavierlange $>使suricata.o
/usr/local/bin/gcc-4.7 -DHAVE_CONFIG_H -I。 -I .. -I ../ libhtp -I /选择/本地/包括-v -Wextra -Wall -fno严格走样-fno-树形pre -Wno-未使用的参数-std = gnu99 - DOS_DARWIN -march =本地-DLIBPCAP_VERSION_MAJOR = 1 -DHAVE_PCAP_SET_BUFF -DUNITTESTS -DREVISION =61d5fe3-MT suricata.o -MD -MP -MF .deps / suricata.Tpo -c -o suricata.o suricata.c
使用内置的规格。
COLLECT_GCC =的/ usr / local / bin目录/ GCC-4.7
目标:x86_64的 - 苹果darwin11.3.0
- preFIX =的/ usr /本地/库/ GCC / 4.7.0 / gcc的--datarootdir ../configure --enable-语言= C,C ++,FORTRAN,JAVA,objc,OBJ-C ++:与配置=的/ usr /本地/库/ GCC / 4.7.0 /股--bindir =的/ usr /本地/库/ GCC / 4.7.0 / bin中--program后缀= -4.7 --with-GMP =的/ usr /本地/库/ GMP / 5.0.4 --with-MPFR =的/ usr /本地/库/ MPFR / 3.1.0 --with-MPC =的/ usr /本地/库/ libmpc / 0.9 --with-系统的zlib --enable-阶段1检查--enable-插件--enable-LTO --disable-multilib的--disable-NLS
线程模型:POSIX
gcc版本4.7.0(GCC)
COLLECT_GCC_OPTIONS = - '''mmacosx版本分钟= 10.7.3''-D'HAVE_CONFIG_H'-I' -I''..''-I'../libhtp'-I''/选择/本地/包括''-v'-Wextra'-Wall'-fno严格走样 -fno-树形pre'-Wno-未使用的参数'-std = gnu99''-D'OS_DARWIN'-march =原生''-D'LIBPCAP_VERSION_MAJOR = 1''-D ''HAVE_PCAP_SET_BUFF'-D'单元测试'-D''版本= 61d5fe3''-MT'suricata.o'-MD'-MP'-MF'.deps / suricata.Tpo'' -c'-o'suricata.o
/usr/local/Cellar/gcc/4.7.0/gcc/libexec/gcc/x86_64-apple-darwin11.3.0/4.7.0/cc1 -quiet -v -I。 -I .. -I ../libhtp -I /选择/本地/包括-MD suricata.d -MF .deps / suricata.Tpo -MP -MT suricata.o -D__DYNAMIC__ -D HAVE_CONFIG_H -D OS_DARWIN -D LIBPCAP_VERSION_MAJOR = 1 -D HAVE_PCAP_SET_BUFF -D单元测试-D版本= 61d5fe3 suricata.c -march = corei7-AVX -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno反弹道导弹-mno-LWP -mno-FMA -mno- FMA4 -mno-XOP -mno-BMI -mno-bmi2 -mno-TBM -mavx -mno-AVX2 -msse4.2 -msse4.1 -mno-lzcnt --param L1缓存大小= 32 --param -11-高速缓存行大小= 64 --param二级缓存大小= 6144 = -mtune corei7-AVX -fPIC -quiet -dumpbase suricata.c -mmacosx版本分钟= 10.7.3 -auxbase带钢suricata.o - Wextra -Wall -Wno-未使用的参数-std = gnu99 -version -fno严格走样-fno-树形pre -o /var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s
GNU C(GCC)版本4.7.0(x86_64的-苹果darwin11.3.0)
由GNU C版本4.7.0,版本GMP 5.0.4,MPFR版本3.1.0-P8,MPC 0.9版编译
GGC启发:--param GGC-分钟展开= 100 --param GGC-最小堆大小= 131072
忽略不存在的目录\"/usr/local/Cellar/gcc/4.7.0/gcc/lib/gcc/x86_64-apple-darwin11.3.0/4.7.0/../../../../x86_64-apple-darwin11.3.0/include\"
忽略不存在的目录/选择/本地/包括
的#include...的搜索从这里开始:
#包括LT&; ...>搜索从这里开始:
。
..
../libhtp
/usr/local/Cellar/gcc/4.7.0/gcc/lib/gcc/x86_64-apple-darwin11.3.0/4.7.0/include
在/ usr /本地/包括
/usr/local/Cellar/gcc/4.7.0/gcc/include
/usr/local/Cellar/gcc/4.7.0/gcc/lib/gcc/x86_64-apple-darwin11.3.0/4.7.0/include-fixed
/ usr / include目录
/系统/库/框架
/库/框架
搜索列表结束。
GNU C(GCC)版本4.7.0(x86_64的-苹果darwin11.3.0)
由GNU C版本4.7.0,版本GMP 5.0.4,MPFR版本3.1.0-P8,MPC 0.9版编译
GGC启发:--param GGC-分钟展开= 100 --param GGC-最小堆大小= 131072
编译器可执行文件的校验:1dbaf0f0ba4d4d18b5d0d00c3c7d024d
COLLECT_GCC_OPTIONS = - '''mmacosx版本分钟= 10.7.3''-D'HAVE_CONFIG_H'-I' -I''..''-I'../libhtp'-I''/选择/本地/包括''-v'-Wextra'-Wall'-fno严格走样 -fno-树形pre'-Wno-未使用的参数'-std = gnu99''-D'OS_DARWIN'-march =原生''-D'LIBPCAP_VERSION_MAJOR = 1''-D ''HAVE_PCAP_SET_BUFF'-D'单元测试'-D''版本= 61d5fe3''-MT'suricata.o'-MD'-MP'-MF'.deps / suricata.Tpo'' -c'-o'suricata.o
作为-arch x86_64的-force_cpusubtype_ALL -o suricata.o /var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7791:no这样的指令:`vcvtsi2ssq%RAX,%XMM0,%XMM0
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7792:no这样的指令:`vmovd%XMM0,%eax中'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7799:no这样的指令:`vcvtsi2ssq%的RDX,%XMM0,%XMM0
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7800:no这样的指令:`vaddss%XMM0,%XMM0,%XMM0
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7801:no这样的指令:`vmovd%XMM0,%eax中'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7804:no这样的指令:`vmovd%EAX,xmm1中的%
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7805:no这样的指令:`vmovd%edx中,%XMM2
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7806:no这样的指令:`vdivss%XMM2,%将xmm1,%XMM0
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7807:no这样的指令:`vunpcklps%XMM0,%XMM0,%XMM0
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7808:no这样的指令:`vcvtps2pd%XMM0,%XMM0
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7809:no这样的指令:`vmovd%XMM0,RAX%
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7819:no这样的指令:`vmovd%RAX,%XMM0
使:*** [suricata.o]错误1
下面是当我用GCC-4.7通过MacPorts的(它使用cctools)安装会发生什么。我试图改变优化,以看看是否能够有所帮助。
xavierlange $> /opt/local/bin/gcc-mp-4.7 -DHAVE_CONFIG_H -I。 -I .. -I ../ libhtp -I在/ usr /本地/包括-I /选择/本地/包括-g -O0 -Wextra -Wall -fno严格走样-fno-树形pre - WNO未使用的参数-std = gnu99 -DOS_DARWIN -march =本地-DLIBPCAP_VERSION_MAJOR = 1 -DHAVE_PCAP_SET_BUFF -DUNITTESTS -DREVISION =61d5fe3-MT suricata.o -MD -MP -MF .deps / suricata.Tpo -S suricata。 ç-o suricata.s
xavierlange $>的/ opt / local / bin目录/为suricata.s suricata.s:9811:没有这样的指令:`vcvtsi2ssq%RAX,%XMM0,%XMM0
suricata.s:9812:没有这样的指令:`vmovd%XMM0,%eax中'
suricata.s:9819:没有这样的指令:`vcvtsi2ssq%的RDX,%XMM0,%XMM0
suricata.s:9820:没有这样的指令:`vaddss%XMM0,%XMM0,%XMM0
suricata.s:9821:没有这样的指令:`vmovd%XMM0,%eax中'
suricata.s:9824:没有这样的指令:`vmovd%EAX,xmm1中的%
suricata.s:9825:没有这样的指令:`vmovd%edx中,%XMM2
suricata.s:9826:没有这样的指令:`vdivss%XMM2,%将xmm1,%XMM0
suricata.s:9827:没有这样的指令:`vunpcklps%XMM0,%XMM0,%XMM0
suricata.s:9828:没有这样的指令:`vcvtps2pd%XMM0,%XMM0
suricata.s:9829:没有这样的指令:`vmovd%XMM0,RAX%
suricata.s:9839:没有这样的指令:`vmovd%RAX,%XMM0
短期解决办法是去除'-march =本地选项(至少它为我工作)。
I used homebrew to install GCC 4.7.0 and my project's make is failing at assembly-time. I can successfully take code from .c -> .s, but .s -> .o fails.
To view the brew formula used to install GCC, please look at: https://github.com/Homebrew/homebrew-dupes/blob/master/gcc.rb . I also installed binutils from upstream using https://github.com/mxcl/homebrew/blob/master/Library/Formula/binutils.rb . Install binutils does not appear to introduce a new 'as' in the /usr/local/lib or similar.
How can I track down this missing instruction error? It appears the compiler is correct but the linker simply does not support these instructions. The instructions do appear to be vector instructions.
xavierlange $> make suricata.o
/usr/local/bin/gcc-4.7 -DHAVE_CONFIG_H -I. -I.. -I../libhtp -I/opt/local/include -v -Wextra -Wall -fno-strict-aliasing -fno-tree-pre -Wno-unused-parameter -std=gnu99 -DOS_DARWIN -march=native -DLIBPCAP_VERSION_MAJOR=1 -DHAVE_PCAP_SET_BUFF -DUNITTESTS -DREVISION="61d5fe3" -MT suricata.o -MD -MP -MF .deps/suricata.Tpo -c -o suricata.o suricata.c
Using built-in specs.
COLLECT_GCC=/usr/local/bin/gcc-4.7
Target: x86_64-apple-darwin11.3.0
Configured with: ../configure --enable-languages=c,c++,fortran,java,objc,obj-c++ --prefix=/usr/local/Cellar/gcc/4.7.0/gcc --datarootdir=/usr/local/Cellar/gcc/4.7.0/share --bindir=/usr/local/Cellar/gcc/4.7.0/bin --program-suffix=-4.7 --with-gmp=/usr/local/Cellar/gmp/5.0.4 --with-mpfr=/usr/local/Cellar/mpfr/3.1.0 --with-mpc=/usr/local/Cellar/libmpc/0.9 --with-system-zlib --enable-stage1-checking --enable-plugin --enable-lto --disable-multilib --disable-nls
Thread model: posix
gcc version 4.7.0 (GCC)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.3' '-D' 'HAVE_CONFIG_H' '-I' '.' '-I' '..' '-I' '../libhtp' '-I' '/opt/local/include' '-v' '-Wextra' '-Wall' '-fno-strict-aliasing' '-fno-tree-pre' '-Wno-unused-parameter' '-std=gnu99' '-D' 'OS_DARWIN' '-march=native' '-D' 'LIBPCAP_VERSION_MAJOR=1' '-D' 'HAVE_PCAP_SET_BUFF' '-D' 'UNITTESTS' '-D' 'REVISION=61d5fe3' '-MT' 'suricata.o' '-MD' '-MP' '-MF' '.deps/suricata.Tpo' '-c' '-o' 'suricata.o'
/usr/local/Cellar/gcc/4.7.0/gcc/libexec/gcc/x86_64-apple-darwin11.3.0/4.7.0/cc1 -quiet -v -I . -I .. -I ../libhtp -I /opt/local/include -MD suricata.d -MF .deps/suricata.Tpo -MP -MT suricata.o -D__DYNAMIC__ -D HAVE_CONFIG_H -D OS_DARWIN -D LIBPCAP_VERSION_MAJOR=1 -D HAVE_PCAP_SET_BUFF -D UNITTESTS -D REVISION=61d5fe3 suricata.c -march=corei7-avx -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=corei7-avx -fPIC -quiet -dumpbase suricata.c -mmacosx-version-min=10.7.3 -auxbase-strip suricata.o -Wextra -Wall -Wno-unused-parameter -std=gnu99 -version -fno-strict-aliasing -fno-tree-pre -o /var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s
GNU C (GCC) version 4.7.0 (x86_64-apple-darwin11.3.0)
compiled by GNU C version 4.7.0, GMP version 5.0.4, MPFR version 3.1.0-p8, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/Cellar/gcc/4.7.0/gcc/lib/gcc/x86_64-apple-darwin11.3.0/4.7.0/../../../../x86_64-apple-darwin11.3.0/include"
ignoring nonexistent directory "/opt/local/include"
#include "..." search starts here:
#include <...> search starts here:
.
..
../libhtp
/usr/local/Cellar/gcc/4.7.0/gcc/lib/gcc/x86_64-apple-darwin11.3.0/4.7.0/include
/usr/local/include
/usr/local/Cellar/gcc/4.7.0/gcc/include
/usr/local/Cellar/gcc/4.7.0/gcc/lib/gcc/x86_64-apple-darwin11.3.0/4.7.0/include-fixed
/usr/include
/System/Library/Frameworks
/Library/Frameworks
End of search list.
GNU C (GCC) version 4.7.0 (x86_64-apple-darwin11.3.0)
compiled by GNU C version 4.7.0, GMP version 5.0.4, MPFR version 3.1.0-p8, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 1dbaf0f0ba4d4d18b5d0d00c3c7d024d
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.3' '-D' 'HAVE_CONFIG_H' '-I' '.' '-I' '..' '-I' '../libhtp' '-I' '/opt/local/include' '-v' '-Wextra' '-Wall' '-fno-strict-aliasing' '-fno-tree-pre' '-Wno-unused-parameter' '-std=gnu99' '-D' 'OS_DARWIN' '-march=native' '-D' 'LIBPCAP_VERSION_MAJOR=1' '-D' 'HAVE_PCAP_SET_BUFF' '-D' 'UNITTESTS' '-D' 'REVISION=61d5fe3' '-MT' 'suricata.o' '-MD' '-MP' '-MF' '.deps/suricata.Tpo' '-c' '-o' 'suricata.o'
as -arch x86_64 -force_cpusubtype_ALL -o suricata.o /var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7791:no such instruction: `vcvtsi2ssq %rax, %xmm0,%xmm0'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7792:no such instruction: `vmovd %xmm0, %eax'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7799:no such instruction: `vcvtsi2ssq %rdx, %xmm0,%xmm0'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7800:no such instruction: `vaddss %xmm0, %xmm0,%xmm0'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7801:no such instruction: `vmovd %xmm0, %eax'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7804:no such instruction: `vmovd %eax, %xmm1'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7805:no such instruction: `vmovd %edx, %xmm2'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7806:no such instruction: `vdivss %xmm2, %xmm1,%xmm0'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7807:no such instruction: `vunpcklps %xmm0, %xmm0,%xmm0'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7808:no such instruction: `vcvtps2pd %xmm0, %xmm0'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7809:no such instruction: `vmovd %xmm0, %rax'
/var/folders/58/wg28y0x17p5c3s6y_2t2rj2h0000gn/T//ccKRmuNX.s:7819:no such instruction: `vmovd %rax, %xmm0'
make: *** [suricata.o] Error 1
Here is what happens when I use the GCC-4.7 installed by MacPorts (it uses cctools). I tried changing optimizations to see if that would help as well.
xavierlange $> /opt/local/bin/gcc-mp-4.7 -DHAVE_CONFIG_H -I. -I.. -I../libhtp -I/usr/local/include -I/opt/local/include -g -O0 -Wextra -Wall -fno-strict-aliasing -fno-tree-pre -Wno-unused-parameter -std=gnu99 -DOS_DARWIN -march=native -DLIBPCAP_VERSION_MAJOR=1 -DHAVE_PCAP_SET_BUFF -DUNITTESTS -DREVISION="61d5fe3" -MT suricata.o -MD -MP -MF .deps/suricata.Tpo -S suricata.c -o suricata.s
xavierlange $> /opt/local/bin/as suricata.s suricata.s:9811:no such instruction: `vcvtsi2ssq %rax, %xmm0,%xmm0'
suricata.s:9812:no such instruction: `vmovd %xmm0, %eax'
suricata.s:9819:no such instruction: `vcvtsi2ssq %rdx, %xmm0,%xmm0'
suricata.s:9820:no such instruction: `vaddss %xmm0, %xmm0,%xmm0'
suricata.s:9821:no such instruction: `vmovd %xmm0, %eax'
suricata.s:9824:no such instruction: `vmovd %eax, %xmm1'
suricata.s:9825:no such instruction: `vmovd %edx, %xmm2'
suricata.s:9826:no such instruction: `vdivss %xmm2, %xmm1,%xmm0'
suricata.s:9827:no such instruction: `vunpcklps %xmm0, %xmm0,%xmm0'
suricata.s:9828:no such instruction: `vcvtps2pd %xmm0, %xmm0'
suricata.s:9829:no such instruction: `vmovd %xmm0, %rax'
suricata.s:9839:no such instruction: `vmovd %rax, %xmm0'
The short solution would be removing '-march=native' option (at least it worked for me).
这篇关于错误&QUOT;没有这样的指令&QUOT;而在Mac OS X组装项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!