Compiling problems... help? - General Discussion and Assistance - CHDK Forum  

Compiling problems... help?

  • 3 Replies
Compiling problems... help?
« on: 20 / August / 2009, 12:22:30 »
After battling with the compiler for a few days, I'm convinced that I'm doing something wrong but I have no idea what...

Camera: Canon a700, 100b
Host platform: Linux

If I use the pre-built binaries for the a700, it works fine. (Yippee! I can do scripting!)

However, if I compile my own, it fails.
  - I see the firmware update.
  - I load the firmware.
  - Everything hangs. No blue blinking light, power button non-responsive, no display.
Removing the battery cover allows it to turn off and then it is back to a working (plain) camera.

Can someone tell me what I'm doing wrong?

Here's where I got the source code:
  svn co chdk

Here's my compiling environment (scripted for easy use):
export home=`pwd`
export PATH=$home/arm-elf/bin:$PATH

echo "Creating cross-compiler."
mkdir tools
cd tools
echo "Extracting binutils"
tar -xf ../src/binutils-2.19.tar.gz
echo "Extracting gcc"
tar -xf ../src/gcc-3.4.6.tar.gz

cd binutils-2.19
./configure --srcdir=../binutils-2.19 --target=arm-elf --prefix=$home/arm-elf
make install

cd gcc-3.4.6
patch -p0 < ../../trunk/tools/patches/gcc-3.4-arm.diff

mkdir gcc-3.4.6-arm-elf
cd gcc-3.4.6-arm-elf
../gcc-3.4.6/configure --srcdir=../gcc-3.4.6 --target=arm-elf --enable-multilib --enable-languages=c --enable-clocale=gnu --disable-libm --disable-libc --disable-threads --disable-nls --disable-libssp --disable-intl --disable-libiberty --with-cpu=arm9 --with-newlib --prefix=${home}/arm-elf
(unset LIBRARY_PATH; unset CFLAGS; make && make install)

And here's how I'm doing the build:
export home=`pwd`
export PATH=$home/arm-elf/bin:$PATH

echo "Compiling camera"
cd chdk/
make PLATFORM=a700 PLATFORMSUB=100b fir
echo "Executables are in chdk/bin"

Any ideas why the DISKBOOT.BIN and PS.FIR from the a700-100b binary distribution works, but my own compilation does not?

Thanks for any assistance.

Re: Compiling problems... help?
« Reply #1 on: 20 / August / 2009, 13:58:46 »
I just tried it with the gcc-4.3.3 compiler.
Same problem: during load, it hangs.

ln -s ../gmp-4.2.4 gcc-4.3.3/gmp
ln -s ../mpfr-2.4.1 gcc-4.3.3/mpfr
# Patch GCC
# The 'ed' command didn't work for me, so here's sed.
mv gcc-4.3.3/gcc/config/arm/t-arm-elf gcc-4.3.3/gcc/config/arm/t-arm-elf.old
cat gcc-4.3.3/gcc/config/arm/t-arm-elf.old | \
      -e 's/^#[[:space:]]*\(.*mno-thumb-interwork\)/\1/' \
      -e 's/^#[[:space:]]*\(.*normal interwork\)/\1/' \
        > gcc-4.3.3/gcc/config/arm/t-arm-elf
rm gcc-4.3.3/gcc/config/arm/t-arm-elf.old

# Compile the compiler
## NOTE: To compile the SX10 image you might have to remove the --with-cpu=arm9
mkdir gcc-4.3.3-arm-elf
cd gcc-4.3.3-arm-elf
../gcc-4.3.3/configure --srcdir=../gcc-4.3.3 --target=arm-elf \
    --enable-multilib --enable-languages=c --enable-clocale=gnu \
    --disable-libm --disable-libc --disable-threads \
    --disable-nls --disable-libssp --disable-intl \
    --with-cpu=arm9 --with-newlib --prefix=$home/arm-elf
unset CFLAGS
make -j 3 && make install


Offline Anaglyphic

  • ***
  • 129
  • Anaglyphic lives!
Re: Compiling problems... help?
« Reply #2 on: 20 / August / 2009, 15:07:17 »
tar -xf ../src/binutils-2.19.tar.gz

Stop. Known linker problem. Grab an older one, 2.17 or 2.18...
Since we cannot know all that there is to be known about anything,
 we ought to know a little about everything.
-- Blaise Pascal

Re: Compiling problems... help?
« Reply #3 on: 20 / August / 2009, 15:32:09 »
Anaglyphic: BINGO! That was it!  Thank you!


Related Topics