NetBSD Problem Report #60763

From zakinko@snowrabbit.org  Tue Sep 22 08:40:03 2026
Return-Path: <zakinko@snowrabbit.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 21BE41A923B
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 22 Sep 2026 08:40:03 +0000 (UTC)
Message-Id: <20260922084000.3CDEDC92AC@bambi.snowrabbit.org>
Date: Tue, 22 Sep 2026 17:40:00 +0900 (JST)
From: zakinko@snowrabbit.org
Reply-To: zakinko@snowrabbit.org
To: gnats-bugs@NetBSD.org
Cc: zakinko@snowrabbit.org
Subject: lang/ruby34: does not link with the ruby-rjit option on NetBSD (rjit_c.o missing from DTRACE_DEPENDENT_OBJS)
X-Send-Pr-Version: 3.95
X-From4GNATS: "zakinko@snowrabbit.org via gnats" <gnats-admin@NetBSD.org>

>Number:         60763
>Category:       pkg
>Synopsis:       lang/ruby34: does not link with the ruby-rjit option on NetBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    taca
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 22 08:45:00 +0000 2026
>Closed-Date:    
>Last-Modified:  Tue Sep 22 09:35:01 +0000 2026
>Originator:     Showta Ishizaki
>Release:        NetBSD 11.0, pkgsrc trunk as of 2026-09-22
>Organization:
>Environment:
System: NetBSD 11.0 amd64
Architecture: x86_64
Machine: amd64
>Description:
	With PKG_OPTIONS.ruby34=ruby-rjit (instead of the default
	ruby-yjit), ruby34-3.4.10nb2 stops while linking miniruby:

	  ld: rjit_c.o: relocation R_X86_64_PLT32 against absolute symbol
	  `__dtraceenabled_ruby___cmethod__return' in section `.text' is disallowed

	rjit_c.c calls RUBY_DTRACE_CMETHOD_RETURN_HOOK, but rjit_c.o is
	not in DTRACE_DEPENDENT_OBJS in template/Makefile.in.  On NetBSD
	configure picks "dtrace needs post processing... rebuild", so
	"dtrace -G" rewrites only the objects in that list; rjit_c.o
	keeps the absolute placeholder symbols and ld refuses them.

	The default yjit build is not affected: rjit_c.c is compiled
	under #if USE_RJIT and is empty there.  Upstream fixed the same
	thing for yjit.o in 2022 (https://bugs.ruby-lang.org/issues/18480)
	and rjit_c.o was left out.  The ruby_3_4 branch still has it;
	master no longer has rjit_c.c, so this is a 3.4-only patch.

	The change is one line in the existing
	patches/patch-template_Makefile.in; the other two hunks are
	unchanged, only their offsets moved because the file was
	regenerated against 3.4.10.  I rebuilt with ruby-rjit
	on NetBSD 11.0/amd64: "processing probes in object files" runs,
	miniruby links, and

	  $ ruby34 -e 'puts RubyVM.const_defined?(:RJIT)'
	  true

>How-To-Repeat:
	  # cd /usr/pkgsrc/lang/ruby34
	  # make PKG_OPTIONS.ruby34=ruby-rjit build

	Fails at "linking miniruby" with the ld message above.

>Fix:
	patch -p0 from the top of pkgsrc.

	diff -ruN -x CVS -x work /usr/pkgsrc/lang/ruby34/Makefile lang/ruby34/Makefile
	--- /usr/pkgsrc/lang/ruby34/Makefile	2026-09-18 05:47:20.827063127 +0000
	+++ lang/ruby34/Makefile	2026-09-22 06:46:11.364176907 +0000
	@@ -2,7 +2,7 @@

	 DISTNAME=	${RUBY_DISTNAME}
	 PKGNAME=	${RUBY_PKGPREFIX}-${RUBY_VERSION}
	-PKGREVISION=	2
	+PKGREVISION=	3
	 CATEGORIES=	lang ruby
	 MASTER_SITES=	${MASTER_SITE_RUBY}

	diff -ruN -x CVS -x work /usr/pkgsrc/lang/ruby34/distinfo lang/ruby34/distinfo
	--- /usr/pkgsrc/lang/ruby34/distinfo	2026-09-18 05:47:20.831730759 +0000
	+++ lang/ruby34/distinfo	2026-09-22 06:46:11.686227894 +0000
	@@ -19,7 +19,7 @@
	 SHA1 (patch-lib_rubygems_installer.rb) = 4ef74b4f79837a929e81bcd0e7eba9061a442304
	 SHA1 (patch-lib_rubygems_platform.rb) = bde36a8fc1ba2fbf4d6fb8829bc116fb4d09b404
	 SHA1 (patch-lib_rubygems_specification.rb) = a3154185ef89fb33e699dd54b19a8e274f3275e0
	-SHA1 (patch-template_Makefile.in) = 3cf5d612ef725dc64d6a90d377b191a29ebfdf17
	+SHA1 (patch-template_Makefile.in) = 6138ccea7ac17dbb31a70d123700350154ffc503
	 SHA1 (patch-test_rubygems_test__gem.rb) = 32f7c7d7f8a024c045d78c2bce93944fc3113d04
	 SHA1 (patch-thread__pthread.c) = 7c1231933a2d6ce9d56891ab512371841697fbca
	 SHA1 (patch-tool_ifchange) = 1803bb6a1836e232dcabcf38f11c9881dbf726ea
	diff -ruN -x CVS -x work /usr/pkgsrc/lang/ruby34/patches/patch-template_Makefile.in lang/ruby34/patches/patch-template_Makefile.in
	--- /usr/pkgsrc/lang/ruby34/patches/patch-template_Makefile.in	2026-09-06 15:13:58.000000000 +0000
	+++ lang/ruby34/patches/patch-template_Makefile.in	2026-09-22 06:46:11.359395014 +0000
	@@ -8,9 +8,27 @@

	 https://bugs.ruby-lang.org/issues/22059

	+rjit_c.c has a DTrace hook (RUBY_DTRACE_CMETHOD_RETURN_HOOK) but its
	+object was not in DTRACE_DEPENDENT_OBJS, so on a DTRACE_REBUILD=yes
	+system such as NetBSD "dtrace -G" never processed it and linking
	+miniruby failed with --enable-rjit:
	+
	+  ld: rjit_c.o: relocation R_X86_64_PLT32 against absolute symbol
	+  `__dtraceenabled_ruby___cmethod__return' in section `.text' is disallowed
	+
	+Same fix as upstream made for yjit.o (https://bugs.ruby-lang.org/issues/18480).
	+
	 --- template/Makefile.in.orig	2026-05-07 20:25:14.644318083 +0000
	 +++ template/Makefile.in
	-@@ -523,7 +523,7 @@ probes.stamp: $(DTRACE_REBUILD_OBJS)
	+@@ -203,6 +203,7 @@
	+ 			string.$(OBJEXT) \
	+ 			symbol.$(OBJEXT) \
	+ 			vm.$(OBJEXT) \
	++			rjit_c.$(OBJEXT) \
	+ 			$(YJIT_OBJ)
	+ 
	+ THREAD_MODEL  = @THREAD_MODEL@
	+@@ -513,7 +514,7 @@

	  probes.stamp: $(DTRACE_REBUILD_OBJS)
	  	$(Q) if test -f $@ -o -f probes.$(OBJEXT); then \
	@@ -19,7 +37,7 @@
	  	  $(ECHO0) "rebuilding objects which were modified by \"dtrace -G\""; \
	  	  $(MAKE) $(DTRACE_REBUILD_OBJS); \
	  	fi
	-@@ -537,7 +537,7 @@ probes.$(OBJEXT): $(srcdir)/probes.d $(DTRACE_REBUILD:
	+@@ -527,7 +528,7 @@

	  # DTrace static library hacks described here:
	  # https://marc.info/?l=opensolaris-dtrace-discuss&m=114761203110734&w=4

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->taca
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Tue, 22 Sep 2026 08:51:08 +0000
Responsible-Changed-Why:
Over to maintainer


State-Changed-From-To: open->feedback
State-Changed-By: taca@NetBSD.org
State-Changed-When: Tue, 22 Sep 2026 09:30:50 +0000
State-Changed-Why:
Patch is applied except PKGREVISION bump.



From: "Takahiro Kambe" <taca@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60763 CVS commit: pkgsrc/lang/ruby34
Date: Tue, 22 Sep 2026 09:29:37 +0000

 Module Name:	pkgsrc
 Committed By:	taca
 Date:		Tue Sep 22 09:29:37 UTC 2026

 Modified Files:
 	pkgsrc/lang/ruby34: distinfo
 	pkgsrc/lang/ruby34/patches: patch-template_Makefile.in

 Log Message:
 lang/ruby34: Fix ruby-rjit option

 Fix build problem with ruby-rjit PKG_OPTIONS provided by PR pkg/60763.

 No PKGREVISION bump since it is simply build problem.


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.19 pkgsrc/lang/ruby34/distinfo
 cvs rdiff -u -r1.1 -r1.2 \
     pkgsrc/lang/ruby34/patches/patch-template_Makefile.in

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.