diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-04-08 12:47:27 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-04-08 12:47:27 +0900 |
commit | 08324ab9eb97535b5994450186c5048be3c0cd62 (patch) | |
tree | cb0cee4fdf1c024e0e611e70baa9289a16caab70 /tool/leaked-globals | |
parent | a9bfb64153ae0a07d498d0976d335b65515fd1b1 (diff) |
Include `--no-llvm-bc` option in `NM` macro only if usable
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7677
Diffstat (limited to 'tool/leaked-globals')
-rwxr-xr-x | tool/leaked-globals | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tool/leaked-globals b/tool/leaked-globals index 136d96b6ab..e079b0efc5 100755 --- a/tool/leaked-globals +++ b/tool/leaked-globals @@ -19,10 +19,6 @@ config = ARGV.shift count = 0 col = Colorize.new -# nm errors with Rust's LLVM bitcode when Rust uses a newer LLVM version than nm. -# In case we're working with llvm-nm, tell it to not worry about the bitcode. -no_llvm = "--no-llvm-bc" if `#{NM} --version` =~ /llvm/i - config_code = File.read(config) REPLACE = config_code.scan(/\bAC_(?:REPLACE|CHECK)_FUNCS?\((\w+)/).flatten # REPLACE << 'memcmp' if /\bAC_FUNC_MEMCMP\b/ =~ config_code @@ -54,7 +50,7 @@ REPLACE.push("rust_eh_personality") if RUBY_PLATFORM.include?("darwin") print "Checking leaked global symbols..." STDOUT.flush -IO.foreach("|#{NM} #{no_llvm} #{ARGV.join(' ')}") do |line| +IO.foreach("|#{NM} #{ARGV.join(' ')}") do |line| n, t, = line.split next unless /[A-TV-Z]/ =~ t next unless n.sub!(/^#{SYMBOL_PREFIX}/o, "") |