inline assembly statements in C source files using arm security extensions seems to trigger an error

Sean Ansari zohal52@yahoo.com
Tue Jul 28 10:41:00 GMT 2015


I am running into an issue with support for security extensions on ARM. Can anyone suggest a fix? 
I have the following code:

#include <stdio.h>

/*__smc(0) void yeild(void);*/
__asm__(" smc #0");

int main(void)
{
  unsigned int i;

  for (i = 0; i < 10; i++)
  {
    printf("hello from Normal world\n");
    yeild();
  } 

  return 0;
}

And I get the following error:
/tmp/cc2ntayz.s: Assembler messages:
/tmp/cc2ntayz.s:17: Error: selected processor does not support ARM mode `smc #0'
make: *** [/home/sansari/android/gas/obj/local/armeabi/objs/hello_tz/main_normal.o] Error 1

I found this link 
https://lists.linaro.org/pipermail/linaro-toolchain/2012-December/002997.html
and this one:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58869
And tried what they suggested by adding the relevant switches to my Android.mk file with a 
LOCAL_CFLAGS  options. But I still get the same error. 





More information about the Gcc-help mailing list