Skip to content

Commit 9227a01

Browse files
authored
Check for invalid symbol names in llvm-nm output. (#17888)
See #12551 and: #17826 Older versions of llvm didn't used to mangle these __invoke symbols.
1 parent ca972e1 commit 9227a01

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/building.py

+3
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ def parse_llvm_nm_symbols(output):
315315
filename_pos = entry_pos
316316

317317
filename = line[:filename_pos]
318+
if entry_pos + 13 >= len(line):
319+
exit_with_error('error parsing output of llvm-nm: `%s`\nIf the symbol name here contains a colon, and starts with __invoke_, then the object file was likely built with an old version of llvm (please rebuild it).' % line)
320+
318321
status = line[entry_pos + 11] # Skip address, which is always fixed-length 8 chars.
319322
symbol = line[entry_pos + 13:]
320323

0 commit comments

Comments
 (0)