2008-09-01
■Mac OS Leopard 上の apache + mod_perl2 で XS モジュールが動かないときは
[Mon Sep 01 21:00:44 2008] [error] [client 127.0.0.1] failed to resolve handler `MyApp::ModPerl': Can't load '/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Class/MOP/MOP.bundle' for module Class::MOP: dlopen(/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Class/MOP/MOP.bundle, 1): no suitable im
こんなエラーが出ちゃう時はfileコマンドすればわかるんだけど
$ file /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Class/MOP/MOP.bundle /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Class/MOP/MOP.bundle: Mach-O universal binary with 2 architectures /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Class/MOP/MOP.bundle (for architecture i386): Mach-O bundle i386 /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Class/MOP/MOP.bundle (for architecture ppc7400): Mach-O bundle ppc
x86_64なXSバイナリが出来てないせいなんだ。
アクティビティモニタでhttpdを見ればわかるけどhttpdは64bitになってるので、64bit対応なXSが無きゃいけない。
なので
ARCHFLAGS="-arch x86_64 -arch i386 -arch ppc" cpan Class::MOP
などとしてx86_64なのも作るようにする。
i386とppcも残しとかないとperlコマンドの方で動かん無くなる(ppcはいらないかな?)
$ file /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Class/C3/XS/XS.bundle /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Class/C3/XS/XS.bundle: Mach-O universal binary with 3 architectures /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Class/C3/XS/XS.bundle (for architecture x86_64): Mach-O 64-bit bundle x86_64 /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Class/C3/XS/XS.bundle (for architecture i386): Mach-O bundle i386 /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Class/C3/XS/XS.bundle (for architecture ppc7400): Mach-O bundle ppc
x86_64にも対応出来てめでたしめでたし。
トラックバック - http://d.hatena.ne.jp/yappo/20080901/1220270898
リンク元
- 11 http://reader.livedoor.com/reader/
- 5 http://b.hatena.ne.jp/entrylist?sort=hot
- 3 http://b.hatena.ne.jp/entrylist?sort=hot&url=http://d.hatena.ne.jp/
- 3 http://search.yahoo.co.jp/search?p=女子高生のSEX&ei=UTF-8&pstart=1&fr=slv1-crfdrs&b=11&qrw=0
- 2 http://b.hatena.ne.jp/entrylist?sort=hot&of=100&threshold=5
- 2 http://b.hatena.ne.jp/entrylist?sort=hot&of=50&threshold=3
- 2 http://ezsch.ezweb.ne.jp/search/ezGoogleMain.php?query=SHARE優木まおみ&start-index=4&adpage=3&mode=02
- 2 http://search.yahoo.co.jp/search?p=oppai&search.x=1&fr=top_ga1&tid=top_ga1&ei=UTF-8
- 2 http://yappo.irori.org/acchi/ike/http://d.hatena.ne.jp/yappo/20080901/1220270898
- 1 http://anond.hatelabo.jp/20070921194837
