Thursday, February 21, 2008

Check on "Allow old ABI binaries ..." got Illegal instruction

With the google android kernel source, after "make goldfish_defconfig", check on "Kernel Features" -> "Allow old ABI binaries to run with this kernel", I got following simple native program failed with "Illegal instruction". The test native program source is in the following:
#include
#include
#include
#include
#include

void _sig_handler(int signo)
{
printf("Got it: %d, %x, \n", signo, &signo);
}

int
main(int argc, char * argv[])
{
struct sigaction sa;

memset(&sa, 0x0, sizeof(sa));
sa.sa_flags = SA_RESTART;
sa.sa_handler = _sig_handler;
if (sigaction(SIGALRM, &sa, NULL) < 0) {
perror("sigaction");
return -1;
}

alarm(1);
sleep(2);
printf("Sleep ... done\n");
return 0;
}
Follow the article Initialize libc for Android to create a dynamic linked android native program, and upload it to emulator. This native program will end with "Illegal instruction".

ABI is abbreviated of Application Binary Interface, but I dont know why it will have such problems when check on Old ABI binaries. So dont use it before you know you have to and how to.

Tips:
1. after create a new kernel file, e.g. zImage, use -kernel zImage to use it in android emulator.

2 comments:

sasha said...

Initially, the Apple Store had the largest number of apps, and iPhone users enjoyed a better selection than those that joined Team Android.

best android apps

best iphone apps

Pop Neo said...

Obtaining a retail evening dresses on sale prom dresses on sale outlet that provides the fantasy bridal dress is a lot easier than ever thanks to these web sites that found on-line lists from the dresses made available available for sale.
We offer wedding dresses, bridesmaid dresses, beach wedding dresses,my friends welcome to visit and see!
wedding dresses