Porting to SH4

by Jimmy-Creupagu » Thu, 17 Sep 2009 22:05:50 GMT


Sponsored Links
 Hi all!

I'm trying to port Android to SH4 arch.
I downloaded all the patches I could find from the web and from:

https://review.source.android.com/#dashboard,1001893

Also, few changes from the link are now merged in master branch.

Recently I updated my build system to "donut" but I'm having more
errors than before...
This kind of errors doesn't happen in compiling for TARGET_ARCH=arm




u...@user-desktop:~/ANDROID$ make TARGET_ARCH=sh -j2 showcommands
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=1.6
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=sh
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=Donut
============================================
build/core/copy_headers.mk:15: warning: overriding commands for target
`out/target/product/generic/obj/include/libpv/getactualaacconfig.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for
target `out/target/product/generic/obj/include/libpv/
getactualaacconfig.h'


[...]

# FIRST ERROR

make: *** No rule to make target `out/host/linux-x86/bin/emulator',
needed by `out/host/linux-x86/bin/dexpreopt.py'.  Stop.

## to avoid the problem I defined in product_config.mk:

ifeq ($(TARGET_ARCH),sh)
  DISABLE_DEXPREOPT := true
endif

## Is that a known issue??

## I then tried to build only the pseudo target "libc" ... but I
obtain:

error: asm-generic/int-ll64.h: No such file or directory

error: linux/const.h: No such file or directory

# this files are missing in donut but not in cupcake. I copied them
from my cupcake bkup dir.
# Then ...

bionic/libc/unistd/socketcalls.c:235: error: conflicting types for
'sendmsg'
bionic/libc/include/sys/socket.h:74: error: previous declaration of
'sendmsg' was here
bionic/libc/unistd/socketcalls.c:248: error: conflicting types for
'recvmsg'
bionic/libc/include/sys/socket.h:75: error: previous declaration of
'recvmsg' was here

# I modified socketcalls.c and changed "ssize_t" to "int" to be in
accordance with socket.h
#BUT WHY does arm not show the same issue??
# with this modifications I achieve to compile "libc"



##DALVIKVM
## then I tried to build "dalvikvm" with the same config as before...

external/openssl/crypto/ui/ui_openssl.c:224:21:  error: termio.h: No
such file or directory

## As far as I understand, I miss some define somewhere because TERMIO
is defined... but it
## shouldn't...is it?




## Can you give me some hints about what to do?
Should I add some definitions?
go back to cupcake maybe?

Thanks!

Jimmy



--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Porting to SH4

by Jean-Baptiste Queru » Thu, 17 Sep 2009 22:25:02 GMT


 he dexpreopt part makes sense: dexpreopt needs to run the target
image in an emulator so that it can run the code in the exact target
environment, and there's no sh emulator (deep inside, this implies
that dexpreopt for sh would have to be done on actual hardware).

I don't have any direct idea for the other issues, but my guess is
that the kernel headers you're using for sh don't match what bionic
(the android C library) expects.

JBQ

On Thu, Sep 17, 2009 at 7:05 AM, Jimmy-Creupagu <jamai5...@gmail.com> wrote:



--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---


Sponsored Links


Porting to SH4

by Jimmy-Creupagu » Fri, 18 Sep 2009 17:35:03 GMT


 n Sep 17, 4:24pm, Jean-Baptiste Queru <j...@android.com> wrote:

THANKS JBQ!! That's something we can work in the next future




I'll check the kernel headers ASAP.

About the conflicting types, ssize_t and int, I read the comment of
David Turner to the patch: he said they should be ssize_t cause it's
an ABI violation.

But in bionic/libc/include/sys/socket.h , the header states they are
"int" type. Can you clarify it?



Thank you very much

Jimmy

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Porting to SH4

by Jean-Baptiste Queru » Fri, 18 Sep 2009 20:53:57 GMT


 o be honest, I'm not aware of the deep details around the two socket
functions or why there seems to be a disagreement about whether those
should return int or ssize_t. The best place to have that discussion
is to directly comment on the code review site, since that will reach
the right people.

Because I'm not familiar with the mechanisms involved in putting the
syscalls together, I don't quite know where to look. My best guess is
that there's a mismatch between the bionic headers and the linux
syscall interface, but I'm not immediately in a position to research
the history of that mismatch. Hopefully I'll have more time for it in
the near future.

JBQ

On Fri, Sep 18, 2009 at 2:34 AM, Jimmy-Creupagu <jamai5...@gmail.com> wrote:



--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Other Threads

1. Java App UI / Engine C split query

If I have a large existing component alredy developed for another
platform in C and I want to port it to Android what are the options?

If I re-write the entire thing in Java that will take a long time and
also I would be worried about performance issues with everything
running in the JVM.

So if I split it so that the UI is in Java and the engine is in C what
are the available mechanism(s) for making the C API available to the
Java application?
How would I debug this i.e. if I run the Java app in Eclipse how can I
step into the C code?

Are there other options?

--~--~---------~--~----~------------~-------~--~----~

2. Android Email Notification

Having read several times the topic on Push Notification Techniques
bellow, I still wonder how the current email notification technique on
android works?!

3. Exchanging Messages between services containing Bundles with self-developed Parcelables

4. Music App Weirdness

5. Exchanging Messages between services containing Bundles with self developed Parcelables

6. how to start the default music application from my own application

7. I'm Trying To Learn.......