error in cross-compile for wt
Added by Sophia Zhou over 14 years ago
I'm cross-compiling wt for mipsel embedded system, and I have the following error while compiling:
[ 4%] Building CXX object src/CMakeFiles/wt.dir/Wt/WAbstractArea.o
cd /opt/RouterDemo/wt-3.1.6/build_netgear/src && /opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-g -Dwt_EXPORTS -DWT_WITH_OLD_INTERNALPATH_API -DWT_THREADED -D_REENTRANT -DBOOST_SPIRIT_THREADSAFE -O2 -g -fPIC -I/opt/RouterDemo/wt-3.1.6/build_netgear -I/opt/RouterDemo/wt-3.1.6/src/web -I/opt/RouterDemo/wt-3.1.6/src -I/opt/RouterDemo/wt-3.1.6/build_netgear/src -I/opt/RouterDemo/wt-3.1.6/src/Wt/Dbo/backend/amalgamation -I/opt/boost/Netgear/include -o CMakeFiles/wt.dir/Wt/WAbstractArea.o -c /opt/RouterDemo/wt-3.1.6/src/Wt/WAbstractArea.C
/tmp/ccNCng68.s: Assembler messages:
/tmp/ccNCng68.s:5451: Error: opcode not supported on this processor: mips1 (mips1) `ll $2,4($3)'
/tmp/ccNCng68.s:5453: Error: opcode not supported on this processor: mips1 (mips1) `sc $2,4($3)'
/tmp/ccNCng68.s:5517: Error: opcode not supported on this processor: mips1 (mips1) `ll $3,4($16)'
...
I also attached my toolchain file, where the boost libraries are in /opt/boost/Netgear.
Is there any suggestion on how to solve the problem?
Thank you
Toolchain-mips.cmake (599 Bytes) Toolchain-mips.cmake |
Replies (3)
RE: error in cross-compile for wt - Added by Wim Dumon over 14 years ago
Those are the atomic load and store instructions, which are apparently not recognized by your MIPS target (or your compiler/linker is configured in the wrong way). You need to assure that they're not in some inline assembler block, else you need to check your compiler's configuration (especially startup parameters).
Execute the command above manually, but replace -c by -S (generate assembler output), modify the output file from WAbstractArea.o to WAbstractArea.S, and remove the -O2.
Then compile this .S file, by changing -S back to -c, change WAbstractArea.C to WAbstractArea.S, and the output file (WAbstractArea.S in the previous cmd) to WAbstractArea.o. This command will fail and report line numbers.
Then look in this WAbstractArea.S on the reported line numbers. From the debug information in the .S file, you'll be able to tell where they came from.
Post when you found out where they came from.
are you sure you don't need a -arch=... in your compiler command?
BR,
Wim.
RE: error in cross-compile for wt - Added by Jan Hrubeš over 13 years ago
ll and sc instructions are supported since MIPS II. Gcc uses MIPS I instruction set as a default. You have to use compiler parameter -march=mips32 ( http://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html ). Or you can patch boost not to use these instructions ( https://svn.boost.org/trac/boost/ticket/5327 ).
RE: error in cross-compile for wt - Added by Jan Hrubeš over 13 years ago
and one more link with more info http://gcc.gnu.org/install/specific.html#mips-x-x