[ruby-dev:47863] [ruby-trunk - misc #8646][Closed] Can't compile ruby on AIX using gcc if a function name has $.
From:
"nobu (Nobuyoshi Nakada)" <nobu@...>
Date:
2013-12-24 16:15:37 UTC
List:
ruby-dev #47863
Issue #8646 has been updated by nobu (Nobuyoshi Nakada).
Status changed from Assigned to Closed
% Done changed from 0 to 100
----------------------------------------
misc #8646: Can't compile ruby on AIX using gcc if a function name has $.
https://bugs.ruby-lang.org/issues/8646#change-43875
Author: kanemoto (Yutaka Kanemoto)
Status: Closed
Priority: Normal
Assignee: kanemoto (Yutaka Kanemoto)
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/