Shiny New E-Book Gizmo: The Amazon Kindle


View Full Version : Compiling for Reader: toolchain and libraries?


igorsk
12-17-2006, 09:18 PM
I want to try writing some code for the Reader. However, I'm not very familiar with Linux development, so I would like some advice from the more experinced MobileReaders.
As far as I know, firstly I need a cross-compiler toolchain. I found instructions (http://64.233.183.104/search?q=cache:www.public.asu.edu/~ajennin/librie.html) for setting up a toolchain for Librie, but Librie uses older versions of gcc ang glibc, so I think that won't work too well.
From the listing of files in the Sony's source download repository:
hhl-target-gcc-3.2.1-mvl3.0.0.5.20.src.rpm
hhl-target-glib-1.2.10-mvl3.0.0.7.src.rpm
hhl-target-glibc-2.2.5-mvl3.0.0.15.14.src.rpm
So I guess I need to configure for gcc-3.2.1 and glibc-2.2.5, right?
Can I use those RPMs somehow? Or I'll have to use crosstool? I also found hhl-cross-gcc-3.2.1-mvl3.0.0.5.20.src.rpm, is this better than "target"? I have installed Ubuntu, will it work? Or it's better to get Redhat as it seems to be a preferred distro for Montavista? If so, which version? How about Cygwyn?

kovidgoyal
12-18-2006, 08:11 PM
I have to admit, I've never done any cross compiling, but I do know that most people consider it to be a pin. I would recommend using crosstool from here
http://kegel.com/crosstool/

If you dont want to use crosstools, you can use the rpms...installing them into some directory like /usr/local/cross-prs500 with the --prefix options.

I think hhl-cross-gcc-3.2.1-mvl3.0.0.5.20.src.rpm is the cross compiler SONY used though I'm not sure. the target RPMs probably refer to the compiler/tool chain on the prs-500.

Ubunti is fine you can use rpm2targz http://www.fship.com/demos/rpm2targz to convert RPMs into tarballs or sudo apt-get install alien to install binary rpms on Ubuntu.

Hope that helps.

porkupan
12-18-2006, 09:12 PM
I've built crosstool for ARM on Cygwin, seems to work. Had to set the build directory to some real short path as the thing used to blow up on me with longer directory names. Current crosstool version comes with glibc 2.2.2 . I don't see any reason why you wouldn't be able to build glibc 2.2.5 with it. Unless the compiler couldn't handle it... I haven't tried compiling anything and running it on the Reader yet. The crosstool is able to compile and build ARM executables - testing it is part of the installation.

It's possible Sony was so nice as to distribute the installable binaries for the gcc (cross-compiler) in the Reader's source depository. After all, what do they have to lose? I would try installing those RPMs on RedHat or Fedora, hopefully the binaries would be compatible.

jakeluck
12-18-2006, 11:51 PM
where did you find

hhl-cross-gcc-3.2.1-mvl3.0.0.5.20.src.rpm

i only see hhl-target at http://www.sony.net/Products/Linux/Download/PRS-500U.html

per recommendation of more redhat like distros, try centos, i use it for development for clients who requires redhat compliance.

igorsk
12-19-2006, 02:48 AM
jakeluck
Here (http://www.sony.net/Products/Linux/Download/NV-XYZ88_NV-XYZ77_NV-XYZ55_NV-XYZ33_NV-XYZ777_NV-XYZ777EX_NV-XYZ777LE.html)'s the cross-gcc rpm. However, it depends on binutils rpm, which I was unable to find.

Corwin
12-26-2006, 08:53 AM
Igorsk, I've compiled sipmle program with crosstol. Can you trie to run it with your lbhook.sh ? This program prints "Hello world" to stdout.

http://max.hosting.ru/hello
http://max.hosting.ru/hello-static
P.S. Unfortunaly installation of pached rootfs on my reader breakes with errors :(

Corwin
12-26-2006, 12:11 PM
He he! hello-static works perfectly! :)

http://www.the-ebook.org/forum/viewtopic.php?p=64904#64904