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

Sean Ansari
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");

  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
and this one:
And tried what they suggested by adding the relevant switches to my file with a 
LOCAL_CFLAGS  options. But I still get the same error. 

More information about the Gcc-help mailing list