summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-04-02 18:11:59 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-04-02 18:11:59 +0900
commit9e1ff2462b10aed8374374967ae34b284a91bc89 (patch)
tree24f3d0334593079c478ccbb8f24b0ca260d60385 /tool
parent3a683964a0de4f06f535e923f6053bc6294e90b4 (diff)
downloadruby-9e1ff2462b10aed8374374967ae34b284a91bc89.tar.gz
leaked-globals: check for nm before files under missing [ci skip]
Abort if `nm` is not available, since it is needed by configure.ac to check for prefix of external symbols.
Diffstat (limited to 'tool')
-rwxr-xr-xtool/leaked-globals8
1 files changed, 5 insertions, 3 deletions
diff --git a/tool/leaked-globals b/tool/leaked-globals
index c288fff212..136d96b6ab 100755
--- a/tool/leaked-globals
+++ b/tool/leaked-globals
@@ -18,6 +18,11 @@ end
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
@@ -46,9 +51,6 @@ end
# darwin's ld64 seems to require exception handling personality functions to be
# extern, so we allow the Rust one.
REPLACE.push("rust_eh_personality") if RUBY_PLATFORM.include?("darwin")
-# 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
print "Checking leaked global symbols..."
STDOUT.flush