Project

General

Profile

Actions

Misc #19120

closed

How does YJIT work in --enable-shared case?

Added by jaruga (Jun Aruga) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
[ruby-core:110695]

Description

We are trying to add the new YJIT feature that is ported to Rust[1][2] in Ruby 3.2 RPM on Fedora project.[3]
I am trying to understand how the YJIT works in the case the ./configure --enable-yjit --enable-shared. In the case below, when building Ruby on the latest master branch 199b59f065ce6f1c13b8424f35a70c513523211b, the static libraries libruby-static.a and ./libruby-static.a were built.

<mock-chroot> sh-5.2$ cat /etc/fedora-release 
Fedora release 38 (Rawhide)

<mock-chroot> sh-5.2$ ./autogen.sh

<mock-chroot> sh-5.2$ ./configure --prefix=$HOME/local/ruby-yjit-199b59f065 --enable-shared --enable-yjit 2>&1 | tee configure.log
...
   * MJIT support:        yes
   * YJIT support:        yes

<mock-chroot> sh-5.2$ make

<mock-chroot> sh-5.2$ find . -name "*.a"
./yjit/target/release/libyjit.a
./libruby-static.a

After running make install, these static libraries (*.a files) were not copied to the installed directory. That makes sense, as Ruby works with shared libraries (*.so files).

<mock-chroot> sh-5.2$ make install 2>&1 | tee make_install.log

<mock-chroot> sh-5.2$ find ~/local/ruby-yjit-199b59f065/ -name "*.a"
=> empty

In this case, we really don't need the libyjit.a to run the YJIT right? I couldn't find the .so file something like yjit.so. Which .so file contains the YJIT feature (maybe the content of the yjit/src/**/*.rs)?

<mock-chroot> sh-5.2$ find ~/local/ruby-yjit-199b59f065/ -name "*.so" | grep yjit.so
=> empty

How can we test the content of the yjit/src/**/*.rs? For example, if the command below works, I can say that I tested the content of the yjit/src/**/*.rs?

<mock-chroot> sh-5.2$ which rustc
/usr/bin/rustc

<mock-chroot> sh-5.2$ rustc --version
rustc 1.65.0 (Fedora 1.65.0-1.fc38)

<mock-chroot> sh-5.2$ ~/local/ruby-yjit-199b59f065/bin/ruby --yjit -e 'puts "abc"'
abc

References

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0