2011年01月26日

GCC 4.6.0 (gcc-4.6-20110122) をビルドしてみたYO! その5

GCC 4.6.0 (gcc-4.6-20110122) をビルドしてみました。

Go language(gccgo)が追加されているのですが、何度やってもビルドできなくて、gccgoはあきらめました。

自前ビルドの手順はGCC 4.5.0とほとんど同じですので、こちらの記事を参考にしてください。
GCC 4.5のビルド

gcc-4.6-20110122のソースに、以下のパッチを適用してください。
libgompパッチ
libgomp-configure.diff
make-temp-fileパッチ
make-temp-file.diff

$ cd gcc-4.6-20110122
$ patch -p1 < ../libgomp-configure.diff
$ patch -p1 < ../make-temp-file.diff

ソースが準備できたら、configure、make、make installします。

$ ../gcc-4.6-20110122/configure --prefix=/mingw --build=mingw32 --with-arch=i686 --with-tune=generic --enable-languages=c,c++,objc,obj-c++ --enable-libgomp --disable-werror --enable-threads --disable-nls --disable-win32-registry --disable-sjlj-exceptions --with-dwarf2 --enable-lto --with-system-zlib --with-host-libstdcxx=-lstdc++ --enable-libstdcxx-debug --enable-cxx-flags='-fno-function-sections -fno-data-sections' --disable-libstdcxx-pch --enable-version-specific-runtime-libs --disable-bootstrap --disable-lto-plugin

$ make BOOT_CFLAGS="-O2 -D__USE_MINGW_ACCESS" CFLAGS="-O2 -D__USE_MINGW_ACCESS" CXXFLAGS="-mthreads -O2" LDFLAGS="-s" 2>err.log 1>out.log

$ make DESTDIR=/develop/sandpit/dw2 install

GCC 4.5.0と4.6.0のconfigureオプションの違いは、以下の2つを追加している点です。
--enable-lto
--disable-lto-plugin

--with-arch=i686 --with-tune=generic
のところは、ご自分の環境に合わせて、
--with-arch=core2 --with-tune=core2
とか、
--with-arch=athlon64 --with-tune=athlon64
などとすると良いかもしれません。

参考までに、ビルドスクリプトをこちらに置いておきます。
gcc-4.6-20110122-build-dw2-generic.sh


試しにffmpeg一式コンパイルし直してみたのですが、なぜかwmaのデコードでffmpegがクラッシュします。
ffmpegのmake testでも、wmaの所でエラーになりました。
wma以外は、正常に動作するようです。

とりあえず色々試してみたい方は、ご参考にどうぞ。

2011/02/02 追記
ffmpeg Git rev.27479 770c410
Fix ff_imdct_calc_sse() on gcc-4.6
で修正されて、クラッシュしなくなりました。
gcc 4.6が正式リリースされたら採用しようと思います。


【補足】
GCC 4.6.0のビルドでつまずいた点を、参考までに残しておきます。

1. liblto_plugin.la のエラー
.libs/lto-plugin.o:lto-plugin.c:(.text+0x1a8): undefined reference to `xmalloc'
... (中略)
.libs/lto-plugin.o:lto-plugin.c:(.text+0xf0): undefined reference to `htab_hash_string'
collect2: ld returned 1 exit status
make[2]: *** [liblto_plugin.la] Error 1
make[1]: *** [all-lto-plugin] Error 2

lto-pluginのsharedライブラリでコケているっぽい?
--disable-shared にしたかったのですが、個別には指定できず、全部disableになります。

lto-pluginが無くてもltoは使えるので、
--disable-lto-plugin
としました。
posted by あべちん at 15:11 | Comment(0) | TrackBack(0) | GCC自前ビルド
この記事へのコメント
コメントを書く
お名前:

メールアドレス:

ホームページアドレス:

コメント:

認証コード: [必須入力]


※画像の中の文字を半角で入力してください。
この記事へのトラックバックURL
http://blog.sakura.ne.jp/tb/42926105
※言及リンクのないトラックバックは受信されません。

この記事へのトラックバック