I'm working on it.
http://perpetual-notion.blogspot.com/search/label/android
The code is pretty well written, so it shouldn't be too hard to port
to a different ARM ISA.
I've compiled it 'trivially' already for ARMv4T - that is, by simply
removing all instructions a part of the v5 extension.
With a list of v5 instructions, one can grep through the source tree
and uniquely sort individual files that use the ARMv5 extension. What
we have, at this point, is a list of unsupported instructions (all of
ARMv5TE), and a list of files that need to be patched.
My general strategy for bridging the code from ARMv5TE to ARMv4T is
to
1) [ Individual Instruction Translation ] effectively translate the v5
instruction using a sequence of v4 instructions, if possible, while
still being time efficient (not necessarily possible)
2) [ Routine Re-implementation ] if the above isn't possible, find the
context where the v5 instruction is used and then replace it with an
optimized v4 ISA routine. For something like memcmp.S, this is
relatively easy.
However, many userspace libraries have v5 instructions encoded pretty
heavily. In many cases, the hardware dependent portion of is
abstracted out using an inline function - this is a good thing.
Hopefully the code will not get too complex if we just use #ifdef
statements everywhere to differentiate between compiling for ARMv4 or
v5.
Incidentally, does anyone know which symbols are defined for the
target arch? __ARM_ARCH_5__, __ARM_ARCH_5T__, __ARM_ARCH_5TE__ ? I
think I've also even seen others... it could get messy. I'm also not
100% sure how the build system differentiates targets and devices ...
Any ideas? So far, I've just adjusted build/core/combo/
linux-arm.mk
and changed GLOBAL_CFLAGS to
$(combo_target)GLOBAL_CFLAGS += \
-march=armv4t -mtune=arm920t \
-msoft-float -fpic \
-mthumb-interwork \
-ffunction-sections \
-funwind-tables \
-fstack-protector \
-D__ARM_ARCH_4__ -D__ARM_ARCH_4T__ \
-include $(call select-android-config-h,linux-arm)
Although, in hindsight, it would be wiser to store the armv5te /
armv4t global cflag lines in variables, and then just select between
the two. In any case, it builds using this method, after removing all
v5E instructions.
Chris