Bug #18480
closedDtrace enabled build fails on systems with DTRACE_REBUILD=yes
Description
When building Ruby 3.1 on Solaris, where dtrace requires a recompilation (DTRACE_REBUILD=yes), the compilation fails with the following linking error:
linking miniruby
Undefined first referenced
symbol in file
__dtraceenabled_ruby___cmethod__return yjit.o
__dtrace_ruby___cmethod__return yjit.o
ld: fatal: symbol referencing errors
My guess is that this is because of RUBY_DTRACE_CMETHOD_RETURN_HOOK(ec, me->owner, me->def->original_id);
in yjit_codegen.c and seems to be easily fixed by adding yjit to DTRACE_DEPENDENT_OBJS
:
--- ruby-3.1.0/template/Makefile.in
+++ ruby-3.1.0/template/Makefile.in
@@ -193,7 +193,8 @@ DTRACE_DEPENDENT_OBJS = array.$(OBJEXT)
parse.$(OBJEXT) \
string.$(OBJEXT) \
symbol.$(OBJEXT) \
- vm.$(OBJEXT)
+ vm.$(OBJEXT) \
+ yjit.$(OBJEXT)
THREAD_MODEL = @THREAD_MODEL@
Updated by Kulikjak (Jakub Kulik) over 2 years ago
And PR #5891 addresses this issue.
Updated by Anonymous over 2 years ago
- Status changed from Open to Closed
Applied in changeset git|31bd79dda3d26956976e68ff1c2f8c376c7e9ea5.
Add yjit.o to DTRACE_DEPENDENT_OBJS
In principle, we have a DTrace probe in yjit.c, so yjit.o should be
in DTRACE_DEPENDENT_OBJS for DTRACE_REBUILD=yes builds. This commit
adds to the list.
In practice DTRACE_REBUILD=yes implies the system has a Solaris-like
DTrace and YJIT doesn't support those systems. YJIT_OBJ expands to
nothing, and yjit.c isn't compiled.
I tested on OmniOS v11 r151034m with:
$ ../src/configure --with-out-ext=psych MAKE=gmake AR=ar debugflags=-g
$ gmake -j
It builds before and after this change.
[Bug #18480]