Skip to content
  • Alan Wu's avatar
    7d4395cb
    YJIT: Fix shared/static library symbol leaks · 7d4395cb
    Alan Wu authored
    
    
    Rust 1.58.0 unfortunately doesn't provide facilities to control symbol
    visibility/presence, but we care about controlling the list of
    symbols exported from libruby-static.a and libruby.so.
    
    This commit uses `ld -r` to make a single object out of rustc's
    staticlib output, libyjit.a. This moves libyjit.a out of MAINLIBS and adds
    libyjit.o into COMMONOBJS, which obviates the code for merging libyjit.a
    into libruby-static.a. The odd appearance of libyjit.a in SOLIBS is also
    gone.
    
    To filter out symbols we do not want to export on ELF platforms, we use
    objcopy after the partial link. On darwin, we supply a symbol list to
    the linker which takes care of hiding unprefixed symbols.
    
    [Bug #19255]
    
    Co-authored-by: default avatarNobuyoshi Nakada <nobu@ruby-lang.org>
    7d4395cb
    YJIT: Fix shared/static library symbol leaks
    Alan Wu authored
    
    
    Rust 1.58.0 unfortunately doesn't provide facilities to control symbol
    visibility/presence, but we care about controlling the list of
    symbols exported from libruby-static.a and libruby.so.
    
    This commit uses `ld -r` to make a single object out of rustc's
    staticlib output, libyjit.a. This moves libyjit.a out of MAINLIBS and adds
    libyjit.o into COMMONOBJS, which obviates the code for merging libyjit.a
    into libruby-static.a. The odd appearance of libyjit.a in SOLIBS is also
    gone.
    
    To filter out symbols we do not want to export on ELF platforms, we use
    objcopy after the partial link. On darwin, we supply a symbol list to
    the linker which takes care of hiding unprefixed symbols.
    
    [Bug #19255]
    
    Co-authored-by: default avatarNobuyoshi Nakada <nobu@ruby-lang.org>
Loading