From: "kanemoto (Yutaka Kanemoto)" Date: 2013-07-16T23:43:08+09:00 Subject: [ruby-dev:47512] [ruby-trunk - misc #8646][Open] Can't compile ruby on AIX using gcc if a function name has $. Issue #8646 has been reported by kanemoto (Yutaka Kanemoto). ---------------------------------------- misc #8646: Can't compile ruby on AIX using gcc if a function name has $. https://bugs.ruby-lang.org/issues/8646 Author: kanemoto (Yutaka Kanemoto) Status: Open Priority: Normal Assignee: nobu (Nobuyoshi Nakada) Category: build Target version: current: 2.1.0 r41273で追加されたSafe Levelのチェックの部分で関数名に $ が使われているのですが、AIXのgccでエラーになってしまいます。 % make (中略) compiling ../trunk/main.c In file included from ../trunk/include/ruby.h:33:0, from ../trunk/main.c:13: ../trunk/include/ruby/ruby.h:570:1: error: stray '$' in program int ruby$safe_level$4(void) __attribute__((error("$SAFE=4 is obsolete"))); ^ ../trunk/include/ruby/ruby.h:570:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'safe_level' int ruby$safe_level$4(void) __attribute__((error("$SAFE=4 is obsolete"))); ^ ../trunk/include/ruby/ruby.h:570:10: error: stray '$' in program make: *** [main.o] Error 1 ここをみると、 http://gcc.gnu.org/onlinedocs/gcc/Interoperation.html 最後の行に説明があります。 実際最近のバージョンのgccだと-fdollars-in-identifiersを使うとエラーがなくなるのですが、 先日いくつかAIXに関する報告をしてくれた方(GCCのCompilationFarmを紹介してくれました)に聞いてみると、 If Ruby starts using it in general, there would be problems on AIX and it would be a bad portability decision by Ruby community. とのことです。というわけで、2箇所ある ruby$safe_level$4 の $ (合計4つ)を _ あたりに変更させていただいてもよろしいでしょうか? もしそれでよければこちらでコミットしますのでご一報下さい。 よろしくお願いいたします。 -- http://bugs.ruby-lang.org/