|Subject:||Re: [general] Linux/ARM port?|
|From:||Mark Hindess (mark...@googlemail.com)|
|Date:||May 23, 2007 2:24:28 pm|
On 23 May 2007 at 12:57, Ryan Ordway <ryan...@oregonstate.edu> wrote:
Has anyone tried porting Harmony to Linux/ARM? I have seen vague mentions of it, but no specific plans or information on building for other architectures, cross-compiling, etc. Has anyone tried this? The only architectures I see mention of in the ant scripts are mainly x86/x86_64 and I think PPC.
I don't believe anyone has looked at this platform. I've done some work with the classlib component (not drlvm) for:
freebsd/x86 macosx/ppc32 aix/ppc32 aix/ppc64 linux/s390 linux/s390x
Freebsd and macosx are in the early stages. The others are in pretty reasonable shape.
I've not taken a serious look at cross-compiling so there probably isn't much structure in place to help with that but I'm very interest in getting those changes in if you were to look at it.
I'm also starting to look drlvm on freebsd/x86 and macosx/ppc32 but I don't have a huge amount of time to spend on this at the moment.
Can anyone point me to some documentation or some breadcrumbs to follow? I have a working build for my x86_64 system, but I'm hoping to be able to cross-compile on that x86_64 system for an ARM target for some testing.
I'm not sure there is much documentation. However, I'd suggest:
1) Start with classlib. There is more structure for platforms and architectures in there today. (I'm working on "fixing" drlvm in this respect at the moment.)
2) Read make/properties.xml - add in the relevant properties for your new platform. Ignore the fact that they wont work in the cross-compile environment add them such that they should work on the target platform.
3) Build (or copy from the target platform) the native code dependencies - ICU, lcms, libpng, libjpeg, etc. Instructions for ICU can be found here:
4) Try building the java code, overriding any hy.* properties for things that don't match on your build and target platforms. That is:
ant -Dhy.arch=arm build-java
5) Create a depends/build/platform/linux.arm.mk file with settings for the target platform - again ignore the fact that it isn't your build platform. (Here you'll need to add appropriate -DHYARCH to the compile flags variables.)
6) Make appropriate changes to the (many) architecture specific defines in modules/portlib/src/main/native/include/shared/hycomp.h
7) Try building the native code, overriding any CC, LD, etc make variables using (exported) environment variables. That is:
PATH=/path/to/cross-compiler-toolchain:$PATH ant -Dhy.arch=arm \ -Dhy.no.sig=true build-native
(hy.no.sig skips the signal handler which means you can forget about writing this for the moment.)
8) Fix what doesn't compile. One obvious thing will be the thread assembler that is expected to be in modules/portlib/src/main/native/thread/unix/arm - you could temporarily avoid this with -Dhy.no.thr=true though ultimately you'd need to provide them to get anything to run.
9) Port drlvm. Hopefully by the time you get here I'll be in a position to provide some further suggestions.
10) Report success to the harmony-dev list.
Of course, it goes without saying that you should report progress (or issues preventing your making any) here. I will be very happy to help as much as I can.
Hope this doesn't put you off!