I have built a TiVo PowerPC cross-compiler for both
Microsoft Windows (with
the Cygwin Unix-style enviroment) and
Linux host systems.
The cross-compiler build script and patches are based on
Mike Baker's tivo-build-xcompiler,
but I made some improvements,
updated it to work with Cygwin and newer versions of gcc as host compiler,
and fixing a number of bugs (notably the libc "Illegal Instruction" error).
I have also built some libraries that might help you porting software. See my main page for more TiVo software.
/usr/local/tivo.
It won't work if you put it elsewhere (that's a gcc "feature").
It might help to put /usr/local/tivo/bin in your PATH
(not essential - it will work fine if executed directly as /usr/local/tivo/bin/gcc).
If you put it at the beginning of your PATH, then the TiVo version of gcc etc
will take precidence (which is fine as long as you don't forget it's
there and get confused when you try to build a program with the native compiler).
Otherwise put it at the end of the PATH and run it as
powerpc-TiVo-linux-gcc.
The following pre-built cross-compilers come with the TiVo-2.5.x-linux-2.1 headers. It probably won't make any difference, but if you have TiVo version 3.0, you may want to update the headers to TiVo_3.0_linux_2.1. Rather than downloading that entire source distribution, you can unpack just these header files after installing the cross-compiler.
Download the binaries (8 MB download)
and untar from the Cygwin root, /. For example, if you downloaded the tar file
to C:\Downloaded\usr.local.powerpc-tivo-cygwin-3.tar.bz2,
then it can be installed with
cd / tar jxf /cygdrive/c/Downloaded/usr.local.powerpc-tivo-cygwin-3.tar.bz2
libc.so.6.
Otherwise build your own.
Download the binaries (8 MB download)
and untar from the root directory, /. Eg.
cd / tar jxf ~/usr.local.powerpc-tivo-linux-sl3-3.tar.bz2
You can download build script and patches or view the Readme file and patch file separately.
/lib/libc.so can be used.
Note that the NSS functions are provided by shared libraries even if you
link statically (-static).
Download the C shared libraries' tar file
and copy it to your TiVo.
It should be installed under the /var/hack directory.
If you have installedcd /var/hack gzip -dc tivo-libs-3.tgz | cpio -iduH tar
tar on your TiVo
(eg. from mbm's downloads,
or my my newer version), then it's even simpler
That will place it incd /var/hack tar zxf tivo-libs-3.tgz
/var/hack/lib.
Once installed on the TiVo, add /var/hack/bin to your PATH
(assuming you intend to install programs there)
and /var/hack/lib to your LD_LIBRARY_PATH, ie.
It should also work without theexport PATH=/var/hack/bin:$PATH export LD_LIBRARY_PATH=/var/hack/lib
LD_LIBRARY_PATH setting
if you install it in /lib. However that would overwrite the
TiVo's standard libc.so, which I was loath to do.
This version of the C Library includes a fix to the infamous "Illegal Instruction" error, which occurred whenever a program tried to execute any of the lookup functions implemented via the C Library's Name Service Switch (NSS) scheme (passwd, group, hosts, protocols, services, etc). This bug is present in both the TiVo 2.5.5 standard libc and in other rebuilt libraries (such as from tivoutils). I'd be interested to know whether it was also present in later TiVo PowerPC software versions (3.0+). Previously it has been necessary to disable calls to those routines (eg. with libtivohack, which provides dummy, largely non-functional, replacements that at least don't crash), but that is no longer necessary with my fix.
With this fix, the lookups behave as normal.
I have tested all of the
routines that libtivohack replaced, and they now work as expected.
Host names are found in
/etc/hosts or by a DNS lookup (assuming the DNS servers
are defined in /etc/resolv.conf and accessible);
user and group account information is found in /etc/passwd
and /etc/group respectively; and so on.
The fix was very simple: for some unaccountable reason,
nss_lookup_function's body (in libc/nss/nsswitch.c)
had been removed in TiVo's official
TiVo-2.5.x-toolchain.tar.gz.
Without this, a random function pointer was returned, so when this
was executed, it's not surprising that an Illegal Instruction ensued.
I restored the missing code.
Some examples of how the fix works can be found on this forum posting.
xterm, vt100, linux, and ansi
terminfo files built-in. If you want to support other terminal types ($TERM values),
then you should install the terminfo files.