Skip to content

First c program on arm using cygwin and code sourcery

rngadam edited this page Apr 19, 2011 · 2 revisions

First C program on ARM using Cygwin and Code Sourcery

$ adb shell
# mkdir /data/tmp
# chmod 777 /data/tmp
$ vi hello.c
$ cat hello.c
#include <stdio.h>

int main(void) {
		printf("hello world\n");
}
$ arm-none-linux-gnueabi-c++ hello.c -o hello -static
$ file hello
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, not stripped
$ adb push hello /data/tmp
1644 KB/s (648367 bytes in 0.385s)
$ adb shell
# chmod 744 /data/tmp/hello
# /data/tmp/hello
hello world

Clone this wiki locally