Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Casablanca: Assembly error gcc 4.8.1 on linux centos

I am trying to build casablanca, like they say on their page. Because I have gcc-4.8.1 installed using CXX=gcc-4.8 is not ok, so I have removed it doing just:

cmake .. -DCMAKE_BUILD_TYPE=Release

It creates the files and when I do make I am getting these errors:

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

Have anyone met this problem? Is it because of gcc4.8.1? How to fix it?

like image 691
thedarkside ofthemoon Avatar asked May 09 '14 09:05

thedarkside ofthemoon


2 Answers

The problem is that gcc 4.8 is generating "rep; ret" instructions to avoid a performance penalty for AMD chips. Older assemblers detect this as an error.

Details are here:

https://gcc.gnu.org/ml/gcc-help/2011-03/msg00286.html

The fix is to update your binutils so that you get a newer version of an assembler which accepts this instruction.

like image 125
jtlim Avatar answered Nov 11 '22 12:11

jtlim


sudo yum update binutils

---> Package binutils.x86_64 0:2.22.52.0.1-10.36.amzn1 will be updated

---> Package binutils.x86_64 0:2.23.52.0.1-30.64.amzn1 will be an update

like image 26
BuffK Avatar answered Nov 11 '22 13:11

BuffK