FreeBSD+Firefox 3.6

portsが/usr/ports/www/firefox35となっているのでFreeBSD版のFirefoxは3.5が最新なのかと思ったら,/usr/ports/www/firefoxが実は3.6になっている模様.
そこで/usr/ports/www/firefoxでmakeすると,次のようなエラーが.

nsHTMLFrameSetElement.cpp: In member function 'nsresult nsHTMLFrameSetElement::ParseRowCol(const nsAString_internal&, PRInt32&, nsFramesetSpec**)':
nsHTMLFrameSetElement.cpp:326: error: 'PR_STATIC_ASSERT' was not declared in this scope
gmake[6]: *** [nsHTMLFrameSetElement.o] Error 1 

検索すると次のような書き込みを発見.

------- Comment #5 From J?n Bedn?r 2010-09-08 10:59:16 0000 -------

It should compile just fine when you add
 #include "prlog.h"
into "${WORKDIR}/${P}/content/html/content/src/nsHTMLFrameSetElement.cpp"

Sorry I don't have time for creating patched ebuild or so. 

そこで/usr/ports/www/firefox/work/mozilla-1.9.2/content/html/content/src/nsHTMLFrameSetElement.cppをエディタで無理やり最初の方を書き換え.

#include "nsIDOMHTMLFrameSetElement.h"
#include "nsIDOMEventTarget.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsPresContext.h"
#include "nsIFrameSetElement.h"
#include "nsIHTMLDocument.h"
#include "nsIDocument.h"

#include "prlog.h"  // <- added

残念ながらまだエラーが.

cd FreeBSD8.0_OPT.OBJ ; sh "/usr/ports/www/firefox/work/mozilla-1.9.2/security/nss/cmd/shlibsign/."/sign.sh "/usr/ports/www/firefox/work/mozilla-1.9.2/dist" \
"/usr/ports/www/firefox/work/mozilla-1.9.2/security/nss/cmd/shlibsign/FreeBSD8.0_OPT.OBJ" FreeBSD \
        "/usr/local/lib" "/usr/ports/www/firefox/work/mozilla-1.9.2/dist/lib/libsoftokn3.so"
/usr/ports/www/firefox/work/mozilla-1.9.2/security/nss/cmd/shlibsign/FreeBSD8.0_OPT.OBJ/shlibsign -v -i /usr/ports/www/firefox/work/mozilla-1.9.2/dist/lib/libsoftokn3.so
/libexec/ld-elf.so.1: /usr/ports/www/firefox/work/mozilla-1.9.2/dist/lib/libnssutil3.so: Undefined symbol "PL_ClearArenaPool"
gmake[4]: *** [/usr/ports/www/firefox/work/mozilla-1.9.2/dist/lib/libsoftokn3.chk] Error 1 

この「PL_ClearArenaPool」ってのが何かと思って探してみると,

# find . -type f -name '*.so' | xargs nm -AD | grep PL_ClearArenaPool
./work/mozilla-1.9.2/security/nss/lib/util/FreeBSD8.0_OPT.OBJ/libnssutil3.so:
         U PL_ClearArenaPool

確かにlibnssutil3から呼ばれているようです.
さらに調べると

Updating nspr to the latest version and then building nss again fixed this. 

という書き込みが.そこでnsprライブラリを確認すると

# pkg_version -v -s nspr
nspr-4.8                            <   needs updating (port has 4.8.6)

あーバージョンが古いっぽい...バージョンアップ.

# cd /usr/ports/devel/nspr/
# make; make deinstall; make reinstall 

改めて/usr/ports/www/firefoxでmake;make installするとOk.


おっしゃぁぁぁぁ!

ってか,あれ...

Firefoxブラウザ 3.6.11のXULRunnerライブラリにリモートから任意のコードが実行可能な脆弱性が見つかる

もうFirefox 3.6.12が出た...