Hi, I am trying to use the latest CodeSourcery G++ Lite ARM cross dev toolchain to build native code for Android. I looked at some messages in the archive from November about doing this but the CodeSourcery toolchain seems to have changed since then. I have a simple "Hello World" in c and try to build it statically for Android with:
$ cat build.sh #!/bin/sh arm-none-eabi-gcc \ hello.c \ -static -o hello \ -Xlinker --script -Xlinker ~/CodeSourcery/Sourcery_G++_Lite/arm-none-eabi/lib/generic.ld which gives me warnings like this: $ build.sh /home/shawn/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-eabi/4.2.3/../../../../arm-none-eabi/lib/libcs3unhosted.a(unhosted-_close.o): warning: IO function '_close' used [...few more similar warnings...] This produces an executable: $ file hello hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped When I push it to the emulator and run it, it seems to hang without printing anything. strace shows that it is trying to use an unknown system call: # strace ./hello execve("./hello", ["./hello"], [/* 10 vars */]) = 0 syscall: unknown syscall trap 0x00002a9c So, I have a couple of questions. 1. What linker script should I use for Android if not generic.ld? 2. What's the difference between hosted and unhosted? 3. Any suggestions on what I need to do to make this work? Thanks! Shawn --==--==-- Shawn McMurdo See my Low Vision Guide at http://lowvisionguide.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---