解决编译“ Error: selected processor does not support ARM mode `smc #0”问题

原创 2012年05月16日 11:07:16

在用arm2011.09编译器编译pandaboard的x-loader时遇到如下编译问题:

 Error: selected processor does not support ARM mode `smc #0

google了一下,貌似这样的问题还是挺多的,有几种方法,一一实验。

1.

replacing in arch/arm/mach-omap2/Makefile:

AFLAGS_sleep24xx.o                      :=-Wa,-march=armv6
AFLAGS_sleep34xx.o                      :=-Wa,-march=armv7-a

to:

AFLAGS_sleep24xx.o                      :=-Wa,-march=armv6
AFLAGS_sleep34xx.o                      :=-Wa,-march=armv7-a$(plus_sec)

helps compiling (see also: https://patchwork.kernel.org/patch/369681/)

在config.mk中修改后,实验无效,

$(plus_sec)
为空,无效。

2. uboot的faq,http://www.denx.de/wiki/ELDK-5/FrequentlyAskedQuestionsAndAnswers,标题Cannot compile Linux kernel version 2.6.32 for armv7a

Question:
I want to compile a vendor-provided old Linux kernel tree (kernel version 2.6.32) with ELDK 5.0 for the armv7a configuration. Unfortunately this fails with errors like this one:
 ...
  CC      arch/arm/kernel/sysfs_v7.o
/tmp/ccwkv7On.s: Assembler messages:
/tmp/ccwkv7On.s:249: Error: selected processor does not support ARM mode `smc #0'
/tmp/ccwkv7On.s:289: Error: selected processor does not support ARM mode `smc #0'
make[1]: *** [arch/arm/kernel/sysfs_v7.o] Error 1

Answer:
Your kernel tree is too old for the ELDK 5.0 tool chain.You can work around this problem by applying the following patch to your kernel tree:
--- arch/arm/kernel/sysfs_v7.c.ORIG   2011-01-27 11:47:54.000000000 +0100
+++ arch/arm/kernel/sysfs_v7.c   2011-05-10 08:51:58.953252638 +0200
@@ -76,7 +76,8 @@
    asm ("mrc p15, 0, %0, c1, c0, 1" : "=r"(val));
    SETBITS(val, 0xff8, new);
    val &= ~2;
-   asm ("mov r0,  %0   \n\t"
+   asm (".arch_extension sec\n\t"
+        "mov r0,  %0   \n\t"
         "mov r12, #3   \n\t"
         "smc #0      \n\t"
         :: "r"(val) : "r0", "r12");
@@ -107,7 +108,8 @@
 
    asm ("mrc p15, 1, %0, c9, c0, 2" : "=r"(val));
    SETBITS(val, 0xbc00000, new);
-   asm ("mov r0,  %0   \n\t"
+   asm (".arch_extension sec\n\t"
+        "mov r0,  %0   \n\t"
         "mov r12, #2   \n\t"
         "smc #0      \n\t"
         :: "r"(val) : "r0", "r12");

在代码中添加
.arch_extension sec
后,编译通过。

总结:应该是代码写法与编译器有冲突,需要在代码中声明扩展指令段

解决编译“ Error: selected processor does not support ARM mode 'smc 0'”问题

解决编译“ Error: selected processor does not support ARM mode 'smc 0'”问题

Android编译问题记录

Android系统编译问题    获取Android源码流程: 从 https://code.google.com/p/git-repo/downloads/list  下载repo脚...
  • sdvch
  • sdvch
  • 2015年03月11日 15:25
  • 919

TrustZone 基本信息介绍大全

以前关注过trustzone一段时间,也做了一些尝试,分享一下我知道的trustzone吧,有什么不对的地方欢迎拍砖: ARM官方关于TrustZone的文档 http://infocent...
  • shc5840
  • shc5840
  • 2015年10月29日 14:51
  • 1206

解决编译“ Error: selected processor does not support ARM mode `smc #0”问题

在用arm2011.09编译器编译pandaboard的x-loader时遇到如下编译问题: [cpp] view plaincopy Error:...

gperftools 移植到arm

1.https://gperftools.googlecode.com/files/gperftools-2.0.tar.gz 2.tar zxvf 进行解压 3.cd gperftools-...

解决NDK交叉编译 selected processor does not support ARM mode libtheora的错误

下载最新的libtheora, wget http://downloads.xiph.org/releases/theora/libtheora-1.2.0alpha1.tar.gz 解压缩,然后使...
  • zangcf
  • zangcf
  • 2014年03月26日 17:54
  • 3130

解决“service nginx does not support chkconfig”的问题?

因为这2天要安装nginx服务器,其nginx没有提供启动脚本,就想自己写一个启动脚本,但是再写完脚本的时候,想使用service启动该服务, nginx启动脚本如下: #!/bin/ba...

error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ...

Device eth0 does not seem to be present delaying initialization 问题解决办法

在使用vmware迁移linux系统过程中,发现部署后的linux系统无法启动网卡 报错为 Bringing up interface eth0: Device eth0 does not see...

xenserver上模板生成rhel6虚拟机后的“Device eth0 does not seem to be present, delaying initialization” 问题解决

xenserver上从模板生成一个Red Hat Enterprise Linx6启动时发现找不到网卡,如果你在命令窗口启动网络服务就会遇到”Device eth0 does not seem to ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:解决编译“ Error: selected processor does not support ARM mode `smc #0”问题
举报原因:
原因补充:

(最多只允许输入30个字)