https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112022-12-23T16:07:01ZRuby Issue Tracking SystemRuby master - Bug #19255: YJIT: global symbol leakagehttps://bugs.ruby-lang.org/issues/19255?journal_id=1007752022-12-23T16:07:01Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>A hack: <a href="https://github.com/nobu/ruby/tree/yjit-symbol-leakage" class="external">https://github.com/nobu/ruby/tree/yjit-symbol-leakage</a></p> Ruby master - Bug #19255: YJIT: global symbol leakagehttps://bugs.ruby-lang.org/issues/19255?journal_id=1011652023-01-10T03:30:12Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>yjit</i></li></ul> Ruby master - Bug #19255: YJIT: global symbol leakagehttps://bugs.ruby-lang.org/issues/19255?journal_id=1015292023-01-27T21:06:49Zalanwu (Alan Wu)
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" title="YJIT: Fix shared/static library symbol leaks Rust 1.58.0 unfortunately doesn't provide facilitie..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/7d4395cb690c4b6be41bc51b25a8a5cda6210a81">git|7d4395cb690c4b6be41bc51b25a8a5cda6210a81</a>.</p>
<hr>
<p>YJIT: Fix shared/static library symbol leaks</p>
<p>Rust 1.58.0 unfortunately doesn't provide facilities to control symbol<br>
visibility/presence, but we care about controlling the list of<br>
symbols exported from libruby-static.a and libruby.so.</p>
<p>This commit uses <code>ld -r</code> to make a single object out of rustc's<br>
staticlib output, libyjit.a. This moves libyjit.a out of MAINLIBS and adds<br>
libyjit.o into COMMONOBJS, which obviates the code for merging libyjit.a<br>
into libruby-static.a. The odd appearance of libyjit.a in SOLIBS is also<br>
gone.</p>
<p>To filter out symbols we do not want to export on ELF platforms, we use<br>
objcopy after the partial link. On darwin, we supply a symbol list to<br>
the linker which takes care of hiding unprefixed symbols.</p>
<p>[Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: YJIT: global symbol leakage (Closed)" href="https://bugs.ruby-lang.org/issues/19255">#19255</a>]</p>
<p>Co-authored-by: Nobuyoshi Nakada <a href="mailto:nobu@ruby-lang.org" class="email">nobu@ruby-lang.org</a></p>