打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Invalid Operand for Code W ? Nerdland

Invalid Operand for Code W

Part of a series of articles on Unstumping the Internet.


Published 14 August 2009, last modified 15 August 2009.

Question

What does it mean when I encounter the compiler error “invalid operand for code w”?

Answer

Chances are, if you got this error then you were cross-compiling, probably from an x86 or x86_64 host to an ARM target. The error most likely occurred when you used, directly or indirectly, a network byte order translation function from the C library like htons(), or ntohl().

This error occurs because the program that you are trying to compile is including headers from the host system, rather than from the cross-compiled target environment. You should check the configure script and makefiles for the program to make sure that they do not contain hard-coded references to /usr/include or any other include paths, and also that they do not rely on the --prefix option to the configure script for setting include paths. Often, the --prefix argument is given not as an absolute path but relative to root, which will eventually be the target root during installation, but during compilation it will continue to refer to the host root.

The reason you get such a strange error is because the network byte order translation functions in GCC are aliases for the __bswap_* functions in bits/byteswap.h. These are implemented as preprocessor macros that contain inline assembly. Unless you also happen to be compiling on an ARM system, this is not going to be ARM assembly. The compiler is trying to parse the rorw (“rotate word right”) x86 instruction as the ror (“rotate right”) ARM instruction, and is becoming very confused when it encounters the unexpected w.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
CMake交叉编译配置
树莓派交叉编译环境搭建介绍(英文Blog转载)
最新 Hi3861开发环境搭建
ubuntu14.04.2 ODROID-U3交叉编译环境配置问题
CMake设置arm
arm-linux-gcc-4.3.2的安装
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服