Bug #9436

r44670以降Solaris10でthread_pthread.cがコンパイルエラー

Added by Naohisa Goto about 1 year ago. Updated about 1 year ago.

[ruby-dev:47911]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 2.2.0dev (2014-01-21) [sparc64-solaris2.10] Backport:1.9.3: DONTNEED, 2.0.0: DONTNEED, 2.1: DONTNEED

Description

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 では使うことができずコンパイルエラーになります。


Related issues

Related to Ruby trunk - Bug #7247: r37079以降Solaris10でthread_pthread.cがコンパイルエラー Closed 10/31/2012
Related to Ruby trunk - Bug #8783: ruby 1.9/2.0 crash on exit on FreeBSD/powerpc64 Closed 08/13/2013

Associated revisions

Revision 44675
Added by Nobuyoshi Nakada about 1 year ago

thread_pthread.c: fix for dynamic PTHREAD_STACK_MIN

  • thread_pthread.c (rb_thread_create_timer_thread): fix for platforms where PTHREAD_STACK_MIN is a dynamic value and not a compile-time constant. [Bug #9436]

Revision 44675
Added by Nobuyoshi Nakada about 1 year ago

thread_pthread.c: fix for dynamic PTHREAD_STACK_MIN

  • thread_pthread.c (rb_thread_create_timer_thread): fix for platforms where PTHREAD_STACK_MIN is a dynamic value and not a compile-time constant. [Bug #9436]

History

#1 Updated by Naohisa Goto about 1 year ago

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

#2 Updated by Nobuyoshi Nakada about 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r44675.


thread_pthread.c: fix for dynamic PTHREAD_STACK_MIN

  • thread_pthread.c (rb_thread_create_timer_thread): fix for platforms where PTHREAD_STACK_MIN is a dynamic value and not a compile-time constant. [Bug #9436]

#3 Updated by Usaku NAKAMURA about 1 year ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: DONTNEED, 2.1: DONTNEED

#4 Updated by Usaku NAKAMURA about 1 year ago

  • Related to Bug #8783: ruby 1.9/2.0 crash on exit on FreeBSD/powerpc64 added

Also available in: Atom PDF