• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Cross Compile from Windows -> ARM

JMC31337

Newbie
For days i tried to build the motorola sourceforge released kernels from scratch on a Win machine (they said it cant be done.. thinkin they may be right)

so i went and obtained a copy of Saucery CodeBench just to try and cross compile an ARM code from windows to ARM

here's how i did it

this code (not mine)
Code:
.data   HelloWorldString:       
.ascii "Hello World\n"  
.text   
.globl _start   
_start:       
# Load all the arguments for write ()         
mov r7, #4       
mov r0, #1       
ldr r1,=HelloWorldString       
mov r2, #12       
svc #0        
# Need to exit the program         
mov r7, #1       
mov r0, #0       
svc #0
and using commandline gcc
arm-none-eabi-as.exe -o test.o test.cpp
arm-none-eabi-ld.exe -s -o test test.o

actually worked fine...

but when i try something like this:
Code:
#include <stdio.h>
#include <sys/types.h>
int main () 
{
printf ("!!!","%a");
return 0;
}
it shows many errors like:
undefined reference to `abort'
undefined reference to `_sbrk'
undefined reference to `_lseek'
undefined reference to `_lwrite' etc etc
anyone know how to get the C-side of the compiler to work with a script??
 
okay i finally got a C++ from windows cross compile to run on ARM

1) obtain Saucery-Lite arm-2012.03-57-arm-none-linux-gnueabi from code bench
2) install everything (i left out the IDE since we command line compile)
3) follow this guide (arm-none-linux-gnueabi-g++.exe -static -o hello HelloAndroid.cpp)
anddev.org &bull; View topic - Native C++ "Hello World" working in emulator
4) copy the file to your phone sdcard
5) chmod +x hello
6) mv hello /data
./hello

now.. since this cross compiles from Windows -> ARM surely we can now compile build toolchain our sources (since android-2.3.7_r1 no longer supported windows cross compile)
 
Why not just install Virtual box and build in a Linux virtual machine?


(they said it cant be done on windows)
but yur right GeorgeN.. a Virtual Linux would be best... even Cygwin is a Posix setup
here's how far i was able to get after using cygwin with GNU make

Code:
HOSTCC  scripts/basic/fixdep
/bin/sh: scripts/basic/fixdep: cannot execute binary file
scripts/Makefile.host:118: recipe for target `scripts/basic/fixdep' failed
make[2]: *** [scripts/basic/fixdep] Error 126
/cygdrive/c/Android2.3.7/Makefile:396: recipe for target `scripts_basic' failed
make[1]: *** [scripts_basic] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'.  Stop.

would need to modify the script for a hybridized windows/ARM setup (if it can work at all)
 
Back
Top Bottom