金本と申します。

2009/8/9 Yugui <yugui / yugui.jp>:
> Redmine管理用プロジェクトに報告されてしまったので転送します。

AIXでruby 1.9 を使う時の話がいくつかあがっているのですが、
とりあえず最初に見つけたこれに調べたことを報告させていただきます。

rubyのコードの中で、dln.cにAIX固有のコードがあります。
おそらくですが、昔のAIXでdlopenがうまく動かなかったか、なかったときのものと思います。
1.9では#1914,#2063,#2064のようなことがおきる一因になっています。

というところで提案なのですが、このAIX固有のコードではなく、ほかのPlatformのように
dlopenを使うように変更するというのはいかがでしょうか??
最近のAIX(とりあえず5.2と5.3)では添付のパッチでmake testはパスしました。

ほかにも課題はたくさんあるのですが、このパッチで上述の三つの問題は、
とりあえず手元では解決します。

nmでエクスポートする関数を列挙したファイルをつくってリンク時に使用することを止めて、
-bexpallというオプションを代わりに利用したりしてあります。#1914や#2064に対応できます。
ほかのPlatformへの影響はないように気をつけたつもりです。
1.9.1p243とtrunkへのパッチです。

ただ、要するに昔のAIX用のコードがなくなることがどう古いAIXに影響するか
わかりません。コードを生かせるようにしようと思ったのですが、
古い情報が手に入らなかったのと、手に入っても試す環境がないので、
あきらめてしまいました。

いかがでしょうか?

-- 
Yutaka KANEMOTO
http://d.hatena.ne.jp/kinpoco/
SW5kZXg6IGNvbmZpZ3VyZS5pbgo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBjb25maWd1cmUuaW4JKHJldmlzaW9u
IDI0Nzk4KQorKysgY29uZmlndXJlLmluCSh3b3JraW5nIGNvcHkpCkBAIC0xNzQ0LDEwICsxNzQ0
LDcgQEAKIAkJCSAgICA6ICR7TERTSEFSRUQ9JyQoQ0MpJ30KIAkJCWZpCiAJCQlMRFNIQVJFRD0i
JExEU0hBUkVEICR7bGlua2VyX2ZsYWd9LUciCi0JCQlETERGTEFHUz0nLWVJbml0XyQoVEFSR0VU
KScKLQkJCVhMREZMQUdTPSIke2xpbmtlcl9mbGFnfS1iR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