summaryrefslogtreecommitdiff
path: root/tool/update-deps
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-01-18 15:58:35 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2023-01-27 12:28:09 -0500
commit7d4395cb690c4b6be41bc51b25a8a5cda6210a81 (patch)
treeb09030cd55b1534f68ae09470c59ab6bbd273839 /tool/update-deps
parente7e48e8a667614c8264993c746ad84b92de997fd (diff)
downloadruby-7d4395cb690c4b6be41bc51b25a8a5cda6210a81.tar.gz
YJIT: Fix shared/static library symbol leaks
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: Nobuyoshi Nakada <nobu@ruby-lang.org>
Diffstat (limited to 'tool/update-deps')
-rwxr-xr-xtool/update-deps1
1 files changed, 1 insertions, 0 deletions
diff --git a/tool/update-deps b/tool/update-deps
index 445f9a00e3..fcd7373dbd 100755
--- a/tool/update-deps
+++ b/tool/update-deps
@@ -301,6 +301,7 @@ def read_make_deps(cwd)
deps = deps.scan(%r{[/0-9a-zA-Z._-]+})
deps.delete_if {|dep| /\.time\z/ =~ dep} # skip timestamp
next if /\.o\z/ !~ target.to_s
+ next if /libyjit.o\z/ =~ target.to_s # skip YJIT Rust object (no corresponding C source)
next if /\.bundle\// =~ target.to_s
next if /\A\./ =~ target.to_s # skip rules such as ".c.o"
#p [curdir, target, deps]