[MacPorts] #64906: fixing Ruby for PowerPC

MacPorts noreply at macports.org
Fri Apr 15 23:32:18 UTC 2022


#64906: fixing Ruby for PowerPC
-----------------------------+-------------------------------------------
  Reporter:  barracuda156    |      Owner:  kimuraw
      Type:  defect          |     Status:  closed
  Priority:  Normal          |  Milestone:
 Component:  ports           |    Version:  2.7.2
Resolution:  wontfix         |   Keywords:  powerpc, leopard, snowleopard
      Port:  ruby27, ruby30  |
-----------------------------+-------------------------------------------

Comment (by barracuda156):

 Replying to [comment:2 evanmiller]:
 > When I was tinkering with Ruby on PPC, I ran into some issues with
 coroutines.

 With an earlier Ruby, someone apparently succeeded building it for ppc32
 (though not Darwin in that case) with using `--with-coroutine=copy`:
 http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/98716
 This option is gone in @3.1, however now there is `--with-
 coroutine=pthread`, which logically should also be cpu-agnostic.

 Now, there is one problem with `thread_pthread.c` for Ruby @3.1: there is
 no `pthread_threadid_np` on Tiger and Leopard (and on 10A190 too). Similar
 issue has been solved for Python and Mesa:
 https://trac.macports.org/ticket/59772
 https://trac.macports.org/ticket/34499
 However Ruby case differs somewhat, and I am unsure how to rewrite it
 correctly:

 {{{
 #if defined(RB_THREAD_T_HAS_NATIVE_ID) || defined(__APPLE__)
 static VALUE
 native_thread_native_thread_id(rb_thread_t *target_th)
 {
 #ifdef RB_THREAD_T_HAS_NATIVE_ID
     int tid = target_th->tid;
     if (tid == 0) return Qnil;
     return INT2FIX(tid);
 #elif defined(__APPLE__)
     uint64_t tid;
     int e = pthread_threadid_np(target_th->thread_id, &tid);
     if (e != 0) rb_syserr_fail(e, "pthread_threadid_np");
     return ULL2NUM((unsigned long long)tid);
 #endif
 }
 # define USE_NATIVE_THREAD_NATIVE_THREAD_ID 1
 #else
 # define USE_NATIVE_THREAD_NATIVE_THREAD_ID 0
 #endif
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/64906#comment:13>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list