The following are instructions of how to build KPIT's apparently offical(According to Wikipedia, according to Renesas, dunno) GCC/H8 toolchain. Basically I've worked on these instructions for a few hours, rebuilding, testing, deleting, rebuilding.. so they should work for anyone and produce working binaries. I've only built the c compiler, if you want c++ add that to the enabled languages, I'm not sure if it works though. A lot of people will want to add -j2 or similar to the make commands (not the make install) so that things build in parallel and maybe add sudo to the install parts. The tool chain will go in /usr/local/h8300-elf, on Debian at least, this seems like a fairly sensible place for it to go. KPIT do have RPM's downloadable on their site.. but who uses RPM? *smirk*
tar xjf ./binutils-2.19_sh_h8_m16c_v0902.tar.bz2 cd binutils-2.19/ ./configure --target=h8300-elf --disable-werror make make install
tar xjf ./gcc-4.3.3_sh_h8_m16c_v0902.tar.bz2 mkdir gcc-4.3.3-h8/ cd gcc-4.3.3-h8/ ../gcc-4.3.3/configure --target=h8300-elf \ --enable-languages=c \ --with-newlib=yes \ --with-gnu-as \ --with-gnu-ld \ --disable-shared \ --disable-libssp \ --enable-languages=c \ --disable-nls \ --disable-threads make all make install
tar xjf newlib-1.16.0_sh_h8_m16c_v0902.tar.bz2 cd newlib-1.16.0/ ./configure --target=h8300-elf make make install
tar xjf gdb-6.8.50.20090327_sh_h8_m16c_v0902.tar.bz2 cd gdb-6.8.50.20090327 ./configure --target=h8300-elf make make install
GCC version info
/usr/local/bin/h8300-elf-gcc -v Using built-in specs. Target: h8300-elf Configured with: ../gcc-4.3.3/configure --target=h8300-elf --enable-languages=c --with-newlib=yes --with-gnu-as --with-gnu-ld --disable-shared --disable-libssp --enable-languages=c --disable-nls --disable-threads Thread model: single gcc version 4.3-GNUSH_v0902 (GCC)
Compile and Test hello.c
#include <stdio.h>
int main(void)
{
int ret;
ret = printf("Hello World!\r\n");
return ret;
}
h8300-elf-gcc hello.c -o hello.out -g h8300-elf-run hello.out Hello World!
Below are links to local copies of the GCC, Binutils and Newlib tarballs. Now, I'm not sure I want to get in trouble, but I'm uploading these here because otherwise it's a pain in the arse to get hold of these. The people at KPIT seem to have attached the below redistribution clause to these files.. I don't know if they know that the GPL says they aren't allowed to go adding any clauses, or if this clause refers to their Windows installer (the tarballs don't seem to contain anything other than a few patches) but anyhow, it seems a bit silly to keep these locked up where no one can find them. However, if you do register with KPIT you get access to a copy of Renesas' HEW, so if that's useful to you go and register with them.
All KPIT GNU toolchains can be freely re-distributed by third parties provided that all end users are directed to kpitgnutools.com to register for free prior to use. Windows installers enforce this by requesting an activation code during installation. Users automatically receive their individual activation code during free registration. Please help us continue to provide this service by ensuring all users register at kpitgnutools.com. Thank-you.