Hacking devices can/will void your warranty and can turn your expensive consumer electronics into worthless trash if you don't know what you're doing. This blog is for information purposes only, and if you try to hack into your own consumer electronics, you do so at your own risk. The device I'm currently hacking is the Canon SX10 IS camera.

Saturday, February 14, 2009

G++ toolchain fixed

I finally found the headers I needed for g++. They were in the buildroot, but were not being copied to the root for inclusion in the toolchain. I had tried copying them before, but I must have copied the wrong ones. Tried again and this time it worked. So here's the new uclibc toolchain for mipsel.


One note on the g++ -- you need to make the libraries available before you can run anything you compile. Those libraries are in the usr/lib of the ext2. Create a symbolic link of that called /usr/lib and you won't have to copy it. Of course, if you want to distribute any g++ compiled program, you'll need to include that library as well or nobody else will be able to run it. You can probably link it in to the executable somehow.

edit: To get the compiled c++ programs to work, I had to copy libgcc_s.so.1 and libstdc++.so.6.0.9 to the /usr/lib directory, and also do the symbolic links of libgcc_s.so to libgcc_s.so.1 and libstdc++.so and libstdc++.so.6 to libstdc++.so.6.0.9.

I also got a chance to try out some stuff with an ext3 formatted hddmedia partition. And it was way worth it.

I used symbolic links to hook up folders from my USB drives. As a result, all of the information available on those drives appears under my main ScreenPlay Pro drive when I'm browsing. So I don't have to exit to the menu and go to the USB directory. And its allowed me to create simple categories for finding the movies by placing those categories at the root level.

This is something that I think would work really well as a web page, so I'm going to try to create something like that to make it easy to do symbolic links. And while I'm at it, I might as well make it intelligent enough to allow downloading those files and, in the case of a VIDEO_TS directory, automatically create a tarball of the entire directory for download when you click on it.


  1. Congratulations on your findings and some questions:

    Formatted with ext3 you get a higher transfer speed networking?

    Software that you installed in windows to recognize the ext3?

    It would be possible to add an ext3 partition instead of turning it completely?

    Thank you very much and sorry for my bad english

  2. EXT3 did not make network access any faster. I didn't expect it would either. I'm already getting 20 Mbits/sec using the new samba driver and ethernet connection (wifi on either end cuts the speed by half). Of course, I'm using journaling on EXT3, which is much slower but it is more important to me to keep the drive integrity.

    There is software for allowing windows to recognize ext3. For example http://www.fs-driver.org has a kernel level driver. I have not tried any of these. I prefer to keep my EXT3 partitions away from Windows. So right now I move things over using the network, or moving things onto my NTFS external drives and from there onto my main drive.

    The complication to just adding an ext3 partition is that all 4 primary partitions are already used. So you'd have to delete partitions 3 (swap) and 4 (NTFS), turn partition 3 into an extended partition. Make partition 4 your EXT3 partition, make partition 5 (in extended) your swap partition, make partition 6 (in extended) your NTFS partition. And you'd have to modify the linux startup scripts (rcS1 in particular) to make the swap drive number 5 and to mount the NTFS partition in a directory inside your EXT3 partition so that you could view it from the ScreenPlay menu. You could make the NTFS a read only partition, which would help avoid problems with the linux kernel NTFS driver.

  3. Hello, I am trying to use the toolchain that you created to update the version 0.7.2 of dctcs to http://yodctcs.googlepages.com/home2. Could help me with a small step by step to achieve this? My unix skills are limited.
    Thank you

  4. Hi, While trying to compile the Enhanced CTorrent code version 3.3.2 with your latest toolchain I run in trouble.

    I get a binary that runs ok within the development environment. I did copy gcc and stdc++ libs but the culprit seems to be on a different version (though both 0.9.28) of uClibc (file sizes are different too).

    I could use some help to force the binary to load ld-uClibc.so from a directory different than /lib

  5. I am actually in process of trying to retrofit the open source iomega and others have published (see http://rtd1261.wikidot.com/forum/t-132207/some-source-code-from-rtl1262) back into the toolchain. I've been swamped lately and haven't had a chance to do anything. But I've taken the next few days off of work, so I should be able to find time to finish it.

  6. Thanks, I'll have a look at these files. In the mean time I've installed qemu in my Ubuntu PC. With it I can emulate a mipsel architecture and mount different toolchains till trying to find the right combination.

    I've seen that one of the configuration params of uClibc is whether or not files >2GB are allowed.

    I still haven't solved the 2GB limit of version 3.2 of Enhanced CTorrent.

  7. Ok, Enhanced CTorrent 3.3.2 in now running on my SPP. I was right about assuming the problem was a library problem but I it was not uClibc but libc or libm. What happens is that both are present too on /lib directory of SSP. I did not want to overwrite them.

    What I have done (and it works) is to use the g++ toolchain you provided in this post to build the binary. Unfortunately the resulting binary does not work on SPP (it fails to parse torrent files). However if you add LD_LIBRARY_PATH=/another_folder and you put libc.so.0 and libm.so.0 from g++ toolchain then the compiler binary will run nicely.

    To make it work with dctcs I did an export LD_LIBRARY_PATH=/another_folder and then I called dctcs. This way every ctorrent invocation from dctcs will work too.

    Happy file sharing,


  8. Hola Miguel, I also mounted the toolchain to compile the ctorrent but I get several errors. Could detail the process a little more? . Be nice if you explained this in the wikia and attach the resulting binary.Thank you very much and greetings

  9. #install dctcs and ctorrent as in the wiki
    #get g++ toolchain from consumerelectronicshacks.com
    #telnet to your SPP and cd to where you've put the rootfs image

    mount -o loop rootfs.mipsel.ext2 /mnt/hdd
    cp /etc/resolv.conf /mnt/hdd/etc/
    chroot /mnt/hdd
    mount -t proc proc /proc

    #get Enhanced CTorrent from SourceForge

    wget http://freefr.dl.sourceforge.net/sourceforge/dtorrent/ctorrent-dnh3.3.2.tar.gz
    gunzip ctorrent-dnh3.3.2.tar.gz
    tar xvf ctorrent-dnh3.3.2.tar
    cd ctorrent-dnh3.3.2/
    # get a cup of tea ... it will take a long while
    # too soon for another cup of tea?

    #now you have to copy ctorrent binary + /lib/libgcc_s.so.1
    #+ /lib/libc.so.0 + /lib/libm.so.0 + /usr/lib/libstdc++.so.6 somewhere
    #and now let's return to our SPP filesystem ...


    cp your_folder/ctorrent /usr/local/bin/ctorrent
    cp your_folder/libgcc_s.so.1 /lib/
    mkdir /another_lib
    cp your_folder/libc.so.0 /another_lib
    cp your_folder/libm.so.0 /another_lib
    cp your_folder/libstdc++.so.6 /usr/lib

    # now you can run ctorrent on SPP!!!
    LD_LIBRAY_PATH=/another_lib ctorrent

    #if you need to double check your binaries libraries
    #LD_TRACE_LOADED_OBJECTS=1 ./ctorrent

  10. Thanks for the work putting this toolchain together. I was able to compile some useful binaries on it so they can be run on the custom firmware of the Freeagent Theater Plus (another Realtek player).