[ruby-dev:47913] [ruby-trunk - Bug #9436] r44670以降Solaris10でthread_pthread.cがコンパイルエラー

From: ngotogenome@...
Date: 2014-01-21 08:54:33 UTC
List: ruby-dev #47913
Issue #9436 has been updated by Naohisa Goto.

Related to Bug #7247: r37079以降Solaris10でthread_pthread.cがコンパイルエラー added

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

* Author: Naohisa Goto
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.2.0dev (2014-01-21) [sparc64-solaris2.10]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
r44670以降、Solaris10のccでは以下のエラーが出て失敗します。(以下はr44673にて確認)

 cc -xO1 -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 1488: missing operator
 cc: acomp failed for thread.c
 make: *** [thread.o] Error 2

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

 #   if TIMER_THREAD_STACK_MIN_SIZE < PTHREAD_STACK_MIN
 #     undef TIMER_THREAD_STACK_MIN_SIZE
 #     define TIMER_THREAD_STACK_MIN_SIZE PTHREAD_STACK_MIN
 #   endif

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

つまり、PTHREAD_STACK_MINの実体は関数であり、定数ではありません。
このため、#if では使うことができずコンパイルエラーになります。





-- 
http://bugs.ruby-lang.org/

In This Thread

Prev Next