TiVoCommunity.com
(c)opyright 1995-2005 All rights reserved
indexcheckTC
This area is a static history of posts in the TiVo Community Forum Archive.
This archive history was made for the simple indexing of search sites like Google.



Pages:1



Developer / Cross compiler FAQ ?

(Click here to view the original thread with full colors/images)



Posted by: osg

After searching the forum for info on cross compiling and other general development info I've found quite a few others looking for the same info but very few answers. In addition, some of those answers are out of date. i.e. references to old or dead URLs

Does anyone know of a TiVo developers FAQ? If not, perhaps those of you who have made it past getting a helloworld.c cross compiled and run on their TiVo would care to share some of their tips and known problems below.

For example:

Have you successfully built source distributions that use GNU's Autoconf for configuration? If so, how do you handle Autoconf tests that fail in a cross compiled environment?

Are there any special arguments you need to supply when compiling?
e.g. --host=powerpc-TiVo-linux or -msoft-float


To start things off:

1) How do I build a cross compiler to build binaries on my Linux PC that will run on my TiVo?

This assumes you have a working Linux PC with basic development tools like make and gcc.

A) Start by getting the following packages:

The script to automate building of the cross compiler is available at:
http://tivo.samba.org/download/mbm/...d-xcompiler.tgz

The TiVo v2.5 software distributions available at:
http://www.tivo.com/linux/

Get the following files:
TiVo-2.5.x-cmd.tar.gz
TiVo-2.5.x-linux-2.1.tar.gz
TiVo-2.5.x-modules.tar.gz
TiVo-2.5.x-toolchain.tar.gz

B) Make a working directory and extract tivo-build-xcompiler.tgz into it

C) Move the tivo source into the "src-v2.5" directory created in B

D) Run tivo-build.sh. Note, this puts the cross compiler in /usr/local/tivo. This can be changed by editing the script.

The following is an example script to do all of the steps above.

#!/bin/sh
# Retrieves and builds an x86 to TiVo/PowerPC xcross compiler
# Quick hack, ie. does NO error checking
# Requires /usr/bin/wget

if [ \! -f /usr/bin/wget ]; then
echo Can not find wget. Exiting.
exit
fi

WORK="$HOME/crosscompiler" # Where we work while building

LIST="http://tivo.samba.org/download/mbm/tivo-build-xcompiler.tgz
http://www.tivo.com/linux/25/TiVo-2.5.x-cmd.tar.gz
http://www.tivo.com/linux/25/TiVo-2...inux-2.1.tar.gz
http://www.tivo.com/linux/25/TiVo-2.5.x-modules.tar.gz
http://www.tivo.com/linux/25/TiVo-2...oolchain.tar.gz"

mkdir $WORK
cd $WORK

for I in $LIST; do
/usr/bin/wget $I
done;

gunzip -c ./tivo-build-xcompiler.tgz |tar -xf -
mv ./TiVo-2.5.x-*gz ./src-v2.5
./tivo-build.sh

# End



Posted by: embeem

That's pretty much all there is to it; the tivo-build script will even generate a simple program at the end of the script.

For convenience you may want to link the resulting gcc to another name within path; ie. ln -s /usr/local/bin/gcc /usr/bin/powerpc-TiVo-linux-gcc

(also, some configure scripts may go looking for "powerpc-TiVo-linux-gcc" when you set the --target)



Posted by: ByteNik

During compilation, when the script runs...
quote:
./configure --target powerpc-TiVo-linux --prefix=/usr/local/tivo --program-prefix= --host powerpc-TiVo-linux --disable-profile --enable-omitfp --enable-add-ons=des-crypt,linuxthreads
I get the following error...
quote:
checking installed Linux kernel header files... TOO OLD!
configure: error: GNU libc requires kernel header files from Linux 2.0.10 or later to be installed before configuring.
The kernel header files are found usually in /usr/include/asm and /usr/include/linux; make sure these directories use files from Linux 2.0.10 or later. This check uses <linux/version.h>, so make sure that file was built correctly when installing the kernel header files.
I checked out the header file in question, which has two lines. The lines are as follows...
quote:
#define UTS_RELEASE "2.1.24-TiVo-2.5"
#define LINUX_VERSION_CODE 131352
If it makes any difference, I'm compiling on Cygwin, but I also attempted this on both a computer running RH Linux 7.1 as well as the Windows computer I was attempting to Cygwin on, in VMWare, emulating RH Linux 7.2...

--ByteNik



Posted by: kazymyr

It may be due to gcc-3.x (I don't have it installed anywhere so I can't check). For reference, it compiles fine under gcc-2.95-3.

Edit: on Cygwin, you don't have a /usr/include/linux!



Posted by: Saturn

ByteNik: I tried to compile a cross-compiler for the TiVo on cygwin on several occasions, each time running into the problem you're having, or something similar. I finally concluded that my knowledge of development on Linux was just not sufficient to make it work, and gave up. But if you ever get something working, PLEASE let me know.

I once got to the point of getting gcc compiled, but then ran into a wall trying to get libc compiled.

Things were a little ambiguous for me - which includes are supposed to be used for what? There are two distictly different sets of include directories - those from the TiVo kernel, and those from the local Linux version...which are used for what?

If it helps you out, I did find this:
http://www.nanotech.wisc.edu/~khan/...cross-howto.txt

It details setting up a cross compiler on cygwin, but it is inherently different than the script embeem et al have created, in that it uses newlib (instead of libc?)

Good luck!



Posted by: Saturn

Here's another HOW-TO by the same guy:

http://www.nanotech.wisc.edu/~khan/...cross-howto.txt

which details cygwin to linux.

Combining the two HOW-TOs above with the script and directions for the TiVo surely could result in success.



Posted by: ByteNik

My understanding is that you don't have to compile libc... you can simply copy the one from your TiVo and link to that instead.

Thanks for the tutorial(s?), but aren't those two URLs the same? :D

ByteNik



Posted by: Saturn

No - in one how-to he is building a cross compiler for a powerpc box - probably something similar to a TiVo. In the other he makes a cross compiler for i686 Linux. They are very similar, but I imagine the subtle differences may provide some clues.



Posted by: ByteNik

Nono, I mean you repeated the same URL:

[a] If it helps you out, I did find this:
http://www.nanotech.wisc.edu/~khan/...cross-howto.txt

[b] Here's another HOW-TO by the same guy:
http://www.nanotech.wisc.edu/~khan/...cross-howto.txt

ByteNik:confused:



Posted by: Saturn

the system here yanked the middle part of the url. Look at the places they link to (click on them) - there's actual text where the message board replaced it with "..."





vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Limited.
vB Easy Archive Final ©2000 - 2009 - Created by Stefan "Xenon" Kaeser Modified by Adam J. de Jaray