ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:119444] [Ruby master Bug#20783] --enable-shared and the rpath/runpath are broken on Linux on CRuby master
@ 2024-10-04  9:20 Eregon (Benoit Daloze) via ruby-core
  2024-10-04  9:40 ` [ruby-core:119445] " Eregon (Benoit Daloze) via ruby-core
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2024-10-04  9:20 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #20783 has been reported by Eregon (Benoit Daloze).

----------------------------------------
Bug #20783: --enable-shared and the rpath/runpath are broken on Linux on CRuby master
https://bugs.ruby-lang.org/issues/20783

* Author: Eregon (Benoit Daloze)
* Status: Open
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
https://github.com/ruby/ruby-dev-builder/actions/runs/11095200420
```
$ ruby test_files/cli_test.rb
ruby: error while loading shared libraries: libruby.so.3.4: cannot open shared object file: No such file or directory
```

And indeed locally I can confirm it's broken (I use ruby-build for convenience, as you can see it just does a bunch of regular build commands):
```
$ RUBY_CONFIGURE_OPTS=--enable-shared ruby-build ruby-dev -d ~/.rubies   
==> Cloning https://github.com/ruby/ruby.git...
-> git clone --depth 1 --branch master https://github.com/ruby/ruby.git ruby-master
...
==> Installing ruby-master...
-> autoreconf -i
-> ./configure "--prefix=$HOME/.rubies/ruby-dev" --enable-shared
-> make -j 16
-> make update-gems extract-gems install
==> Installed ruby-master to /home/eregon/.rubies/ruby-dev
```

And that build with `--enable-shared` is not working, same as on GitHub Actions:
```
$ ldd /home/eregon/.rubies/ruby-dev/bin/ruby
	linux-vdso.so.1 (0x00007fff9018c000)
	libruby.so.3.4 => not found
	libz.so.1 => /lib64/libz.so.1 (0x00007f4c8d928000)
	libcrypt.so.2 => /lib64/libcrypt.so.2 (0x00007f4c8d8ef000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f4c8d80e000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f4c8d62c000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f4c8d95e000)

$ readelf -d /home/eregon/.rubies/ruby-dev/bin/ruby

Dynamic section at offset 0x2db8 contains 29 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libruby.so.3.4]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypt.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000001d (RUNPATH)            Library runpath: [/home/eregon/.rubies/ruby-dev/lib-L/home/eregon/.rubies/ruby-dev/lib]
...
```

@hsbt said he remembers https://github.com/ruby/ruby/commit/1f6d2e77d9be9a5a829e60908d21d621f4e1ceb0 changed something in this area which might be the cause.

Once this is fixed we should also revert https://github.com/ruby/docker-images/pull/107.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-08  6:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-04  9:20 [ruby-core:119444] [Ruby master Bug#20783] --enable-shared and the rpath/runpath are broken on Linux on CRuby master Eregon (Benoit Daloze) via ruby-core
2024-10-04  9:40 ` [ruby-core:119445] " Eregon (Benoit Daloze) via ruby-core
2024-10-04  9:57 ` [ruby-core:119446] " nobu (Nobuyoshi Nakada) via ruby-core
2024-10-04 10:08 ` [ruby-core:119447] " hsbt (Hiroshi SHIBATA) via ruby-core
2024-10-08  6:50 ` [ruby-core:119480] " hsbt (Hiroshi SHIBATA) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).