Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/154.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 卡萨布兰卡:linux centos上的gcc 4.8.1程序集错误_C++_Linux_Gcc_Casablanca - Fatal编程技术网

C++ 卡萨布兰卡:linux centos上的gcc 4.8.1程序集错误

C++ 卡萨布兰卡:linux centos上的gcc 4.8.1程序集错误,c++,linux,gcc,casablanca,C++,Linux,Gcc,Casablanca,我正在努力建设,就像他们在书上说的那样。因为我使用CXX=gcc-4.8安装的gcc-4.8.1不正常,所以我仅通过以下操作将其删除: cmake .. -DCMAKE_BUILD_TYPE=Release 它会创建文件,当我执行make操作时,会出现以下错误: Scanning dependencies of target casablanca [ 1%] Building CXX object src/CMakeFiles/casablanca.dir/streams/linux/fil

我正在努力建设,就像他们在书上说的那样。因为我使用
CXX=gcc-4.8
安装的
gcc-4.8.1
不正常,所以我仅通过以下操作将其删除:

cmake .. -DCMAKE_BUILD_TYPE=Release
它会创建文件,当我执行
make
操作时,会出现以下错误:

Scanning dependencies of target casablanca
[  1%] Building CXX object src/CMakeFiles/casablanca.dir/streams/linux/fileio_linux.cpp.o
/tmp/ccoWLl81.s: Assembler messages:
/tmp/ccoWLl81.s:97: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:188: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:298: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:310: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:322: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:334: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:371: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:494: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:508: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:522: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:536: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:550: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:2028: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:2057: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:2086: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:3975: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:6186: Error: expecting string instruction after `rep'
/tmp/ccoWLl81.s:10355: Error: expecting string instruction after `rep'
make[2]: *** [src/CMakeFiles/casablanca.dir/streams/linux/fileio_linux.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/casablanca.dir/all] Error 2
make: *** [all] Error 2

有人遇到过这个问题吗?是因为gcc4.8.1吗?如何修复它?

问题是GCC4.8正在生成“rep;ret”指令,以避免AMD芯片的性能损失。较旧的汇编程序将此检测为错误

详情如下:

修复方法是更新binutils,以便获得接受此指令的较新版本的汇编程序

sudo yum update binutils
--->将更新包binutils.x86_64 0:2.22.52.0.1-10.36.amzn1


--->包binutils.x86_64 0:2.23.52.0.1-30.64.amzn1将是一个更新

此答案修复了最近亚马逊EC2 CentOS box(3.4.37-40.44.amzn1.x86_64)上的相同错误。运行了
yum-update-binutils
,它将问题带到了2.23.52.0.1,我的问题就消失了。不幸的是,我不知道以前是哪个版本。对于CentOS6,我必须执行
sudo-yum安装devtoolset-2-binutils-devel