Forum: Ruby-dev [ruby-trunk - Bug #7247][Open] r37079以降Solaris10でthread pthread.cがコンパイルエラー

Posted by ngoto (Naohisa Goto) (Guest)
on 2012-10-30 16:53
(Received via mailing list)
Issue #7247 has been reported by ngoto (Naohisa Goto).

----------------------------------------
Bug #7247: r37079以降Solaris10でthread_pthread.cがコンパイルエラー
https://bugs.ruby-lang.org/issues/7247

Author: ngoto (Naohisa Goto)
Status: Open
Priority: Normal
Assignee:
Category:
Target version: 2.0.0
ruby -v: -


r37079以降、Solaris10のccでは以下のエラーが出て失敗します。(以下はr37390にて確認)

 cc -O -xtarget=sparc64viiplus -m64 -DRUBY_EXPORT 
-I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include   -I. 
-I.ext/include/sparc64-solaris2.10 -I./include -I. -o thread.o -c 
thread.c
 "thread_pthread.c", line 600: non-constant enumerator value

thread_pthread.cの600行め付近は以下のようになっています。

 enum {
 (中略)
 #ifdef PTHREAD_STACK_MIN
     RUBY_STACK_MIN = ((RUBY_STACK_MIN_LIMIT < PTHREAD_STACK_MIN) ?
            PTHREAD_STACK_MIN * 2 : RUBY_STACK_MIN_LIMIT),

Solaris10では、PTHREAD_STACK_MIN は /usr/include/limits.h にて以下のように定義されています。
 #define   PTHREAD_STACK_MIN 
((size_t)_sysconf(_SC_THREAD_STACK_MIN))

つまり、PTHREAD_STACK_MINの実体は関数であり、定数ではありません。このため、enumの中に定数ではない数を書いているというコンパイルエラーになりました。
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.