tl;dr
--If you want to know the option when configuring cruby, see RbConfig :: CONFIG ["configure_args "]
.
$ uname -mrv
4.15.0-124-generic #127-Ubuntu SMP Fri Nov 6 10:54:43 UTC 2020 x86_64
$ cat /etc/issue
Ubuntu 18.04.5 LTS \n \l
$ rbenv --version
rbenv 1.1.2-34-g0843745
$ ruby -v
ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-linux]
I was told if I used dpkg-shlibdeps with the binary I put in rbenv.
$ pwd
/home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/bin
$ mkdir debian;touch debian/control
$ dpkg-shlibdeps -v -v ruby
dpkg-shlibdeps: debug: >> Scanning ruby (for Depends field)
dpkg-shlibdeps: debug: Library libruby.so.2.5 found in /home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib/libruby.so.2.5
dpkg-shlibdeps: debug: Skipping lib /lib/i386-linux-gnu/libc.so.6, libabi=0x0101000300000000 != objabi=0x0201003e00000000
dpkg-shlibdeps: debug: Skipping lib /lib32/libc.so.6, libabi=0x0101000300000000 != objabi=0x0201003e00000000
dpkg-shlibdeps: debug: Skipping lib /libx32/libc.so.6, libabi=0x0101003e00000000 != objabi=0x0201003e00000000
dpkg-shlibdeps: debug: Skipping lib /lib32/libc.so.6, libabi=0x0101000300000000 != objabi=0x0201003e00000000
dpkg-shlibdeps: debug: Library libc.so.6 found in /lib/x86_64-linux-gnu/libc.so.6
dpkg-shlibdeps: debug: No associated package found for /home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib/libruby.so.2.5
dpkg-shlibdeps: debug: Using shlibs+objdump for libruby.so.2.5 (file /home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib/libruby.so.2.5)
dpkg-shlibdeps: debug: Looking up shlibs dependency of libruby.so.2.5 provided by ''
dpkg-shlibdeps: debug: Found nothing
dpkg-shlibdeps: debug: No shlibs+objdump info available, trying next package for /home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib/libruby.so.2.5
dpkg-shlibdeps: error: no dependency information found for /home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib/libruby.so.2.5 (used by ruby)
Hint: check if the library actually comes from a package.
Hmm? When I look at ldd, I find a link called libruby.so. This doesn't seem to be the one I built myself.
$ ldd ruby
linux-vdso.so.1 (0x00007fff7c5be000)
libgtk3-nocsd.so.0 => /usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0 (0x00007f27f31ad000)
libruby.so.2.5 => /home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib/libruby.so.2.5 (0x00007f27f2c79000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f27f2888000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f27f2684000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f27f2465000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f27f21e4000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f27f1fac000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f27f1c0e000)
/lib64/ld-linux-x86-64.so.2 (0x00007f27f35b6000)
If you want to know the argument of configure for the time being, you can use RbConfig :: CONFIG
.
$ irb
irb(main):001:0> RbConfig::CONFIG["configure_args"]
=> " '--prefix=/home/kubo39/.anyenv/envs/rbenv/versions/2.5.8' '--enable-shared' 'LDFLAGS=-L/home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib ' 'CPPFLAGS=-I/home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/include '"
The option --enable-shared
is like that.
--enable-shared
by default for all supported MRI Rubies - rbenv/ruby-buildI see.
The word is not good because there is such a thing at the time of build.
irb(main):002:0> RbConfig::CONFIG["CXXFLAGS"]
=> "-O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict"
irb(main):003:0> RbConfig::CONFIG["CFLAGS"]
=> "-O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict -fPIC"
irb(main):004:0> RbConfig::CONFIG["LDFLAGS"]
=> "-L. -L/home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib -fstack-protector -rdynamic -Wl,-export-dynamic"
I don't know why, but the one I put in with rbenv doesn't have the Makefile configured, let alone the source code (I think I'm building from the source, so I'm erasing it. Capacity reduction?) Instead, take a look at the one you built yourself.
$ ./configure --help| grep enable-shared
--enable-shared build a shared library for Ruby
Well, that's right, but why does the ruby binary itself depend on it? I think it's for the C extension library, but I didn't understand.
Recommended Posts