GCC 4.7.1を構築する(v850編)

V850のクロス開発環境を作ります。

事前に必要なことは 準備編を参照してください

Binutils

  % cd binutils-2.22
  % mkdir -p build_v850 && cd build_v850
  % ../configure --target=v850-linux-elf \
                 --prefix=/home/syohei/local/v850 --disable-nls
  % make
  % make check
  % make install
  % export PATH=/home/syohei/local/v850/bin:$PATH

GCC

newlibを展開しておき、その中のディレクトリをシンボリックリンクしておきます。

  % cd gcc-4.7.1
  % ln -sf ../newlib-1.20.0/newlib .
  % ln -sf ../newlib-1.20.0/libgloss .
  % mkdir -p build_v850 && cd build_v850
  % ../configure --target=v850-linux-elf --prefix=/home/syohei/local/v850 \
    --disable-nls --enable-languages=c --with-gmp=/home/syohei/local \
    --with-mpfr=/home/syohei/local --with-mpc=/home/syohei/local \
    --with-ppl=/home/syohei/local --with-cloog=/home/syohei/local \
    --with-newlib --with-headers=../newlib/libc/include --enable-lto --enable-cloog-backend=isl
  % make
  % make check
  % make install

newlib

  % cd newlib-1.20.0
  % mkdir -p build_v850 && cd build_v850
  % ../configure --target=v850-linux-elf --prefix=/home/syohei/local/v850 --disable-nls
  % make
  % make check
  % make install

GDB

  % cd gdb-7.4.1
  % mkdir -p build_v850 && cd build_v850
  % ../configure --target=v850-linux-elf --prefix=/home/syohei/local/v850 --disable-nls
  % make
  % make check
  % make install

テスト

Testgenの v850のコンフィグファイルとして以下を作成します。

+{
    compiler      => 'v850-linux-elf-gcc',
    simulator     => 'v850-linux-elf-run',
    c_flags       => [ '-g', '-Dunix' ],
    ld_flags      => [ '' ],
    options       => ['-O0', '-O1', '-O2', '-Os', '-O3'],
    testdir       => 'testsuite_v850',
    compile_only  => 0,

    size => {
         char  => 8,
         short => 16,
         int   => 32,
         long  => 32,
         pointer => 32,
    },

    timeout       => 10,
    color         => 1,
};
テスト生成, 実行
  % perl bin/tgen.pl --config=config/v850_cross.cnf template/*.tt 
  % cd testsuite_v850
  % ./runtest.pl
テスト結果

結果だけですが、基本的な部分では問題なさそうです。

------------------------------------------
Total          :    87970
Passed Compile :    87970 (100.0 %)
Failed Compile :        0 (  0.0 %)
Passed Execute :    87970 (100.0 %)
Failed Execute :        0 (  0.0 %)
------------------------------------------