メモ書き

自分が後で見直すためにつけている作業のメモ書きです.それ以上の意味はありません

skyeye のビルド(未完)

TTSPを試してみたいと思ったが
エミュレータ SkyEyeを使用するとのことなので調べてみた.

TTSPの動作確認環境はWindows+Cygwinらしいが,Mac OS X を普段利用しているため
こちらでビルドして使えないかどうか調べてみた.

SkyEyeプロジェクトからgitで取得できるらしいので
クローンして,INSTALLファイルを参考にビルドしてみる

$ git clone git://git.code.sf.net/p/skyeye/code skyeye-code
$ ls
skyeye-code
$ cd skyeye-code
$ ./configure
checking build system type... i386-apple-darwin13.0.0
checking host system type... i386-apple-darwin13.0.0
checking target system type... i386-apple-darwin13.0.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
(略)
config.status: creating ltdlconf.h
config.status: executing depfiles commands
config.status: executing libtool commands
$ make lib

山のように警告&エラーが.

/Users/saito/work/skyeye/skyeye-code/libltdl/config/missing: line 54: aclocal-1.11: command not found
WARNING: `aclocal-1.11' is missing on your system.  You should only need it if
         you modified `acinclude.m4' or `configure.in'.  You might want
         to install the `Automake' and `Perl' packages.  Grab them from
         any GNU archive site.

aclocal のバージョン番号が1.11固定で埋め込まれているらしく,別バージョンだと警告が出る.
そこで,ファイルを一旦元に戻し,ファイルの該当箇所を置換してやり直してみる

$ rm -rf * .deps
$ git checkout .
$ for i in `grep -rl aclocal-1.11 *`; do sed -i".org" -e "s/aclocal-1\.11/aclocal-1\.14/g" $i; done
$ for i in `grep -rl automake-1.11 *`; do sed -i".org" -e "s/automake-1\.11/automake-1\.14/g" $i; done
$ ./configure
$ make lib

次のような警告はまだ出るが,リンクの手前までビルドは進み,結果エラーとなる.

checking for makeinfo... makeinfo
makeinfo: warning: error loading ./Config: Can't locate ./Config in @INC (@INC contains: /opt/local/share/texinfo/lib/Text-Unidecode/lib /opt/local/share/texinfo/lib/Unicode-EastAsianWidth/lib /opt/local/share/texinfo/lib/libintl-perl/lib /opt/local/share/texinfo /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 .) at /opt/local/bin/makeinfo line 376.
duplicate symbol _size_changed in:
    .libs/cr16-dis.o
    .libs/crx-dis.o
duplicate symbol _words in:
    .libs/cr16-dis.o
    .libs/crx-dis.o
duplicate symbol _allWords in:
    .libs/cr16-dis.o
    .libs/crx-dis.o
(中略)
duplicate symbol _SUBWORDDFSI in:
    .libs/m32c-asm.o
    .libs/m32c-opc.o
duplicate symbol _SUBWORDXFSI in:
    .libs/m32c-asm.o
    .libs/m32c-opc.o
duplicate symbol _SUBWORDTFSI in:
    .libs/m32c-asm.o
    .libs/m32c-opc.o
ld: 62 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libopcodes.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [lib] Error 2

問題のキーワード SUBWORDTFSI 等は third-party/opcodes/cgen-ops.h で定義されているらしい.

SEMOPS_INLINE SI
SUBWORDTFSI (TF in, int word)
{
  /* Note: typedef struct { SI parts[4]; } TF; */
  union { TF in; SI out[4]; } x;
  x.in = in;
  return x.out[word];
}

キーワードが duplicate ということは,インライン展開されてないのではないかと思ったので `SEMOPS_INLINE` を検索したら,次の内容だった.

#if defined (__GNUC__) && ! defined (SEMOPS_DEFINE_INLINE)
#define SEMOPS_DEFINE_INLINE
#define SEMOPS_INLINE extern inline
#else
#define SEMOPS_INLINE
#endif

つまり,clang 使ってて __GNUC__ が定義されてなかったりするのではないかなと推測.
そのため,インライン関数ではなくて通常の関数で定義されているとか.

とりあえずここまで.