Include --no-llvm-bc
option in NM
macro only if usable
This commit is contained in:
parent
a9bfb64153
commit
08324ab9eb
Notes:
git
2023-04-08 05:51:44 +00:00
@ -258,6 +258,10 @@ AC_CHECK_TOOLS([OBJCOPY], [gobjcopy objcopy], [:])
|
||||
AC_CHECK_TOOLS([OBJDUMP], [gobjdump objdump])
|
||||
AC_CHECK_TOOLS([STRIP], [gstrip strip], [:])
|
||||
|
||||
# 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.
|
||||
AS_IF([${NM} --help | grep -q 'llvm-bc'], [NM="$NM --no-llvm-bc"])
|
||||
|
||||
AS_IF([test ! $rb_test_CFLAGS], [AS_UNSET(CFLAGS)]); AS_UNSET(rb_test_CFLAGS)
|
||||
AS_IF([test ! $rb_test_CXXFLAGS], [AS_UNSET(CXXFLAGS)]); AS_UNSET(rb_save_CXXFLAGS)
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/bin/bash
|
||||
export LANG=C LC_ALL=C # Suppress localication
|
||||
exec 2> >(exec grep -v \
|
||||
-e ' no symbols$' \
|
||||
>&2)
|
||||
|
@ -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, "")
|
||||
|
@ -65,7 +65,7 @@ endif
|
||||
# we rely.
|
||||
ifneq ($(findstring darwin,$(target_os)),)
|
||||
$(YJIT_LIB_SYMBOLS): $(YJIT_LIBS)
|
||||
$(Q) $(tooldir)/darwin-ar $(NM) --no-llvm-bc --defined-only --extern-only $(YJIT_LIBS) | \
|
||||
$(Q) $(tooldir)/darwin-ar $(NM) --defined-only --extern-only $(YJIT_LIBS) | \
|
||||
sed -n -e 's/.* //' -e '/^$(SYMBOL_PREFIX)rb_/p' \
|
||||
-e '/^$(SYMBOL_PREFIX)rust_eh_personality/p' \
|
||||
> $@
|
||||
|
Loading…
x
Reference in New Issue
Block a user