[H8-ML(1713)] gcc on Cygwin でアセンブラがエラー
From: Kazutaka Shimoda <samurai@xxxxxxxxxxxx>
Date: 2002年04月06日(土)00時00分52秒
下田と申します。

Win2000SP2 + Cygwin 上で H8 の開発環境を構築しようとしていますが、
コンパイルができずに困っています。

具体的には

	$ cat hello.c
	main()
	{
	}

というCのソースをコンパイルすると

	$ h8300-hms-coff-gcc.exe -mh hello.c
	*Initialization*:1: warning: `__SIZE_TYPE__' redefined
	*Initialization*:1: warning: `__PTRDIFF_TYPE__' redefined
	cpp.exe: -lang-c: linker input file unused since linking not done
	/tmp/cc47Qikp.s: Assembler messages:
	/tmp/cc47Qikp.s:1: Error: no such instruction: `gcc For the Hitachi
	H8/300'
	/tmp/cc47Qikp.s:2: Error: no such instruction: `by Hitachi America
	Ltd and Cygnu
	s Support'
	/tmp/cc47Qikp.s:3: Error: no such instruction: `release F-1'
	/tmp/cc47Qikp.s:5: Error: Unknown pseudo-op:  `.h8300h'
	/tmp/cc47Qikp.s:11: Error: invalid character '.' in mnemonic
	/tmp/cc47Qikp.s:12: Error: invalid character '.' in mnemonic
	/tmp/cc47Qikp.s:14: Error: invalid character '.' in mnemonic
	/tmp/cc47Qikp.s:15: Error: no such instruction: `rts'

と、アセンブラが Error を示すのです。
そこで、一旦アセンブラソースを作ってからアセンブルしてみると、

	$ h8300-hms-coff-gcc.exe -S -ansi -mh hello.c
	*Initialization*:1: warning: `__SIZE_TYPE__' redefined
	*Initialization*:1: warning: `__PTRDIFF_TYPE__' redefined
	cpp.exe: -lang-c: linker input file unused since linking not done

	$ h8300-hms-coff-as.exe hello.s

	$ ls
	a.out            hello.c        hello.s


ちゃんと a.out ができています。

アセンブラのソースを見てみると

	$ cat hello.s
	;       GCC For the Hitachi H8/300
	;       By Hitachi America Ltd and Cygnus Support
	;       release F-1

	        .h8300h
	        .file   "hello.c"
	        .section .text
	        .align 1
	        .global _main
	_main:
	        push.l  er6
	        mov.l   er7,er6
	.L2:
	        pop.l   er6
	        rts
	        .end

となっており、コンパイラがコメント文に対しても文句を言っているのが
わかります。
ここまでは突き止めたのですが、この先の対策が分からずに困っています。


環境構築の際は http://www.ertl.ics.tut.ac.jp/~muranaka/devel/ より
Cygwin と gcc のバイナリをダウンロードし、install.txt の指示に従って
インストールをしております。
gcc のバージョンは 2.95.2 、Cygwin は 1.4.4 です。

また、ソースからビルドして構築したこともありましたが、その際も
同様の現象が発生しております。


どなたか解決策をご存知の方、または心当たりのある方、いらっしゃいましたら
ご返信ください。

よろしくお願いします。

-- 
下田 和貴 Kazutaka Shimoda
  <samurai@xxxxxxxxxxxx>


スレッド概略
[表示中](起点)
 └[1716(1)]


投稿順に移動
[←前の記事へ(P)]
[→次の記事へ(N)]


リスト表示へ
[このスレッド(T)]
[本記事の前後(L)]