On 01/03 06:12, Jeremie Courreges-Anglas wrote:
> On Sun, Jan 03 2021, Jeremy Evans <jeremy@openbsd.org> wrote:
> > On 01/03 05:26, Jeremie Courreges-Anglas wrote:
> >> On Fri, Dec 25 2020, Jeremy Evans <jeremy@openbsd.org> wrote:
> >> > Here's a port for the recently released Ruby 3.0.0.
> >> >
> >> > Release notes at:
> >> > http://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/
> >> >
> >> > Tested on amd64. OKs to import?
> >>
> >> sparc64 strikes again!
> >> ruby now tries to use __thread, which fails with our base-gcc:
> >>
> >> --8<--
> >> In file included from vm_core.h:85,
> >> from eval_intern.h:5,
> >> from vm_trace.c:24:
> >> thread_pthread.h: At top level:
> >> thread_pthread.h:108: error: thread-local storage not supported for this target
> >> In file included from ./include/ruby/internal/arithmetic/char.h:23,
> >> from ./include/ruby/internal/arithmetic.h:23,
> >> from ./include/ruby/ruby.h:25,
> >> from gc.h:3,
> >> from vm_dump.c:32:
> >> ./include/ruby/internal/arithmetic/int.h: In function 'rb_int2num_inline':
> >> ./include/ruby/internal/arithmetic/int.h:146: warning: comparison is always true due to limited range of data type
> >> ./include/ruby/internal/arithmetic/int.h:146: warning: comparison is always true due to limited range of data type
> >> ./include/ruby/internal/arithmetic/int.h: In function 'rb_uint2num_inline':
> >> ./include/ruby/internal/arithmetic/int.h:155: warning: comparison is always true due to limited range of data type
> >> In file included from vm_core.h:85,
> >> from vm_sync.c:1:
> >> thread_pthread.h: At top level:
> >> thread_pthread.h:108: error: thread-local storage not supported for this target
> >> In file included from vm_core.h:85,
> >> from iseq.h:14,
> >> from vm_dump.c:36:
> >> thread_pthread.h: At top level:
> >> thread_pthread.h:108: error: thread-local storage not supported for this target
> >> *** Error 1 in /usr/ports/pobj/ruby-3.0.0/ruby-3.0.0 (Makefile:425 'vm_dump.o')
> >> *** Error 1 (Makefile:425 'vm_sync.o')
> >> *** Error 1 (Makefile:425 'vm_trace.o')
> >> *** Error 1 in target 'vm_trace.o'
> >> *** Error 1 in target 'vm_sync.o'
> >> *** Error 1 in target 'vm_dump.o'
> >> *** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2925 '/usr/ports/pobj/ruby-3.0.0/.build_done': @cd /usr/ports/pobj/ruby-3.0.0/rub...)
> >> *** Error 2 in /usr/ports/lang/ruby/3.0 (/usr/ports/infrastructure/mk/bsd.port.mk:2584 'all': @lock=ruby-3.0.0; export _LOCKS_HELD=" ruby-3...)
> >> billy /usr/ports/lang/ruby/3.0$
> >> -->8--
> >>
> >> The attached tarball contains a patch to use the no-__thread fallback,
> >> so that we can keep using base-gcc. With this, ruby30 packages on
> >> sparc64. ports-gcc supports __thread emulation (like base-clang), but
> >> then I'm not sure which compiler MJIT should use.
> >>
> >> The diff between configure log of 2.7 and 3.0 seems sane, except maybe
> >> for
> >>
> >> -checking whether -D_FORTIFY_SOURCE=2 is accepted as CFLAGS... yes
> >> +checking whether -O3 -D_FORTIFY_SOURCE=2 is accepted as CFLAGS... yes
> >>
> >> Maybe not a new problem, configure log for 2.7 already shows
> >>
> >> * optflags: -O3
> >>
> >> I would suggest importing this and fixing problems as they come, but
> >> I'm far from a ruby expert.
> >
> > jca,
> >
> > I imported ruby 3.0 already, can you send a diff?
>
> d'oh! I had started testing it after the import. :-/
>
> Here's the diff, it should only affect base-gcc where ruby-3.0 doesn't
> build. ok?
OK jeremy@
>
>
> Index: patches/patch-thread_pthread_h
> ===================================================================
> RCS file: patches/patch-thread_pthread_h
> diff -N patches/patch-thread_pthread_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-thread_pthread_h 3 Jan 2021 15:11:15 -0000
> @@ -0,0 +1,16 @@
> +$OpenBSD$
> +
> +base-gcc doesn't support __thread
> +
> +Index: thread_pthread.h
> +--- thread_pthread.h.orig
> ++++ thread_pthread.h
> +@@ -72,7 +72,7 @@ typedef struct rb_global_vm_lock_struct {
> +
> + #if __STDC_VERSION__ >= 201112
> + #define RB_THREAD_LOCAL_SPECIFIER _Thread_local
> +-#elif defined(__GNUC__)
> ++#elif defined(__clang__)
> + /* note that ICC (linux) and Clang are covered by __GNUC__ */
> + #define RB_THREAD_LOCAL_SPECIFIER __thread
> + #else
>
>
> --
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
No comments:
Post a Comment