Firefoxのビルドにハマる
FreeBSDのportsからFirefoxを入れようとしたのですが...
c++ -o nsHtml5ElementName.o -c -I../../dist/stl_wrappers -I../../dist/system_wrappers -include ../../config/gcc_hidden.h -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES -DSTATIC_EXPORTABLE_JS_API -DOSTYPE=\"FreeBSD8\" -DOSARCH=FreeBSD -I. -I. -I../../dist/include -I../../dist/include/nsprpub -I/usr/local/include/nspr -I/usr/ports/www/firefox/work/mozilla-release/dist/include/nss -I./../../content/base/src -fPIC -I/usr/local/include -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -O2 -pipe -O2 -fno-strict-aliasing -O2 -ffunction-sections -fdata-sections -fno-strict-aliasing -fshort-wchar -pipe -DNDEBUG -DTRIMMED -O2 -I/usr/local/include -DMOZILLA_CLIENT -include ../../mozilla-config.h /usr/ports/www/firefox/work/mozilla-release/parser/html/nsHtml5ElementName.cpp
In file included from /usr/ports/www/firefox/work/mozilla-release/parser/html/nsHtml5StreamParser.h:54,
from /usr/ports/www/firefox/work/mozilla-release/parser/html/nsHtml5Parser.h:61,
from /usr/ports/www/firefox/work/mozilla-release/parser/html/nsHtml5TreeBuilder.h:46,
from /usr/ports/www/firefox/work/mozilla-release/parser/html/nsHtml5ElementName.cpp:50:
/usr/ports/www/firefox/work/mozilla-release/parser/html/nsHtml5Speculation.h:103:33: warning: no newline at end of file
{standard input}: Assembler messages:
{standard input}:0: Warning: end of file not at end of a line; newline inserted
{standard input}:155: Error: expected comma after name `_ZN18nsHtml5Elemen' in .size directive
c++: Internal error: Killed: 9 (program cc1plus)
Please submit a full bug report.
See url:http://gcc.gnu.org/bugs.html for instructions.
gmake[4]: *** [nsHtml5ElementName.o] Error 1
gmake[4]: Leaving directory `/usr/ports/www/firefox/work/mozilla-release/parser/html'
gmake[3]: *** [libs] Error 2
gmake[3]: Leaving directory `/usr/ports/www/firefox/work/mozilla-release/parser'
gmake[2]: *** [libs_tier_platform] Error 2
gmake[2]: Leaving directory `/usr/ports/www/firefox/work/mozilla-release'
gmake[1]: *** [tier_platform] Error 2
gmake[1]: Leaving directory `/usr/ports/www/firefox/work/mozilla-release'
gmake: *** [default] Error 2
アセンブラがエラーを出しているので,gccのバージョン問題かと思っていろいろ変更してみても変化なし.
数日たって,ログにエラーが出ているのに気づきました.
less /var/log/message
Oct 10 20:54:58 euler kernel: swap_pager: out of swap space
Oct 10 20:54:59 euler kernel: swap_pager_getswapspace(16): failed
Oct 10 20:54:59 euler kernel: pid 46918 (cc1plus), uid 0, was killed: out of swap space
「今時,Swap Outなんてそうそう起こらへんやろ」と思ってswap領域を128Mバイトと非常に小さく取ってみたのが敗因のようでした.
euler# swapinfo -h
Device 1K-blocks Used Avail Capacity
/dev/ad0s2b 131040 79M 49M 62%
下記はシングルユーザモードで実行しないと,X Windowが固まりました...まぁ,全部シングルユーザモードでやるべきなんでしょうねぇ.
# dd if=/dev/zero of=/usr/share/swap0 bs=1024m count=1024
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 40.819270 sec (26304778 bytes/sec)
# chmod 0600 /usr/share swap0
# mdconfig -a -t vnode -f /usr/share/swap0 -u 1
# swapon /dev/md1
次にリブートした時のために.rc.confに次の一行を追加.
swapfile="/usr/share/swap0"
こんな感じに,swap領域を1G取ってmakeすると,無事にビルドが終わりました.
> make > su # make deinstall; make reinstall ====================================================================== ===> Registering installation for firefox-7.0.1,1