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.
This commit is contained in:
parent
3a683964a0
commit
9e1ff2462b
@ -18,6 +18,11 @@ end
|
|||||||
config = ARGV.shift
|
config = ARGV.shift
|
||||||
count = 0
|
count = 0
|
||||||
col = Colorize.new
|
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)
|
config_code = File.read(config)
|
||||||
REPLACE = config_code.scan(/\bAC_(?:REPLACE|CHECK)_FUNCS?\((\w+)/).flatten
|
REPLACE = config_code.scan(/\bAC_(?:REPLACE|CHECK)_FUNCS?\((\w+)/).flatten
|
||||||
# REPLACE << 'memcmp' if /\bAC_FUNC_MEMCMP\b/ =~ config_code
|
# 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
|
# darwin's ld64 seems to require exception handling personality functions to be
|
||||||
# extern, so we allow the Rust one.
|
# extern, so we allow the Rust one.
|
||||||
REPLACE.push("rust_eh_personality") if RUBY_PLATFORM.include?("darwin")
|
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..."
|
print "Checking leaked global symbols..."
|
||||||
STDOUT.flush
|
STDOUT.flush
|
||||||
|
Loading…
x
Reference in New Issue
Block a user