どうもこんばんわ。ぶっそれんれです。
予定どおりというか、1stステップの環境構築、コンパイルの時点で既に死にそうなぶっそれんれです。
前も述べましたが、私ほんとに、エセぎーくなんで、vimとかgccとか、GNU/Linuxとか本当になれてないのです。 勉強しなければとおもいつつも、今回つまった所を全部ピックアップ。現在進行系ふくむ。
環境構築
binutilsも、gccも、本書の指定通りのバージョンを使うとすんなりいく。
具体的には
を使います。
コンパイル時は本のとおり
ryo@******:~/binutils-2.19.1$ ./configure --target=h8300-elf --disable-nls ryo@******:~/binutils-2.19.1$ make ryo@******:~/binutils-2.19.1$ sudo make install ryo@******:~/gcc-3.4.6$ ./configure --target=h8300-elf --disable-nls --disable-threads --disable-shared --enable-languages=c ryo@******:~/gcc-3.4.6$ make ryo@******:~/gcc-3.4.6$ sudo make install
これでいけました。
問題は、Hello Worldのソースコードを書き上げてからのこの謎挙動……。
ryo@*******:~/emos/01/bootload$ make /usr/local/bin/h8300-elf-gcc -c -Wall -mh -nostdinc -nostdlib -fno-builtin -I. -Os -DKZLOAD vector.c /usr/local/bin/h8300-elf-gcc -c -Wall -mh -nostdinc -nostdlib -fno-builtin -I. -Os -DKZLOAD startup.s /usr/local/bin/h8300-elf-gcc -c -Wall -mh -nostdinc -nostdlib -fno-builtin -I. -Os -DKZLOAD main.c /usr/local/bin/h8300-elf-gcc -c -Wall -mh -nostdinc -nostdlib -fno-builtin -I. -Os -DKZLOAD lib.c /usr/local/bin/h8300-elf-gcc -c -Wall -mh -nostdinc -nostdlib -fno-builtin -I. -Os -DKZLOAD serial.c /usr/local/bin/h8300-elf-gcc vector.o startup.o main.o lib.o serial.o -o kzload -Wall -mh -nostdinc -nostdlib -fno-builtin -I. -Os -DKZLOAD -static -T ld.scr -L. /usr/local/lib/gcc/h8300-elf/3.4.6/../../../../h8300-elf/bin/ld: h8300h architecture of input file `vector.o' is incompatible with h8300 output /usr/local/lib/gcc/h8300-elf/3.4.6/../../../../h8300-elf/bin/ld: h8300h architecture of input file `startup.o' is incompatible with h8300 output /usr/local/lib/gcc/h8300-elf/3.4.6/../../../../h8300-elf/bin/ld: h8300h architecture of input file `main.o' is incompatible with h8300 output /usr/local/lib/gcc/h8300-elf/3.4.6/../../../../h8300-elf/bin/ld: h8300h architecture of input file `lib.o' is incompatible with h8300 output /usr/local/lib/gcc/h8300-elf/3.4.6/../../../../h8300-elf/bin/ld: h8300h architecture of input file `serial.o' is incompatible with h8300 output collect2: ld returned 1 exit status make: *** [kzload] エラー 1
なぜこのエラーが……??上手くgccのコンパイラがインストールされてないのか、他に原因があるのか……。。
とりあえず、これを解決しないと先に進めなくて罪そうなぶっそれんれでしたw