CHDK Wiki
Advertisement

This page is about installing a buildenvironment with the gcc 4.3.3 compiler (newest at the time of this page creation).

It hasn't been tested yet if the environment can actually work, in fact, chances are it doesn't.

WARNING! This may not work - use the ordinary build method unless you want to test this!

Here is the original: Compiling_CHDK_under_Linux

Below is how I do it with Ubuntu GNU/Linux 8.10:

Some steps are common, so instead of reproducing it here, I just refer you to the relavant section on the page Compiling_CHDK_under_Linux.

However, some of it I have copied.

Follow the steps for getting the source.

Get the sources of gcc and binutils from a GNU repository. Decide where the cross compiler will be on your computer.

Create some directories, and modify your path to use the cross compiler and binutils
 > mkdir ~/arm-elf
 > export PATH=${HOME}/arm-elf/bin:$PATH
 > mkdir ~/wa
 > cd ~/wa
Create a place for downloads, and download some stuff you will need. I have chosen some random mirrors here, you are free to choose whatever mirror is closer to you.

Here are some mirrors: gcc mirrors, gmplib mirrors, mpfr mirrors (There appears to be only one mirror for mpfr at this time).

 > mkdir down
 > cd down
 > wget ftp://ftp.nluug.nl/mirror/languages/gcc/releases/gcc-4.3.3/gcc-4.3.3.tar.bz2
 > wget http://ftp.sunet.se/pub/gnu/gmp/gmp-4.2.4.tar.bz2
 > wget http://www.mpfr.org/mpfr-current/mpfr-2.4.0.tar.bz2
 > wget http://ftp.download-by.net/gnu/gnu/binutils/binutils-2.19.1.tar.bz2
Unpack and prepare sources.
 > cd ..
 > for zipped in down/* ; do tar xjf $zipped ; done # Note: This may take a while.
 > ln -s `pwd`/gmp-4.2.4 gcc-4.3.3/gmp
 > ln -s `pwd`/mpfr-2.4.0 gcc-4.3.3/mpfr
Fix errors in binutils:
 > ed binutils-2.19.1/gas/config/tc-arm.c
 > /as_bad (_([^"]/s/(_(/("%s", _(/p
 > /as_bad (_([^"]/s/(_(/("%s", _(/p
 > /as_bad (_([^"]/s/(_(/("%s", _(/p
 > /as_bad (_([^"]/s/(_(/("%s", _(/p
 > /as_bad (_([^"]/s/(_(/("%s", _(/p
 > wq

It is nessesary to repeat the command to ed 5 times, as there are 5 similar errors in version 2.19.1 of binutils. According to a post on the mailinglist, the developers do have a patch to fix this in the next version.

Now we're ready to build binutils
 > cd binutils-2.19.1/
 > ./configure --srcdir=../binutils-2.19.1 --target=arm-elf --prefix=${HOME}/arm-elf
 > make
 > make install
 > cd ..
Advertisement